auth

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CarryMetadata added in v0.39.0

func CarryMetadata(ctx context.Context) context.Context

CarryMetadata extracts relevant metadata from the incoming context and append that to the outgoing context.

func HeaderMatcher added in v0.34.0

func HeaderMatcher(key string) (string, bool)

HeaderMatcher is a custom header matcher for GRPC gateway.

Types

type Interceptor

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

Interceptor is an authentication interceptor.

func NewInterceptor

func NewInterceptor(ctx context.Context, rbacServerAddr, accessResource string) (*Interceptor, error)

NewInterceptor creates a new Interceptor.

func (*Interceptor) InterceptHTTPRequest added in v0.22.0

func (a *Interceptor) InterceptHTTPRequest(req *http.Request) (int, UserInfo, error)

InterceptHTTPRequest intercepts an HTTP request and returns an HTTP status code.

func (*Interceptor) Unary

Unary returns a unary server interceptor.

type UserInfo added in v0.23.0

type UserInfo struct {
	UserID         string
	OrganizationID string
	ProjectID      string
}

UserInfo manages the user info.

func ExtractUserInfoFromContext added in v0.23.0

func ExtractUserInfoFromContext(ctx context.Context) (*UserInfo, bool)

ExtractUserInfoFromContext extracts the user info from the context.

Jump to

Keyboard shortcuts

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