middleware

package
v0.0.0-...-516a9d7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiKeyAuthentication

func ApiKeyAuthentication() func(next http.Handler) http.Handler

ApiKeyAuthentication will authenticate a service account from a token found in the authorization header

func BearerAuth

func BearerAuth(r *http.Request) (token string, ok bool)

BearerAuth returns the token provided in the request's Authorization header, if the request uses the Bearer authentication scheme.

func GitHubOIDC

func GitHubOIDC(ctx context.Context, log logrus.FieldLogger) func(next http.Handler) http.Handler

func InsecureUserHeader

func InsecureUserHeader() func(next http.Handler) http.Handler

InsecureUserHeader returns a middleware that sets the email address of the authenticated user from the x-user-email header. This middleware is intended for local development and testing purposes only.

func JWTAuthentication

func JWTAuthentication(ctx context.Context, issuer, audience, zitadelOrgID string, log logrus.FieldLogger) (func(next http.Handler) http.Handler, error)

func Oauth2Authentication

func Oauth2Authentication(authHandler authn.Handler) func(next http.Handler) http.Handler

Oauth2Authentication If the request has a session cookie, look up the session from the store, and if it exists, try to load the user with the email address stored in the session.

func PreSharedKeyAuthentication

func PreSharedKeyAuthentication(preSharedKey string) func(next http.Handler) http.Handler

PreSharedKeyAuthentication will authenticate a request against a pre shared key

func RequireAuthenticatedUser

func RequireAuthenticatedUser() func(next http.Handler) http.Handler

Types

type GitHubRepoActor

type GitHubRepoActor struct {
	RepositoryName string
	TeamSlugs      []slug.Slug
}

func (*GitHubRepoActor) GCPTeamGroups

func (g *GitHubRepoActor) GCPTeamGroups(ctx context.Context) ([]string, error)

func (*GitHubRepoActor) GetID

func (g *GitHubRepoActor) GetID() uuid.UUID

func (*GitHubRepoActor) Identity

func (g *GitHubRepoActor) Identity() string

func (*GitHubRepoActor) IsAdmin

func (g *GitHubRepoActor) IsAdmin() bool

func (*GitHubRepoActor) IsGitHubActions

func (g *GitHubRepoActor) IsGitHubActions()

func (*GitHubRepoActor) IsServiceAccount

func (g *GitHubRepoActor) IsServiceAccount() bool

Jump to

Keyboard shortcuts

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