Documentation
¶
Index ¶
- func VerifyChangeWebhook(signingToken, deliveryID, timestamp, signature, event string, body []byte, ...) (gitprovider.VerifiedChangeEvent, error)
- type Client
- func (c *Client) BootstrapRepository(ctx context.Context, req gitprovider.RepositoryBootstrapRequest) (result *gitprovider.RepositoryBootstrapResult, resultErr error)
- func (c *Client) CreateProposal(ctx context.Context, req gitprovider.ProposalRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) DeleteRepository(ctx context.Context, repositoryID string) error
- func (c *Client) EnsureProofWebhook(ctx context.Context, projectID int64, callbackURL, signingToken string, ...) (ProofWebhook, error)
- func (c *Client) GetProposal(ctx context.Context, req gitprovider.ProposalGetRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) ListOpenProposals(ctx context.Context, req gitprovider.ProposalListRequest) ([]gitprovider.ProposalRef, error)
- func (c *Client) ProjectID(ctx context.Context) (int64, error)
- func (c *Client) PublishProofCheck(ctx context.Context, check gitprovider.ProofCheck) error
- func (c *Client) UpdateProposal(ctx context.Context, req gitprovider.ProposalUpdateRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) ValidateRepository(ctx context.Context, branch string) error
- type ProofWebhook
- type WebhookAuthority
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 ¶
func New( ctx context.Context, config gitprovider.Config, creds gitprovider.Credentials, repo gitprovider.RepositoryRef, ) (*Client, error)
New creates a GitLab provider proposal client.
func NewOAuth ¶
func NewOAuth( ctx context.Context, config gitprovider.Config, creds gitprovider.Credentials, repo gitprovider.RepositoryRef, ) (*Client, error)
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 ¶
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 ¶
func (c *Client) GetProposal( ctx context.Context, req gitprovider.ProposalGetRequest, ) (*gitprovider.ProposalRef, error)
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) 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 ¶
func (c *Client) UpdateProposal( ctx context.Context, req gitprovider.ProposalUpdateRequest, ) (*gitprovider.ProposalRef, error)
UpdateProposal updates a GitLab merge request title and description.