middleware

package
v1.0.0-beta.99 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieMaxAgeKey    = "Expires"
	ServerTimingHeader = "Server-Timing"
)

Variables

View Source
var (
	DefaultTimeout     = 10 * time.Second
	MaximumTimeout     = 30 * time.Second
	LongRunningTimeout = 1 * time.Hour
)
View Source
var (
	ClusterAdminRoleName = "cluster_admin"
)
View Source
var UserAgent = "tigris-forwarder/" + util.Version

Functions

func AuthFromMD

func AuthFromMD(ctx context.Context, expectedScheme string) (string, error)

func BypassAuthCaches

func BypassAuthCaches(ctx context.Context) bool

func GetJWTValidators

func GetJWTValidators(config *config.Config) []*validator.Validator

func HTTPAuthMiddleware

func HTTPAuthMiddleware(config *config.Config) func(http.Handler) http.Handler

func HTTPMetadataExtractorMiddleware

func HTTPMetadataExtractorMiddleware(_ *config.Config) func(http.Handler) http.Handler

Types

type CustomClaim

type CustomClaim struct {
	Namespace    Namespace    `json:"https://tigris/n"`
	User         User         `json:"https://tigris/u"`
	TigrisClaims TigrisClaims `json:"https://tigris"`
}

func (CustomClaim) Validate

func (c CustomClaim) Validate(_ context.Context) error

type Forwarder

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

type Namespace

type Namespace struct {
	Code string `json:"code"`
}

type TigrisClaims

type TigrisClaims struct {
	NamespaceCode        string `json:"nc"`
	NamespaceDisplayName string `json:"nd"`
	Project              string `json:"-"`
	UserEmail            string `json:"ue"`
}

type TokenCtxkey

type TokenCtxkey struct{}

type User

type User struct {
	Email string `json:"email"`
}

Jump to

Keyboard shortcuts

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