gitlab

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gitlab implements a client to read OIDC tokens from GitLab CI using the SIGSTORE_ID_TOKEN environment variable.

Index

Constants

View Source
const (
	// VariableGitLabIDToken is the environment variable that GitLab CI
	// sets when id_tokens are configured in the pipeline.
	VariableGitLabIDToken = "SIGSTORE_ID_TOKEN" //nolint:gosec // These are not hardcoded credentials
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CI

type CI struct{}

func (*CI) Provide

func (ci *CI) Provide(ctx context.Context, audience string) (*oauthflow.OIDCIDToken, error)

Provide reads the OIDC token from the SIGSTORE_ID_TOKEN environment variable. This token should be configured in GitLab CI with:

id_tokens:
  SIGSTORE_ID_TOKEN:
    aud: sigstore

See: https://docs.gitlab.com/ci/yaml/signing_examples/#sign-or-verify-container-images-and-build-artifacts-by-using-cosign

Jump to

Keyboard shortcuts

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