githuboidc

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingIdTokenWrite = errors.New("please add `id-token: write` to your workflow permissions")

Functions

func OIDCAvailable

func OIDCAvailable() bool

func ProvideVerifier

func ProvideVerifier(ctx context.Context) (*keyfunc.JWKS, error)

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims

	JobWorkflowRef    string `json:"job_workflow_ref"`
	Sha               string `json:"sha"`
	EventName         string `json:"event_name"`
	Repository        string `json:"repository"`
	Workflow          string `json:"workflow"`
	Ref               string `json:"ref"`
	JobWorkflowSha    string `json:"job_workflow_sha"`
	RunnerEnvironment string `json:"runner_environment"`
	RepositoryID      string `json:"repository_id"`
	RepositoryOwner   string `json:"repository_owner"`
	RepositoryOwnerID string `json:"repository_owner_id"`
	WorkflowRef       string `json:"workflow_ref"`
	WorkflowSha       string `json:"workflow_sha"`
	RunID             string `json:"run_id"`
	RunAttempt        string `json:"run_attempt"`
}

func Validate

func Validate(ctx context.Context, jwks *keyfunc.JWKS, tokenStr string) (*Claims, error)

type Token

type Token struct {
	Value string `json:"value"`
}

func JWT

func JWT(ctx context.Context, audience string) (*Token, error)

Jump to

Keyboard shortcuts

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