Documentation
¶
Index ¶
- Constants
- Variables
- func Config(baseURL, clientID string) *oauth2.Config
- 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
Constants ¶
View Source
const (
DefaultClientID = "039e1e052b348d4e45e55bd50bd5cd1fa28b6ee3d044962587fd78bf68ceae4f"
)
Variables ¶
View Source
var ErrTokenNotFound = errors.New("token not found")
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.