Documentation
¶
Overview ¶
Package oauth implements GitLab's provider-owned OAuth2 protocol boundary.
Index ¶
- Variables
- type Client
- func (c *Client) AuthorizationURL(state string, scopes []string) (string, error)
- func (c *Client) ExchangeCode(ctx context.Context, code string) (TokenSet, error)
- func (c *Client) GetProject(ctx context.Context, accessToken, projectID string) (Project, error)
- func (c *Client) ListProjects(ctx context.Context, accessToken string) ([]Project, error)
- func (c *Client) Refresh(ctx context.Context, refreshToken string) (TokenSet, error)
- func (c *Client) Revoke(ctx context.Context, accessToken string) error
- type Config
- type Project
- type TokenSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidGrant = xerror.New(xerror.KindInvalidInput, "GITLAB_INVALID_GRANT", "GitLab OAuth invalid grant")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AuthorizationURL ¶
func (*Client) ExchangeCode ¶
func (*Client) GetProject ¶
GetProject resolves one stable GitLab project ID through the authenticated grant.
func (*Client) ListProjects ¶
ListProjects returns a bounded list of projects visible to the authenticated grant.
type Project ¶
type Project struct {
ID int64 `json:"id"`
Name string `json:"name"`
PathWithNS string `json:"path_with_namespace"`
WebURL string `json:"web_url"`
HTTPURLToRepo string `json:"http_url_to_repo"`
DefaultBranch string `json:"default_branch"`
}
Project is safe GitLab project identity plus the provider-owned native Git endpoint.
Click to show internal directories.
Click to hide internal directories.