Skip to content

Commit d980334

Browse files
authored
Merge pull request #577 from iddqdex/patch-1
fix deprecation warning in auth.py
1 parent a2a8181 commit d980334

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ydb/iam/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import grpc
44
import time
55
import abc
6-
from datetime import datetime
6+
from datetime import datetime, timezone
77
import json
88
import os
99

@@ -43,8 +43,8 @@
4343
def get_jwt(account_id, access_key_id, private_key, jwt_expiration_timeout, algorithm, token_service_url, subject=None):
4444
assert jwt is not None, "Install pyjwt library to use jwt tokens"
4545
now = time.time()
46-
now_utc = datetime.utcfromtimestamp(now)
47-
exp_utc = datetime.utcfromtimestamp(now + jwt_expiration_timeout)
46+
now_utc = datetime.fromtimestamp(now, timezone.utc)
47+
exp_utc = datetime.fromtimestamp(now + jwt_expiration_timeout, timezone.utc)
4848
payload = {
4949
"iss": account_id,
5050
"aud": token_service_url,

0 commit comments

Comments
 (0)