Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ def dns_access_direct(request, project_id):

# Apply the default credentials to the headers to make the request.
headers = {}
credentials.apply(headers)
url = "https://dns.googleapis.com/dns/v1/projects/{}".format(project_id)
credentials.before_request(request, "GET", url, headers)
response = request(
url="https://dns.googleapis.com/dns/v1/projects/{}".format(project_id),
url=url,
headers=headers,
)

Expand Down Expand Up @@ -213,6 +214,8 @@ def check_impersonation_expiration():
request=http_request,
)

credentials.refresh(http_request)

utcmax = _helpers.utcnow() + datetime.timedelta(seconds=TOKEN_LIFETIME_SECONDS)
utcmin = utcmax - datetime.timedelta(seconds=BUFFER_SECONDS)
assert utcmin < credentials._impersonated_credentials.expiry <= utcmax
Expand Down
Loading