auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	Known    bool              `json:"known"`
	Username string            `json:"username"`
	Metadata map[string]string `json:"metadata,omitempty"`
	Emails   []string          `json:"emails,omitempty"`
	Teams    []string          `json:"teams,omitempty"`
}

type AuthenticationProvider

type AuthenticationProvider interface {
	// Authenticate tries to authenticate the token
	Authenticate(ctx context.Context, token string) (*AuthResponse, error)
}

type Interceptor

type Interceptor interface {
	Unary() grpc.UnaryServerInterceptor
	Stream() grpc.StreamServerInterceptor
}

func NewOPAInterceptor

func NewOPAInterceptor(ctx context.Context, authProvider AuthenticationProvider, policy func(*rego.Rego)) (Interceptor, error)

Jump to

Keyboard shortcuts

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