Skip to content

Commit

Permalink
Fix iam test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexv-smirnov committed Apr 5, 2024
1 parent 57c787e commit 97164ae
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(jwt_token, key=PUBLIC_KEY, algorithms=["RS256"], audience="test-audience")
decoded = jwt.decode(request.jwt, key=PUBLIC_KEY, algorithms=["PS256"], audience="test-audience")
assert decoded["iss"] == SERVICE_ACCOUNT_ID
assert decoded["aud"] == "https://iam.api.cloud.yandex.net/iam/v1/tokens"
assert decoded["aud"] == "test-audience"
assert abs(decoded["iat"] - time.time()) <= 60
assert abs(decoded["exp"] - time.time()) <= 3600

Expand Down

0 comments on commit 97164ae

Please sign in to comment.