middleware

package
v1.0.0-alpha.51 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieMaxAgeKey = "Expires"
)
View Source
const (
	TigrisStreamSpan string = "rpcstream"
)

Variables

View Source
var (
	UnknownNamespace          = "unknown"
	BypassAuthForTheseMethods = container.NewHashSet(
		"/HealthAPI/Health",
		"/tigrisdata.auth.v1.Auth/getAccessToken",
		"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo",
	)
)
View Source
var (
	DefaultTimeout = 2 * time.Second
	MaximumTimeout = 5 * time.Second
)
View Source
var OutgoingHeaders = metadata.New(map[string]string{})
View Source
var (
	UserAgent = "tigris-forwarder/" + util.Version
)

Functions

func AuthFromMD

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

func GetJWTValidator

func GetJWTValidator(config *config.Config) *validator.Validator

Types

type CustomClaim

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

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 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