GitHubAppTokenSource
IntelligenceX.Telemetry.GitHub
Mints and caches the installation token of a GitHub App: a ten-minute JWT signed with the App's key buys a token that lasts an hour, renewed five minutes before it expires.
Inheritance
- object
- GitHubAppTokenSource
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property GitHubCredentialResolution.App
Accepted by parameters 1
- Constructor GitHubAppAuthHandler.GitHubAppAuthHandler
Constructors
public GitHubAppTokenSource(GitHubAppSettings settings, HttpClient? client = null, Func<DateTimeOffset>? clock = null) #Creates a token source; client is for tests.
Parameters
- settings IntelligenceX.Telemetry.GitHub.GitHubAppSettings
- client System.Net.Http.HttpClient? = null
- clock System.Func<System.DateTimeOffset>? = null
Methods
public void Dispose() #Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public async Task<string> GetTokenAsync(CancellationToken cancellationToken = default) #The current installation token, minted or renewed when needed.
Parameters
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<string>public static bool IsSignInFailure(Exception error, CancellationToken cancellationToken) #Whether error means the App couldn't sign in (unreachable, timed out, refused, bad key or answer), as opposed to the caller cancelling.
Parameters
- error System.Exception
- cancellationToken System.Threading.CancellationToken
Returns
boolInherited Methods
Properties
public long InstallationId { get; } #The installation ID tokens are minted for.
Fields
public static readonly TimeSpan RetryAfter #How long every caller skips the App after it failed to sign in, before trying again.