source/core-api/lambda_functions/get_list_expired_tokens.py [17:44]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DDB_TABLE_NAME = os.environ["TOKEN_TABLE"]
EVENT_ID = os.environ["EVENT_ID"]
SOLUTION_ID = os.environ['SOLUTION_ID']

user_agent_extra = {"user_agent_extra": SOLUTION_ID}
user_config = config.Config(**user_agent_extra)
boto_session = boto3.session.Session()
region = boto_session.region_name
ddb_resource = boto3.resource('dynamodb', config=user_config)
ddb_table = ddb_resource.Table(DDB_TABLE_NAME)
    
def lambda_handler(event, context):
    """
    This function is the entry handler for Lambda.
    """
    
    print(event)
    client_event_id = deep_clean(event['queryStringParameters']['event_id'])
    headers = {
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin': '*'
    }
    if client_event_id == EVENT_ID:
        try:
            current_time = int(time.time())
            response = ddb_table.query(
                IndexName="EventExpiresIndex",
                ProjectionExpression="request_id",
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/core-api/lambda_functions/get_num_active_tokens.py [18:45]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DDB_TABLE_NAME = os.environ["TOKEN_TABLE"]
EVENT_ID = os.environ["EVENT_ID"]
SOLUTION_ID = os.environ['SOLUTION_ID']

user_agent_extra = {"user_agent_extra": SOLUTION_ID}
user_config = config.Config(**user_agent_extra)
boto_session = boto3.session.Session()
region = boto_session.region_name
ddb_resource = boto3.resource('dynamodb', config=user_config)
ddb_table = ddb_resource.Table(DDB_TABLE_NAME)
    
def lambda_handler(event, context):
    """
    This function is the entry handler for Lambda.
    """

    print(event)
    client_event_id = deep_clean(event['queryStringParameters']['event_id'])
    headers = { 
                  'Content-Type': 'application/json',
                  'Access-Control-Allow-Origin': '*'
            }
    if client_event_id == EVENT_ID:
        try:
            current_time = int(time.time())
            response = ddb_table.query(
                IndexName="EventExpiresIndex",
                ProjectionExpression="request_id",
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



