Documentation
¶
Overview ¶
Package authentication provides JWT token generation functionality. It implements a simple authentication mechanism using HS256-signed JWTs with configurable issuer, expiration time, and signing secret. The package uses github.com/golang-jwt/jwt/v5 for token creation and signing.
Index ¶
Constants ¶
View Source
const ( GitlabIssuer = "gitlab" // GitlabZoektAPIRequestHeader is the header name used for JWT authentication GitlabZoektAPIRequestHeader = "Gitlab-Zoekt-Api-Request" // GitlabZoektAPIRequestHeaderLower is the lowercase version used in gRPC metadata GitlabZoektAPIRequestHeaderLower = "gitlab-zoekt-api-request" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (Auth) GenerateJWT ¶
func (Auth) VerifyBearerToken ¶ added in v0.17.0
func (a Auth) VerifyBearerToken(authHeader string) (*jwt.RegisteredClaims, error)
VerifyBearerToken extracts and verifies a Bearer token from GitlabZoektAPIRequestHeader
Click to show internal directories.
Click to hide internal directories.