github

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

github_api_handler.go

github_handler_constants.go

Index

Constants

View Source
const (
	APIName                            = "github"                                       // APIName: represents the name of the API.
	DefaultBaseDomain                  = "api.github.com"                               // DefaultBaseDomain: represents the base domain for the github instance.
	OAuthTokenEndpoint                 = "github.com/login/oauth/access_token"          // OAuthTokenEndpoint: The endpoint to obtain an OAuth token.
	BearerTokenEndpoint                = ""                                             // BearerTokenEndpoint: The endpoint to obtain a bearer token.
	TokenRefreshEndpoint               = "github.com/login/oauth/access_token"          // TokenRefreshEndpoint: The endpoint to refresh an existing token.
	TokenInvalidateEndpoint            = "api.github.com/applications/:client_id/token" // TokenInvalidateEndpoint: The endpoint to invalidate an active token.
	BearerTokenAuthenticationSupport   = false                                          // BearerTokenAuthSuppport: A boolean to indicate if the API supports bearer token authentication.
	OAuthAuthenticationSupport         = true                                           // OAuthAuthSuppport: A boolean to indicate if the API supports OAuth authentication.
	OAuthWithCertAuthenticationSupport = true                                           // OAuthWithCertAuthSuppport: A boolean to indicate if the API supports OAuth with client certificate authentication.
)

Endpoint constants represent the URL suffixes used for GitHub token interactions.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubAPIHandler

type GitHubAPIHandler struct {
	OverrideBaseDomain string        // OverrideBaseDomain is used to override the base domain for URL construction.
	InstanceName       string        // InstanceName is the name of the GitHub instance.
	Logger             logger.Logger // Logger is the structured logger used for logging.
}

GitHubHandler implements the APIHandler interface for the GitHub API.

func (*GitHubAPIHandler) GetAPIBearerTokenAuthenticationSupportStatus

func (g *GitHubAPIHandler) GetAPIBearerTokenAuthenticationSupportStatus() bool

GetAPIBearerTokenAuthenticationSupportStatus returns a boolean indicating if bearer token authentication is supported in the api handler.

func (*GitHubAPIHandler) GetAPIOAuthAuthenticationSupportStatus

func (g *GitHubAPIHandler) GetAPIOAuthAuthenticationSupportStatus() bool

GetAPIOAuthAuthenticationSupportStatus returns a boolean indicating if OAuth authentication is supported in the api handler.

func (*GitHubAPIHandler) GetAPIOAuthWithCertAuthenticationSupportStatus

func (g *GitHubAPIHandler) GetAPIOAuthWithCertAuthenticationSupportStatus() bool

GetAPIOAuthWithCertAuthenticationSupportStatus returns a boolean indicating if OAuth with client certificate authentication is supported in the api handler.

func (*GitHubAPIHandler) GetBearerTokenEndpoint

func (g *GitHubAPIHandler) GetBearerTokenEndpoint() string

GetBearerTokenEndpoint returns the endpoint for obtaining a bearer token. Used for constructing API URLs for the http client.

func (*GitHubAPIHandler) GetDefaultBaseDomain

func (g *GitHubAPIHandler) GetDefaultBaseDomain() string

GetDefaultBaseDomain returns the default base domain used for constructing API URLs to the http client.

func (*GitHubAPIHandler) GetOAuthTokenEndpoint

func (g *GitHubAPIHandler) GetOAuthTokenEndpoint() string

GetOAuthTokenEndpoint returns the endpoint for obtaining an OAuth token. Used for constructing API URLs for the http client.

func (*GitHubAPIHandler) GetTokenInvalidateEndpoint

func (g *GitHubAPIHandler) GetTokenInvalidateEndpoint() string

GetTokenInvalidateEndpoint returns the endpoint for invalidating an active token. Used for constructing API URLs for the http client.

func (*GitHubAPIHandler) GetTokenRefreshEndpoint

func (g *GitHubAPIHandler) GetTokenRefreshEndpoint() string

GetTokenRefreshEndpoint returns the endpoint for refreshing an existing token. Used for constructing API URLs for the http client.

Jump to

Keyboard shortcuts

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