authz

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchAuthorizeInput

type BatchAuthorizeInput struct {
	Requests map[string]Request
}

type BatchAuthorizeResponse

type BatchAuthorizeResponse struct {
	// Evaluations made by the authz service.
	Evaluations []*authzv1alpha1.Evaluation
}

type Client

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

func NewClient

func NewClient(opts Opts) Client

func NewFromConfig

func NewFromConfig(cfg *config.Context) Client

func (*Client) BatchAuthorize

func (c *Client) BatchAuthorize(ctx context.Context, input BatchAuthorizeInput) (BatchAuthorizeResponse, error)

func (*Client) RawClient

RawClient returns the underlying Buf Connect client.

type DecisionNotFoundError

type DecisionNotFoundError struct {
	Key string
}

func (DecisionNotFoundError) Error

func (e DecisionNotFoundError) Error() string

type Opts

type Opts struct {
	HTTPClient    connect.HTTPClient
	BaseURL       string
	ClientOptions []connect.ClientOption
	// AttrCacheExpiration defaults to 24h if not provided
	AttrCacheExpiration time.Duration
	// AttrCleanupInterval defaults to 48h if not provided
	AttrCleanupInterval time.Duration
}

type Request

type Request struct {
	Principal       eid.EID                `json:"principal"`
	Action          eid.EID                `json:"action"`
	Resource        eid.EID                `json:"resource"`
	OverlayEntities []entity.Entity        `json:"overlay_entities,omitempty"`
	OverlayChildren []entity.ChildRelation `json:"overlay_children,omitempty"`
	Tags            map[string]string      `json:"tags,omitempty"`
}

func (Request) ToAPI

func (r Request) ToAPI() (*authzv1alpha1.Request, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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