-
-
Save KyMidd/0485d1b208230cb11fdf881cdcaa872b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def handle_auth_code_callback(body, event, auth_code, aad_object_id): | |
| # ... | |
| conversation_event = json.loads(response.get("Item")["event"]["S"]) | |
| # Add the token to the event | |
| conversation_event["token"] = encrypted_token_base64 | |
| # Trigger the Vera Worker lambda to process the event | |
| lambda_client = boto3.client('lambda') | |
| # Asynchronously invoke the processor Lambda | |
| lambda_client.invoke( | |
| FunctionName=os.environ['WORKER_LAMBDA_NAME'], | |
| InvocationType='Event', # Async invocation | |
| Payload=json.dumps(conversation_event) | |
| ) | |
| # Debug | |
| if os.environ.get("VERA_DEBUG") == "True": | |
| print("🟢 Successfully invoked the processor Lambda with the access token") | |
| # Delete the saved conversation event from DynamoDB | |
| dynamodb_client.delete_item( | |
| TableName=conversation_table_arn, | |
| Key={ | |
| "aadObjectId": {"S": aad_object_id} | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment