Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 9f876a7

Browse files
committed
Requirement4 - ABAC
1 parent 7c85f2f commit 9f876a7

File tree

6 files changed

+538
-3
lines changed

6 files changed

+538
-3
lines changed

backend/auth.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Resources:
2525
AttributeDataType: String
2626
Mutable: true
2727
Required: false
28+
- Name: yearsAsMember
29+
AttributeDataType: Number
30+
Mutable: true
31+
Required: false
2832

2933
UserPoolClient:
3034
Type: AWS::Cognito::UserPoolClient

backend/layers/shared.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def get_user_claims(jwt_token):
6060

6161
claims = {
6262
"username": verified_claims.get("cognito:username"),
63-
"role": verified_claims.get("custom:role")
63+
"role": verified_claims.get("custom:role"),
64+
"canSeeBestsellers": verified_claims.get("custom:canSeeBestsellers")
6465
}
6566
print("claims", claims)
6667

0 commit comments

Comments
 (0)