Documentation ¶
Overview ¶
Package gitlab provides the GitLab OAuth provider implementation
Index ¶
- Constants
- Variables
- func FormatPullRequestUpstreamID(id int) string
- func FormatReleaseUpstreamID(id int) string
- func FormatRepositoryUpstreamID(id int) string
- func MarshalV1Config(rawCfg json.RawMessage) (json.RawMessage, error)
- func New(cred provifv1.GitLabCredential, cfg *minderv1.GitLabProviderConfig, ...) (*gitlabClient, error)
- func ParseV1Config(rawCfg json.RawMessage) (*minderv1.GitLabProviderConfig, error)
Constants ¶
const ( // RepoPropertyProjectName represents the gitlab project RepoPropertyProjectName = "gitlab/project_name" // RepoPropertyDefaultBranch represents the gitlab default branch RepoPropertyDefaultBranch = "gitlab/default_branch" // RepoPropertyNamespace represents the gitlab repo namespace RepoPropertyNamespace = "gitlab/namespace" // RepoPropertyLicense represents the gitlab repo license RepoPropertyLicense = "gitlab/license" // RepoPropertyCloneURL represents the gitlab repo clone URL RepoPropertyCloneURL = "gitlab/clone_url" // RepoPropertyHookID represents the gitlab repo hook ID RepoPropertyHookID = "gitlab/hook_id" // RepoPropertyHookURL represents the gitlab repo hook URL RepoPropertyHookURL = "gitlab/hook_url" )
Repository Properties
const ( // PullRequestProjectID represents the gitlab project ID PullRequestProjectID = "gitlab/project_id" // PullRequestNumber represents the gitlab merge request number PullRequestNumber = "gitlab/merge_request_number" // PullRequestSourceBranch represents the gitlab source branch PullRequestSourceBranch = "gitlab/source_branch" // PullRequestTargetBranch represents the gitlab target branch PullRequestTargetBranch = "gitlab/target_branch" // PullRequestAuthor represents the gitlab author PullRequestAuthor = "gitlab/author" // PullRequestCommitSHA represents the gitlab commit SHA PullRequestCommitSHA = "gitlab/commit_sha" // PullRequestURL represents the gitlab merge request URL PullRequestURL = "gitlab/merge_request_url" )
Pull Request Properties
const ( // ReleasePropertyProjectID represents the gitlab project ID ReleasePropertyProjectID = "gitlab/project_id" // ReleasePropertyTag represents the gitlab release tag name. // NOTE: This is used for release discovery, not for creating releases. ReleasePropertyTag = "gitlab/tag" // ReleasePropertyBranch represents the gitlab release branch ReleasePropertyBranch = "gitlab/branch" )
Release Properties
const Class = "gitlab"
Class is the string that represents the GitLab provider class
Variables ¶
var AuthorizationFlows = []db.AuthorizationFlow{ db.AuthorizationFlowUserInput, db.AuthorizationFlowOauth2AuthorizationCodeFlow, }
AuthorizationFlows is the list of authorization flows that the DockerHub provider supports
var Implements = []db.ProviderType{ db.ProviderTypeGit, db.ProviderTypeRest, db.ProviderTypeRepoLister, }
Implements is the list of provider types that the DockerHub provider implements
Functions ¶
func FormatPullRequestUpstreamID ¶
FormatPullRequestUpstreamID returns the upstream ID for a gitlab merge request This is done so we don't have to deal with conversions in the provider when dealing with entities
func FormatReleaseUpstreamID ¶
FormatReleaseUpstreamID returns the upstream ID for a gitlab release This is done so we don't have to deal with conversions in the provider when dealing with entities
func FormatRepositoryUpstreamID ¶
FormatRepositoryUpstreamID returns the upstream ID for a gitlab project This is done so we don't have to deal with conversions in the provider when dealing with entities
func MarshalV1Config ¶
func MarshalV1Config(rawCfg json.RawMessage) (json.RawMessage, error)
MarshalV1Config marshals and validates the given config so it can safely be stored in the database
func New ¶
func New( cred provifv1.GitLabCredential, cfg *minderv1.GitLabProviderConfig, webhookURL string, currentWebhookSecret string, ) (*gitlabClient, error)
New creates a new GitLab provider Note that the webhook URL should already contain the provider class in the path
func ParseV1Config ¶
func ParseV1Config(rawCfg json.RawMessage) (*minderv1.GitLabProviderConfig, error)
ParseV1Config parses the raw configuration into a GitLabProviderConfig
TODO: This should be moved to a common location
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package manager contains the GitLabProviderClassManager
|
Package manager contains the GitLabProviderClassManager |
Package webhooksecret provides a way to generate and verify secrets for GitLab webhooks.
|
Package webhooksecret provides a way to generate and verify secrets for GitLab webhooks. |