Documentation ¶
Overview ¶
Package oauth2githubapp provides an OAuth 2.0 client for GitHub App.
This package implements the authentication method described in https://docs.github.com/en/developers/apps/authenticating-with-github-apps
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
func LoadPrivateKey(name string) (*rsa.PrivateKey, error)
LoadPrivateKey reads the private key file of GitHub App
func ParsePrivateKey ¶
func ParsePrivateKey(b []byte) (*rsa.PrivateKey, error)
ParsePrivateKey parses the private key of GitHub App
Types ¶
type Config ¶
type Config struct { PrivateKey *rsa.PrivateKey AppID string InstallationID string // BaseURL is an endpoint of GitHub API. // Any trailing slash is trimmed. // If not set, it defaults to https://api.github.com BaseURL string }
Config represents a config of GitHub App Installation
func (Config) TokenSource ¶
func (c Config) TokenSource(ctx context.Context) oauth2.TokenSource
TokenSource returns an oauth2.TokenSource for GitHub App Installation
Click to show internal directories.
Click to hide internal directories.