Documentation ¶
Overview ¶
Package jwt handles JSON web tokens (JWT).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GitLabJWKS jose.JSONWebKeySet
Functions ¶
Types ¶
type GitLabClaims ¶
type GitLabClaims struct { NamespaceID string `json:"namespace_id,omitempty"` NamespacePath string `json:"namespace_path,omitempty"` ProjectID string `json:"project_id,omitempty"` ProjectPath string `json:"project_path,omitempty"` UserID string `json:"user_id,omitempty"` UserLogin string `json:"user_login,omitempty"` UserEmail string `json:"user_email,omitempty"` PipelineID string `json:"pipeline_id,omitempty"` JobID string `json:"job_id,omitempty"` Ref string `json:"ref,omitempty"` // Git ref for this job RefType string `json:"ref_type,omitempty"` // Git ref type: branch or tag RefProtected string `json:"ref_protected,omitempty"` // true if this git ref is protected, false otherwise }
See https://docs.gitlab.com/ee/ci/examples/authenticating-with-hashicorp-vault/ for documentation of the payload
func ExtractClaims ¶
func ExtractClaims(tokenString string, jwks *jose.JSONWebKeySet) (*jwt.Claims, *GitLabClaims, error)
ExtractClaims extracts the claims from the JWT in tokenString.
Click to show internal directories.
Click to hide internal directories.