Skip to content

Commit

Permalink
Issue #3 edit apigw auth identity_source comment specify header requi…
Browse files Browse the repository at this point in the history
…rement

Former-commit-id: 2e15f5b
  • Loading branch information
cschneider-vertical-relevance committed Apr 28, 2022
1 parent 33ed1cc commit 23a4dc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions stacks/client_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def apigw(self):
response_types=[aws_apigatewayv2_authorizers_alpha.HttpLambdaResponseType.SIMPLE],
results_cache_ttl = Duration.seconds(0),
identity_source = [
"$request.header.Authorization", # request must match or 401: requests.get(invoke_url,headers={'Authorization':'foo'})
# "$context.identity.principalOrgId",
]
"$request.header.Authorization", # Authorization my be present in headers or 401, e.g. r = requests.post(url,auth = auth, ...)
)

# auth - iam
Expand Down Expand Up @@ -141,7 +139,7 @@ def apigw(self):
# authorizer=authorizer_iam
)

self.apigw_full_invoke_url = f'{self.http_api.url}{self.path}'
self.apigw_full_invoke_url = f'{self.http_api.url[:-1]}{self.path}' # remove duplicate slash

CfnOutput(self, "ApigwInvokeUrl", value=self.apigw_full_invoke_url)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def lambda_handler(event,context):

print(f'BotoAWSRequestsAuth:\n{auth}')

# headers = {'Authorization':'foo'}

control_broker_consumer_input = event

r = requests.post(
Expand Down

0 comments on commit 23a4dc3

Please sign in to comment.