githubjwt

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubJWT

type GithubJWT struct {
	Actor                string    `json:"actor"`
	ActorID              string    `json:"actor_id"`
	Aud                  []string  `json:"aud"`
	BaseRef              string    `json:"base_ref"`
	Enterprise           string    `json:"enterprise"`
	EventName            string    `json:"event_name"`
	Exp                  time.Time `json:"exp"`
	HeadRef              string    `json:"head_ref"`
	Iat                  time.Time `json:"iat"`
	Iss                  string    `json:"iss"`
	JobWorkflowRef       string    `json:"job_workflow_ref"`
	Jti                  string    `json:"jti"`
	Nbf                  time.Time `json:"nbf"`
	Ref                  string    `json:"ref"`
	RefType              string    `json:"ref_type"`
	Repository           string    `json:"repository"`
	RepositoryID         string    `json:"repository_id"`
	RepositoryOwner      string    `json:"repository_owner"`
	RepositoryOwnerID    string    `json:"repository_owner_id"`
	RepositoryVisibility string    `json:"repository_visibility"`
	RunAttempt           string    `json:"run_attempt"`
	RunID                string    `json:"run_id"`
	RunNumber            string    `json:"run_number"`
	Sha                  string    `json:"sha"`
	Sub                  string    `json:"sub"`
	Workflow             string    `json:"workflow"`
}

GithubJWT are the fields defined in the Github JWT Token

func ParseTokenFromRequestWithJWKS

func ParseTokenFromRequestWithJWKS(r *http.Request) (*GithubJWT, error)

ParseTokenFromRequestWithJWKS Wrapper around the JWT version of this function, that is specific to Github tokens Sets the proper JWKS endpoint, and returns the github specific token data after validation

func TransformTokenToGithubClaims

func TransformTokenToGithubClaims(token jwt.Token) (*GithubJWT, error)

TransformTokenToGithubClaims takes a jwt.Token and transforms it to the structured claims provided

Jump to

Keyboard shortcuts

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