Skip to content

Commit c9f8a82

Browse files
feat: add API methods for root and user resources with custom authorization
1 parent aebe524 commit c9f8a82

File tree

1 file changed

+11
-0
lines changed
  • python/amazon-verified-permissions-rest-api/stack/apigw

1 file changed

+11
-0
lines changed

python/amazon-verified-permissions-rest-api/stack/apigw/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ def __init__(
2626
authorizer = create_authorizer(self, authorizer)
2727

2828
# Create API resources and methods
29+
30+
# ("/") resource
31+
self.api.root.add_method(
32+
"GET",
33+
lambda_integration(user_lambda),
34+
authorizer=authorizer,
35+
authorization_type=apigw.AuthorizationType.CUSTOM,
36+
)
37+
38+
# ("/admin") resource
2939
admin_resource = self.api.root.add_resource("admin")
3040
admin_resource.add_method(
3141
"GET",
@@ -34,6 +44,7 @@ def __init__(
3444
authorization_type=apigw.AuthorizationType.CUSTOM,
3545
)
3646

47+
# ("/user") resource
3748
user_resource = self.api.root.add_resource("user")
3849
user_resource.add_method(
3950
"GET",

0 commit comments

Comments
 (0)