Documentation
¶
Index ¶
- Variables
- func ClientID(clientID, issuer string) (string, error)
- func Config(baseURL, clientID string) (*oauth2.Config, error)
- func FileTokenSource(ctx context.Context, issuer, filename string, config *oauth2.Config) oauth2.TokenSource
- func StoreToken(filename, issuer string, token *oauth2.Token, options ...storeTokenOption) error
- func TokenPath() string
- func Wrap(hndl http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
var ( ErrTokenNotFound = errors.New("OAuth token not found") ErrClientIDNotFound = errors.New("OAuth client ID not found") )
Functions ¶
func ClientID ¶
ClientID returns the client ID for the given issuer. If clientID is not empty, it is returned. If issuer is empty, it defaults to defaultIssuer. If issuer is unknown, ErrClientIDNotFound is returned.
func Config ¶
Config creates an OAuth2 config for the GitLab instance at baseURL. If baseURL is empty, it defaults to gitlab.com.
func FileTokenSource ¶
func FileTokenSource(ctx context.Context, issuer, filename string, config *oauth2.Config) oauth2.TokenSource
FileTokenSource returns an oauth2.TokenSource that is backed by a file on the file system. The token is refreshed automatically. New tokens are automatically written to the file.
func StoreToken ¶
StoreToken writes the provided token to the specified file.
func TokenPath ¶
func TokenPath() string
TokenPath returns the path of the token file based on the operating system:
- Mac OS: `~/Library/Application Support/gitlab-mcp/token.json` - Linux: `~/.config/gitlab-mcp/token.json` - Windows: `%APPDATA%\gitlab-mcp\token.json` - Other: `~/.gitlab-mcp/token.json`
Types ¶
This section is empty.