Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitHubIdentityFromConfig ¶
func NewGitHubIdentityFromConfig(ctx context.Context, cfg *config.APIGitHubIdentityConfig, opts ...Option) (tokenprovider.TokenProvider, error)
NewGitHubIdentityFromConfig constructs a GitHub identity from application config. It resolves credentials, validates the configuration, and returns the appropriate TokenProvider implementation based on the credential type.
Types ¶
type App ¶
type App struct {
ClientID string
InstallationID int64
PrivateKey *rsa.PrivateKey
Hostname string
// contains filtered or unexported fields
}
App implements tokenprovider.TokenProvider using App App installation tokens.
func NewGitHubAppIdentity ¶
func NewGitHubAppIdentity(clientID string, installationID int64, key *rsa.PrivateKey, hostname string, opts ...Option) (*App, error)
NewGitHubAppIdentity constructs a GitHub identity from resolved values.
func (*App) GetToken ¶
func (g *App) GetToken(ctx context.Context, opts tokenprovider.RequestOptions) (tokenprovider.Token, error)
type Option ¶
type Option func(*App)
Option configures a GitHub identity.
func WithHTTPClient ¶
WithHTTPClient overrides the default HTTP client.
func WithManager ¶
WithManager overrides the cache manager.
func WithTokenURL ¶
WithTokenURL overrides the computed token endpoint URL (for testing).
type PAT ¶
type PAT struct {
// contains filtered or unexported fields
}
PAT implements tokenprovider.TokenProvider using a static Personal Access Token. PATs do not expire from the API's perspective (they have user-configured lifetimes), so no caching or refresh logic is needed.
func NewPATIdentity ¶
NewPATIdentity constructs a GitHub PAT identity from a resolved token string.
func (*PAT) GetToken ¶
func (p *PAT) GetToken(ctx context.Context, opts tokenprovider.RequestOptions) (tokenprovider.Token, error)