Documentation ¶
Index ¶
Constants ¶
View Source
const ( GitlabVerifierMin = 43 GitlabVerifierMax = 128 GitlabRedirectUriCLI = "http://127.0.0.1:9999/oauth/gitlab/callback" GitlabCallbackPath = "/oauth/gitlab/callback" GitlabTempServerPort = ":9999" )
Variables ¶
This section is empty.
Functions ¶
func GitlabAuthorizeUrl ¶
func GitlabAuthorizeUrl(redirectUri string, scopes []string, verifier CodeVerifier) (url.URL, error)
GitlabAuthorizeUrl returns a URL that can be used for a Gitlab OAuth authorize request
func GitlabTokenUrl ¶
func GitlabTokenUrl(redirectUri, authorizationCode string, verifier CodeVerifier) url.URL
GitlabTokenUrl returns a URL that can be used for a Gitlab OAuth token request
Types ¶
type CodeVerifier ¶
type CodeVerifier struct {
// contains filtered or unexported fields
}
CodeVerifier is for PKCE OAuth workflows. This will generate a random string with a random length.
func NewCodeVerifier ¶
func NewCodeVerifier(min, max int) (CodeVerifier, error)
func (CodeVerifier) CodeChallenge ¶
func (c CodeVerifier) CodeChallenge() (string, error)
CodeChallenge is an encoded hash value to be used in the authorization flow
func (CodeVerifier) RawValue ¶
func (c CodeVerifier) RawValue() string
RawValue is the original string to be used to fetch a refresh token during the OAuth callback flow
type GitlabTokenResponse ¶
type GitlabTokenResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int64 `json:"expires_in"` RefreshToken string `json:"refresh_token"` CreatedAt int64 `json:"created_at"` }
GitlabTokenResponse is the expected struct when going through OAuth authorization code grant process
Click to show internal directories.
Click to hide internal directories.