Documentation
¶
Index ¶
- Constants
- type AppToken
- type Client
- type OptFunc
- func WithAppBaseURL(appBaseURL string) OptFunc
- func WithAppData(appData map[string][]byte) OptFunc
- func WithAppID(appID string) OptFunc
- func WithCache(cache *cache.TokenCache, kind, name, namespace string) OptFunc
- func WithInstllationID(installationID string) OptFunc
- func WithPrivateKey(pk []byte) OptFunc
- func WithProxyURL(proxyURL *url.URL) OptFunc
Constants ¶
const ( AppIDKey = "githubAppID" AppInstallationIDKey = "githubAppInstallationID" AppPrivateKey = "githubAppPrivateKey" AppBaseUrlKey = "githubAppBaseURL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppToken ¶
AppToken contains a GitHub App installation token and its expiry.
func (*AppToken) GetDuration ¶
GetDuration returns the duration until the token expires.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authentication provider for GitHub Apps.
func (*Client) GetToken ¶
GetToken returns the token that can be used to authenticate as a GitHub App installation. Ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation
type OptFunc ¶
type OptFunc func(*Client)
OptFunc enables specifying options for the provider.
func WithAppBaseURL ¶
WithAppBaseURL configures the GitHub API endpoint to use to fetch GitHub App installation token.
func WithAppData ¶
WithAppData configures the client using data from a map
func WithCache ¶
func WithCache(cache *cache.TokenCache, kind, name, namespace string) OptFunc
WithCache sets the token cache and the object involved in the operation for recording cache events.
func WithInstllationID ¶
WithInstallationID configures the installation ID of the GitHub App.
func WithPrivateKey ¶
WithPrivateKey configures the private key of the GitHub App.
func WithProxyURL ¶
WithProxyURL sets the proxy URL to use with the transport.