-
-
Save KyMidd/285f0cdbe1266f95ec2fa396aa8aed77 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_teams_event(body, event): | |
| # ... | |
| encrypted_token = get_token(dynamodb_client, aadObjectId, token_table_arn) | |
| # If unexpired token is found, send it to the processor lambda | |
| if encrypted_token: | |
| # Initialize AWS Lambda client | |
| lambda_client = boto3.client('lambda') | |
| # Prepare the event to send to the processor lambda | |
| # Add the token to the event | |
| event["token"] = encrypted_token | |
| # Asynchronously invoke the processor Lambda | |
| lambda_client.invoke( | |
| FunctionName=os.environ['WORKER_LAMBDA_NAME'], | |
| InvocationType='Event', # Async invocation | |
| Payload=json.dumps(event) | |
| ) | |
| # Return | |
| print("🟢 Successfully invoked the processor Lambda with the access token") | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment