Commit 3da50465 by Jérome Perrin

access_token: use os.urandom to generate token

Using same method as python 3.6's secrets module.
parent d9f87e1c
Pipeline #7518 running with stage
in 0 seconds
alpha = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
random_id = ''
for _ in range(0, 128):
random_id += random.choice(alpha)
import os
import base64
# This is python 3.6 secret.token_urlsafe
random_id = base64.urlsafe_b64encode(os.urandom(48)).rstrip(b'=').decode('ascii')
# Define Reference from ID provided by portal_ids
portal = context.getPortalObject()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment