Skip to content

oidc: add expiry key to mint_token response #18238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions tests/unit/oidc/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ def find_service(iface, **kw):
assert response == {
"success": True,
"token": "raw-macaroon",
"expires": 900,
}

assert oidc_service.verify_jwt_signature.calls == [
Expand Down Expand Up @@ -725,6 +726,7 @@ def find_service(iface, **kw):
assert response == {
"success": True,
"token": "raw-macaroon",
"expires": 900,
}

assert oidc_service.verify_jwt_signature.calls == [
Expand Down
2 changes: 1 addition & 1 deletion warehouse/oidc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def mint_token(
metrics = request.find_service(IMetricsService, context=None)
metrics.increment("warehouse.oidc.mint_token.github_reusable_workflow")

return {"success": True, "token": serialized}
return {"success": True, "token": serialized, "expires": expires_at}


def is_from_reusable_workflow(
Expand Down
Loading