gitlab

package
v0.0.68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package gitlab provides the GitLab OAuth provider implementation

Index

Constants

View Source
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

View Source
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

View Source
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

View Source
const Class = "gitlab"

Class is the string that represents the GitLab provider class

Variables

AuthorizationFlows is the list of authorization flows that the DockerHub provider supports

Implements is the list of provider types that the DockerHub provider implements

Functions

func FormatPullRequestUpstreamID

func FormatPullRequestUpstreamID(id int) string

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

func FormatReleaseUpstreamID(id int) string

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

func FormatRepositoryUpstreamID(id int) string

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL