github

package
v0.0.0-...-277766b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubAuthenticator

type GitHubAuthenticator struct {
	ClientId     string
	ClientSecret string
}

func (*GitHubAuthenticator) GetAuthRedirect

func (a *GitHubAuthenticator) GetAuthRedirect() (string, string)

GetAuthRedirect returns a redirect URL and a state parameter that should be stored in the user's browser to correlate the authentication result and request.

func (*GitHubAuthenticator) GetTokens

func (a *GitHubAuthenticator) GetTokens(code string) (*GitHubToken, error)

GetTokens returns the GitHub Oauth tokens from the service given a token request code. The returned tokens are used for authentication to the GitHub API.

This relies on a GitHub Oauth application on the GitHub side to act as the client for these tokens.

func (*GitHubAuthenticator) GetUsernameWithToken

func (a *GitHubAuthenticator) GetUsernameWithToken(accessToken string) (string, error)

GetUsernameWithToken returns the authenticated user's GitHub username given an Oauth auth token.

type GitHubToken

type GitHubToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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