engine

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Evaluate(ctx context.Context, query string, env Environment) (bool, error)
}

Engine defines the granted handlers.

type Environment

type Environment struct {
	Stage    Stage     `json:"stage"`
	User     user.User `json:"user"`
	Request  Request   `json:"request"`
	Resource Resource  `json:"resource"`
}

Environment contains every data that is needed to decide if the request should pass or not

func NewEnvironmentFromPB

func NewEnvironmentFromPB(pEnv *v0.Environment) (Environment, error)

NewEnvironmentFromPB converts a PBEnvironment to Environment.

type Request

type Request struct {
	Method string `json:"method"`
	Path   string `json:"path"`
}

Request contains request information and is used as part of the evaluated environment.

type Resource

type Resource struct {
	ID   provider.ResourceId `json:"resource_id"`
	Name string              `json:"name"`
	URL  string              `json:"url"`
	Size uint64              `json:"size"`
}

Resource contains resource information and is used as part of the evaluated environment.

type Stage

type Stage string

Stage defines the used auth stage

var (
	// StagePP defines the post-processing stage
	StagePP Stage = "pp"

	// StageHTTP defines the http stage
	StageHTTP Stage = "http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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