Exemplo n.º 1
0
def change_email(event, context):
    username = event['pathParameters']['username']
    body = json.loads(event['body'])

    response = user.change_email(username, body)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 2
0
def update_organization(event, context):
    key = event['pathParameters']['id']
    body = json.loads(event['body'])

    response = organization.update(key, body)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 3
0
def encode_token(event, context):
    """Receive a username and password, and return a JWT token"""
    username = event['queryStringParameters']['username']
    password = event['queryStringParameters']['password']

    response = auth.encode_token(username, password)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 4
0
def create_user(event, context):
    body = json.loads(event['body'])

    response = user.create(body)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 5
0
def delete_organization(event, context):
    key = event['pathParameters']['id']

    response = organization.delete(key)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 6
0
def create_organizations(event, context):
    body = json.loads(event['body'])

    response = organization.create_many(body)
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 7
0
def list_organizations(event, context):
    """Return all of the organizations in the DB."""
    response = organization.ls()
    response = utils.add_cors_headers(response)
    return response
Exemplo n.º 8
0
def authorize(event, context):
    response = auth.authenticate_user(event['headers']['Authorization'])
    response = utils.add_cors_headers(response)
    return response