Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/e/n/encoded-HEAD/src/encoded/views/access_key.py   encoded(Download)
    Everyone,
)
from ..authentication import (
    generate_password,
    generate_user,
def access_key_add(context, request):
    crypt_context = request.registry[CRYPT_CONTEXT]
 
    if 'access_key_id' not in request.validated:
        request.validated['access_key_id'] = generate_user()
def access_key_reset_secret(context, request):
    request.validated = context.properties.copy()
    crypt_context = request.registry[CRYPT_CONTEXT]
    password = generate_password()
    new_hash = crypt_context.encrypt(password)
def access_key_disable_secret(context, request):
    request.validated = context.properties.copy()
    crypt_context = request.registry[CRYPT_CONTEXT]
    new_hash = crypt_context.encrypt('', scheme='unix_disabled')
    request.validated['secret_access_key_hash'] = new_hash