gitlab

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyChangeWebhook

func VerifyChangeWebhook(signingToken, deliveryID, timestamp, signature, event string, body []byte, now time.Time, authority WebhookAuthority) (gitprovider.VerifiedChangeEvent, error)

VerifyChangeWebhook authenticates a GitLab Standard Webhooks delivery before parsing it and applies only Braidplane-owned connection and repository IDs.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps GitLab merge request APIs behind Braidplane's provider proposal contract.

func New

New creates a GitLab provider proposal client.

func NewOAuth

NewOAuth creates a GitLab provider proposal client using OAuth bearer authentication.

func (*Client) BootstrapRepository

func (c *Client) BootstrapRepository(
	ctx context.Context,
	req gitprovider.RepositoryBootstrapRequest,
) (result *gitprovider.RepositoryBootstrapResult, resultErr error)

BootstrapRepository creates a private GitLab project and one exact initial commit.

func (*Client) CreateProposal

func (c *Client) CreateProposal(
	ctx context.Context,
	req gitprovider.ProposalRequest,
) (*gitprovider.ProposalRef, error)

CreateProposal creates a GitLab merge request.

func (*Client) DeleteRepository

func (c *Client) DeleteRepository(ctx context.Context, repositoryID string) error

DeleteRepository uses the immutable identity returned by bootstrap, never a namespace lookup.

func (*Client) EnsureProofWebhook

func (c *Client) EnsureProofWebhook(ctx context.Context, projectID int64, callbackURL, signingToken string, existingHookID int64) (ProofWebhook, error)

EnsureProofWebhook creates or rotates the Braidplane-managed merge-request hook.

func (*Client) GetProposal

GetProposal returns one merge request, including closed and merged states.

func (*Client) ListOpenProposals

func (c *Client) ListOpenProposals(
	ctx context.Context,
	req gitprovider.ProposalListRequest,
) ([]gitprovider.ProposalRef, error)

ListOpenProposals returns open merge requests for the requested source/target branches.

func (*Client) ProjectID

func (c *Client) ProjectID(ctx context.Context) (int64, error)

func (*Client) PublishProofCheck

func (c *Client) PublishProofCheck(ctx context.Context, check gitprovider.ProofCheck) error

PublishProofCheck uses an MR note because GitLab commit statuses create CI pipelines and cannot represent an informational, neutral check.

func (*Client) UpdateProposal

UpdateProposal updates a GitLab merge request title and description.

func (*Client) ValidateRepository

func (c *Client) ValidateRepository(ctx context.Context, branch string) error

ValidateRepository verifies that the connection can write the selected project branch.

type ProofWebhook

type ProofWebhook struct {
	ProjectID int64
	HookID    int64
}

type WebhookAuthority

type WebhookAuthority struct {
	ProviderConnectionID string
	RepositoryID         string
}

Jump to

Keyboard shortcuts

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