Enhances authentication token handling with metadata#4896
Open
Enhances authentication token handling with metadata#4896
Conversation
5 tasks
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
c12af76 to
65aeae8
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
🤖 Augment PR SummarySummary: This PR threads richer authentication-token metadata through integrations to improve diagnostics (especially for auth failures) without intending to change request behavior. Changes:
Technical Notes: Token metadata is intended to be surfaced primarily in logs via 🤖 Was this summary useful? React with 👍 or 👎 |
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
65aeae8 to
983fab9
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
983fab9 to
8646077
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
8646077 to
b08cdc0
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 19, 2026
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
b08cdc0 to
56c0f92
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
56c0f92 to
9d89e29
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 20, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
6984d8a to
08e3d42
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
08e3d42 to
30d9c9f
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 22, 2026
30d9c9f to
4db1dd5
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
4db1dd5 to
bd4f62d
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 23, 2026
bd4f62d to
83ffec2
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
83ffec2 to
676b692
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
676b692 to
649cd07
Compare
sergeibbb
added a commit
that referenced
this pull request
Jan 26, 2026
Introduces `TokenInfo` and `TokenWithInfo` types to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration. This refactoring replaces direct `accessToken` strings with the new `TokenWithInfo` object across various API calls within integration providers. Benefits include: - Provides richer context in `AuthenticationError` messages for improved debugging. - Increases type safety and clarity by explicitly passing token metadata. (#4880, #4896)
Introduces a `type` property to authentication session and token information objects. * Sets the type to 'pat' for self-managed GitHub and GitLab integrations, indicating a Personal Access Token. * Initializes the type as `undefined` for built-in sessions and GitKraken tokens where a specific method isn't specified by the provider. * Ensures the `type` property is propagated and handled correctly across integration authentication flows and error reporting. (#4880, #4896)
649cd07 to
46a8de0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements #4880
Introduces
TokenInfoandTokenWithInfotypes to encapsulate authentication access tokens along with their relevant metadata, such as provider ID, cloud status, scopes, and expiration.This refactoring replaces direct
accessTokenstrings with the newTokenWithInfoobject across various API calls within integration providers. Benefits include:AuthenticationErrormessages for improved debugging.Implementation Details
Notes about the PR size
Despite it looks big, the only thing is done is passing more information from the point where we have the whole session to the point where a error is handled and the AuthenticationError is formed. Nothing else is changed. The PR does not change the behavior. For example,
try-catchblocksNotes about the solution
There was an option to catch AuthenticationError upper in the call-stack and enrich it with the session metadata. By doing this I could reduce amount of changes. But it's hard identify all the possible points where it should be done, because a thrown exception does not highlight its type: such a place where AuthenticationError caught and logged can be missed, it can be caught earlier before it reaches your point, new points can appear later.
By requiring AuthenticationError to receive all the meta information everything is checked at compile time. Yes, we have to do massive changes once, but then it's always correct and checked by the compiler.
Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses