service

package
v0.0.0-...-3c1713d Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	X_EXT_AUTH_REASON_HEADER = "X-Ext-Auth-Reason"

	RESPONSE_MESSAGE_INVALID_REQUEST   = "Invalid request"
	RESPONSE_MESSAGE_SERVICE_NOT_FOUND = "Service not found"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthPipeline

type AuthPipeline struct {
	ParentContext *context.Context
	Request       *envoy_auth.CheckRequest
	API           *config.APIConfig

	Identity      map[*config.IdentityConfig]interface{}
	Metadata      map[*config.MetadataConfig]interface{}
	Authorization map[*config.AuthorizationConfig]interface{}
}

AuthPipeline evaluates the context of an auth request upon the auth configs defined for the requested API Throughout the pipeline, user identity, adhoc metadata and authorization policies are evaluated and their corresponding resulting objects stored in the respective maps.

func NewAuthPipeline

func NewAuthPipeline(parentCtx context.Context, req *envoy_auth.CheckRequest, apiConfig config.APIConfig) AuthPipeline

NewAuthPipeline creates an AuthPipeline instance

func (*AuthPipeline) Evaluate

func (pipeline *AuthPipeline) Evaluate() AuthResult

Evaluate evaluates all steps of the auth pipeline (identity → metadata → policy enforcement)

func (*AuthPipeline) GetAPI

func (pipeline *AuthPipeline) GetAPI() interface{}

func (*AuthPipeline) GetDataForAuthorization

func (pipeline *AuthPipeline) GetDataForAuthorization() interface{}

func (*AuthPipeline) GetHttp

func (*AuthPipeline) GetParentContext

func (pipeline *AuthPipeline) GetParentContext() *context.Context

func (*AuthPipeline) GetRequest

func (pipeline *AuthPipeline) GetRequest() *envoy_auth.CheckRequest

func (*AuthPipeline) GetResolvedIdentity

func (pipeline *AuthPipeline) GetResolvedIdentity() (interface{}, interface{})

func (*AuthPipeline) GetResolvedMetadata

func (pipeline *AuthPipeline) GetResolvedMetadata() map[interface{}]interface{}

type AuthResult

type AuthResult struct {
	Code    rpc.Code
	Message string
	Headers []map[string]string
}

func (*AuthResult) Success

func (result *AuthResult) Success() bool

type AuthService

type AuthService struct {
	Cache *cache.Cache
}

AuthService is the server API for the authorization service.

func (*AuthService) Check

Check performs authorization check based on the attributes associated with the incoming request, and returns status `OK` or not `OK`.

type EvaluationResponse

type EvaluationResponse struct {
	Evaluator common.AuthConfigEvaluator
	Object    interface{}
	Error     error
}

func (*EvaluationResponse) GetErrorMessage

func (evresp *EvaluationResponse) GetErrorMessage() string

func (*EvaluationResponse) Success

func (evresp *EvaluationResponse) Success() bool

type HealthService

type HealthService struct{}

HealthService is the server API for the gRPC health service

func (*HealthService) Check

Check performs a health of the gRPC service

func (*HealthService) Watch

Watch is for streaming health-check (not yet implemented)

Jump to

Keyboard shortcuts

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