githuboauth

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 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 NewProvider

func NewProvider(client browserflow.Client, store authn.SessionStore, sessions *authn.SessionManager, recorder audit.Recorder, loginTTL time.Duration) *browserflow.Provider

Types

type Client

type Client struct {

	// AccessSyncAppID enables GitHub-derived access. The OAuth client must then
	// be the GitHub App's own OAuth credential: after identity lookup the
	// user-to-server token lists the user's installations of that App and the
	// repositories the user can access through each, which become the user's
	// provider-derived grants. Zero disables the sync.
	AccessSyncAppID int64
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoints githubapp.Endpoints, publicURL *url.URL, clientID string, clientSecret []byte, apiVersion string, httpClient *http.Client) (*Client, error)

func (*Client) AccessibleRepositories

func (client *Client) AccessibleRepositories(ctx context.Context, accessToken string) ([]int64, error)

AccessibleRepositories re-derives the repositories a user token can reach through installations of the configured App; it is the refresh-time counterpart of the login sync and shares its bounds and fail-closed rules.

func (*Client) AuthorizationURL

func (client *Client) AuthorizationURL(state, _ string, verifier string) string

func (*Client) Exchange

func (client *Client) Exchange(ctx context.Context, code, verifier, _ string) (authn.Identity, error)

type TokenRejectedError

type TokenRejectedError struct{ Status int }

TokenRejectedError reports that GitHub refused the user token itself (401 or non-rate-limited 403), as opposed to a transient failure. Refresh-time access sync drops the stored token on this error and keeps it on any other.

func (TokenRejectedError) Error

func (err TokenRejectedError) Error() string

func (TokenRejectedError) Unauthorized

func (TokenRejectedError) Unauthorized() bool

Unauthorized marks the error for callers that only know the interface.

Jump to

Keyboard shortcuts

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