circleci

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const IssuerURLTemplate = "https://oidc.circleci.com/org/%s"

Variables

This section is empty.

Functions

func GetIDToken

func GetIDToken(getEnv getEnvFunc) (string, error)

Types

type IDTokenClaims

type IDTokenClaims struct {
	// Sub identifies who is running the CircleCI job and where.
	// In the format of: `org/ORGANIZATION_ID/project/PROJECT_ID/user/USER_ID`
	Sub string `json:"sub"`
	// ContextIDs is a list of UUIDs for the contexts used in the job.
	ContextIDs []string `json:"oidc.circleci.com/context-ids"`
	// ProjectID is the ID of the project in which the job is running.
	ProjectID string `json:"oidc.circleci.com/project-id"`
}

IDTokenClaims is the structure of claims contained with a CircleCI issued ID token. See https://circleci.com/docs/openid-connect-tokens/

func ValidateToken

func ValidateToken(
	ctx context.Context,
	clock clockwork.Clock,
	issuerURLTemplate string,
	organizationID string,
	token string,
) (*IDTokenClaims, error)

func (*IDTokenClaims) JoinAuditAttributes

func (c *IDTokenClaims) JoinAuditAttributes() (map[string]interface{}, error)

JoinAuditAttributes returns a series of attributes that can be inserted into audit events related to a specific join.

Jump to

Keyboard shortcuts

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