githubappauth

package module
v0.0.0-...-3efe9e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallationTokenOptions

func InstallationTokenOptions(repoName string) (*github.InstallationTokenOptions, error)

func ParsePrivateKey

func ParsePrivateKey(privateKey string) (*rsa.PrivateKey, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf *Config) (*Client, error)

func (*Client) CreateJWT

func (c *Client) CreateJWT(now time.Time) (string, error)

func (*Client) Enabled

func (c *Client) Enabled() bool

func (*Client) NewGitHubClient

func (c *Client) NewGitHubClient(ctx context.Context, baseURL string) (*github.Client, error)

func (*Client) ResolveInstallationToken

func (c *Client) ResolveInstallationToken(ctx context.Context, config *InstallationTokenConfig, repoName string) (string, error)

func (*Client) ValidateBaseURL

func (c *Client) ValidateBaseURL(baseURL string) (*url.URL, error)

type Config

type Config struct {
	AppID               string
	PrivateKey          string
	AllowedBaseURLHosts []string
}

Config is the server-side GitHub App credential set.

type InstallationTokenConfig

type InstallationTokenConfig struct {
	BaseURL        string
	InstallationID uint64
}

type OAuthClient

type OAuthClient struct {
	// contains filtered or unexported fields
}

func NewOAuthClient

func NewOAuthClient(conf *OAuthConfig) (*OAuthClient, error)

func (*OAuthClient) AuthorizationURL

func (c *OAuthClient) AuthorizationURL(state string) (string, error)

func (*OAuthClient) Enabled

func (c *OAuthClient) Enabled() bool

func (*OAuthClient) ExchangeCode

func (c *OAuthClient) ExchangeCode(ctx context.Context, code string) (*oauth2.Token, error)

func (*OAuthClient) GetAuthenticatedUser

func (c *OAuthClient) GetAuthenticatedUser(ctx context.Context, token *oauth2.Token) (*github.User, error)

func (*OAuthClient) NewUserClient

func (c *OAuthClient) NewUserClient(ctx context.Context, token *oauth2.Token) (*github.Client, error)

type OAuthConfig

type OAuthConfig struct {
	ClientID                 string
	ClientSecret             string
	OAuthBaseURL             string
	APIBaseURL               string
	RedirectURL              string
	Scopes                   []string
	AllowedOAuthBaseURLHosts []string
	AllowedAPIBaseURLHosts   []string
}

OAuthConfig is the GitHub App user-to-server OAuth credential set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL