middleware

package
v0.0.0-...-899a08a Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretsInvalidRequestMessage = "Invalid secrets request"
	SecretsUnauthorizedMessage   = "You are not authenticated"
	SecretsUnavailableMessage    = "Secrets are not available for this team"
	SecretsNotFoundMessage       = "Secret not found"
	SecretsConflictMessage       = "Secret cannot be modified in its current state"
	SecretsBackendMessage        = "Secrets backend error"
	SecretsBackendTimeoutMessage = "Secrets backend timed out"
)

The fixed public messages shared by everything that can answer a secrets request: this package, the request-validation error handler, and the handlers. A caller learns the class of the failure and nothing else.

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

CORS returns the gin CORS middleware for the api service.

func CheckTeamAccessForRoute

func CheckTeamAccessForRoute(c *gin.Context, team *types.Team) error

CheckTeamAccessForRoute applies CheckTeamBanned + the api blocked-team allowlist to a late-resolved team.

func EnforceBlockedTeam

func EnforceBlockedTeam() gin.HandlerFunc

EnforceBlockedTeam returns the gin middleware for the api service, configured with the api-specific blocked-team allowlist.

func InitLaunchDarklyContext

func InitLaunchDarklyContext(c *gin.Context)

func IsSecretsRoute

func IsSecretsRoute(c *gin.Context) bool

IsSecretsRoute reports whether a request targets the secret management path family. It answers for unmatched paths too, so a 404 below /secrets is treated as confidentially as a matched route.

func NoStoreSecrets

func NoStoreSecrets() gin.HandlerFunc

NoStoreSecrets marks every response on the secrets path family before any later layer writes, whichever one answers: auth, validation, the rate limiter, the handlers, or a recovered panic. Gin's own canonical-path redirects bypass the middleware chain and are deliberately not covered: they carry no body and no customer data.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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