Skip to content

Commit

Permalink
Fix audience 1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexv-smirnov committed Apr 5, 2024
1 parent 97164ae commit e9c830c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/auth/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class IamTokenServiceForTest(iam_token_service_pb2_grpc.IamTokenServiceServicer)
def Create(self, request, context):
print("IAM token service request: {}".format(request))
# Validate jwt:
decoded = jwt.decode(request.jwt, key=PUBLIC_KEY, algorithms=["PS256"], audience="test-audience")
decoded = jwt.decode(request.jwt, key=PUBLIC_KEY, algorithms=["PS256"], audience=ydb.iam.auth.DEFAULT_YC_IAM_AUDIENCE)
assert decoded["iss"] == SERVICE_ACCOUNT_ID
assert decoded["aud"] == "test-audience"
assert decoded["aud"] == ydb.iam.auth.DEFAULT_YC_IAM_AUDIENCE
assert abs(decoded["iat"] - time.time()) <= 60
assert abs(decoded["exp"] - time.time()) <= 3600

Expand Down

0 comments on commit e9c830c

Please sign in to comment.