request

package
v0.0.0-...-6bd82e6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClaimsVerifier = &NilClaimsVerifier{}
View Source
var (
	MinimumVersions map[string]string
)

Functions

func AddAWSAuthToCtx

func AddAWSAuthToCtx(ctx context.Context, encodedAccessKeyId, encodedSecretAccessKey, encodedSessionToken string) (context.Context, error)

func CtxWithAWSAuthHeaders

func CtxWithAWSAuthHeaders(ctx *fiber.Ctx) (context.Context, error)

func HealthHandlerFiber

func HealthHandlerFiber(c *fiber.Ctx) error

HealthCheck godoc @Summary Check that the server is up. @Tags root @Accept */* @Produce json @Success 200 {object} model.HealthResponse @Router /health [get]

func HealthOKResponse

func HealthOKResponse(path string) model.HealthResponse

func MakeCredentialProvider

func MakeCredentialProvider(ctx context.Context) aws.CredentialsProvider

func MakeFiberAuthMiddleware

func MakeFiberAuthMiddleware(verifier OIDCVerifier) fiber.Handler

func MakeOgentAuthMiddleware

func MakeOgentAuthMiddleware(verifier OIDCVerifier) ogent.Middleware

func MakeOgentLoggerMiddleware

func MakeOgentLoggerMiddleware(cfg *setup.Configuration) ogent.Middleware

func ParsePayload

func ParsePayload[T interface{}](c *fiber.Ctx, payload *T, fn RequestParser) []*model.ValidationError

func PrometheusMetricsHandler

func PrometheusMetricsHandler(c *fiber.Ctx) error

func StandardizeKey

func StandardizeKey(key string) string

func ValidateEnvironment

func ValidateEnvironment(fl validator.FieldLevel) bool

func ValidateEnvironmentCopyDestination

func ValidateEnvironmentCopyDestination(fl validator.FieldLevel) bool

func ValidatePayload

func ValidatePayload(payload interface{}) []*model.ValidationError

func VersionCheckHandlerFiber

func VersionCheckHandlerFiber(c *fiber.Ctx) error

Types

type AWSCredentials

type AWSCredentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

type AWSCredentialsContextKey

type AWSCredentialsContextKey struct{}

type AWSCredentialsProvider

type AWSCredentialsProvider struct{}

func (AWSCredentialsProvider) Retrieve

type ClaimsVerifier

type ClaimsVerifier interface {
	MatchClaims(ctx context.Context, idToken *oidc.IDToken) error
}

type GithubClaims

type GithubClaims struct {
	Subject         string `json:"sub"`
	Issuer          string `json:"iss"`
	RepositoryOwner string `json:"repository_owner"`
	Repository      string `json:"repository"`
	Action          string `json:"actor"`
	HeadRef         string `json:"head_ref"`
	WorkflowSHA     string `json:"workflow_sha"`
}

type GithubClaimsVerifier

type GithubClaimsVerifier struct {
	// contains filtered or unexported fields
}

func MakeGithubClaimsVerifier

func MakeGithubClaimsVerifier(owner string) *GithubClaimsVerifier

func (*GithubClaimsVerifier) MatchClaims

func (g *GithubClaimsVerifier) MatchClaims(ctx context.Context, idToken *oidc.IDToken) error

type GithubVerifier

type GithubVerifier struct {
	OIDCProvider
	// contains filtered or unexported fields
}

func MakeGithubVerifier

func MakeGithubVerifier(githubOwner string, opts ...providerVeriferOpt) *GithubVerifier

func (*GithubVerifier) Verify

func (g *GithubVerifier) Verify(ctx context.Context, idToken string) (*oidc.IDToken, error)

type HappyClient

type HappyClient struct {
	StackService *stack.StackService
	AWSBackend   *backend.Backend
}

func MakeHappyClient

func MakeHappyClient(ctx context.Context, appName string, envCtx config.EnvironmentContext) (*HappyClient, error)

type HealthHandler

type HealthHandler struct{}

func (HealthHandler) ServeHTTP

func (h HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LoggerKey

type LoggerKey struct{}

type MultiOIDCProvider

type MultiOIDCProvider struct {
	// contains filtered or unexported fields
}

func (*MultiOIDCProvider) Verify

func (m *MultiOIDCProvider) Verify(ctx context.Context, idToken string) (*oidc.IDToken, error)

type NilClaimsVerifier

type NilClaimsVerifier struct {
}

func (*NilClaimsVerifier) MatchClaims

func (d *NilClaimsVerifier) MatchClaims(ctx context.Context, idToken *oidc.IDToken) error

type OIDCAuthKey

type OIDCAuthKey struct{}

type OIDCAuthValues

type OIDCAuthValues struct {
	Subject string
	Email   string
	Actor   string
}

func ValidateAuthHeader

func ValidateAuthHeader(ctx context.Context, authHeader string, verifier OIDCVerifier) (*OIDCAuthValues, error)

type OIDCProvider

type OIDCProvider struct {
	// contains filtered or unexported fields
}

func MakeOIDCProvider

func MakeOIDCProvider(ctx context.Context, issuerURL, clientID string, claimsVerifier ClaimsVerifier) (*OIDCProvider, error)

func (*OIDCProvider) Verify

func (o *OIDCProvider) Verify(ctx context.Context, rawIDToken string) (*oidc.IDToken, error)

type OIDCVerifier

type OIDCVerifier interface {
	Verify(ctx context.Context, idToken string) (*oidc.IDToken, error)
}

func MakeMultiOIDCVerifier

func MakeMultiOIDCVerifier(verifiers ...OIDCVerifier) OIDCVerifier

func MakeVerifierFromConfig

func MakeVerifierFromConfig(ctx context.Context, cfg *setup.Configuration) OIDCVerifier

type RequestParser

type RequestParser func(out interface{}) error

type VersionCheckHandler

type VersionCheckHandler struct{}

func (VersionCheckHandler) ServeHTTP

func (h VersionCheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type VersionCheckResponse

type VersionCheckResponse struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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