InvalidSubjectTokenError#

exception gafaelfawr.exceptions.InvalidSubjectTokenError#

Bases: OAuthError

The GitHub Actions ID token presented to the token exchange is invalid.

This corresponds to the invalid_grant error in RFC 6749 and RFC 8693, which the latter specifies for a subject token that is “invalid for any reason, including being expired, revoked, or malformed.” It is also used when the token verifies but matches no enabled GitHub project.

Unlike InvalidGrantError, the details are sent to the client. The message names the check that failed and values from the caller’s own token, which GitHub minted for the caller and which are already theirs to read, so that a workflow author can fix the problem without access to Gafaelfawr’s logs. It must never describe registry entries that did not match, so that the exchange cannot be used to probe what the registry trusts.

error: ClassVar[str] = 'invalid_grant'#

The RFC 6749 or RFC 6750 error code for this exception.

message: ClassVar[str] = 'Invalid GitHub Actions token'#

The summary message to use when logging this error.