cedar

package
v0.0.0-...-8b55f26 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: EUPL-1.2 Imports: 18 Imported by: 1

Documentation

Overview

Package cedar contains all logic for a functional component acting as the Policy Decision Point, using Cedar as the policy language.

Index

Constants

View Source
const (
	TypeAction      = "Action"
	TypeApp         = "App"
	TypeDoelbinding = "Doelbinding"
	TypeInvalid     = "Invalid"
	TypeJWT         = "JWT"
	TypeService     = "Service"
	TypeZaak        = "Zaak"
)

list of Cedar element types.

View Source
const Version = "1.0.0"

Version defines the version of this Cedar PDP.

Variables

This section is empty.

Functions

func DeterminePrincipal

func DeterminePrincipal(a *attributes) (cedar.EntityType, cedar.String)

DeterminePrincipal determines the type of principal and its primary key.

func NewAttributeBuilder

func NewAttributeBuilder(logger *slog.Logger) types.AttributesBuilder

NewAttributeBuilder returns the function prototype for building a new Cedar based attribute set.

func NewAttributeSet

func NewAttributeSet(logger *slog.Logger, in ...any) types.AttributeSet

NewAttributeSet instantiates a new Cedar based attribute set.

func NewController

func NewController(pip pip.PIP, store string, recurse bool, logger *slog.Logger) control.Controller

NewController instantiates a new Cedar controller.

func NewEntityBuilder

func NewEntityBuilder(logger *slog.Logger) types.EntitiesBuilder

NewEntityBuilder returns the function prototype for building a new Cedar based entity set.

func NewEntitySet

func NewEntitySet(logger *slog.Logger, in ...any) types.EntitySet

NewEntitySet instantiates a new Cedar based entity set.

func NewWrappedEntity

func NewWrappedEntity(ce *cedar.Entity, logger *slog.Logger) types.Entity

NewWrappedEntity instantiates a new wrapper around a cedar entity.

Types

type WrappedEntity

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

WrappedEntity is a wrapper around a cedar entity.

It is read-only by design.

func (*WrappedEntity) Attributes

func (e *WrappedEntity) Attributes() types.AttributeSet

Attributes implements the Entity interface.

func (*WrappedEntity) ID

func (e *WrappedEntity) ID() string

ID implements the Entity interface.

func (*WrappedEntity) Parents

func (e *WrappedEntity) Parents() []string

Parents implements the Entity interface.

func (*WrappedEntity) Type

func (e *WrappedEntity) Type() string

Type implements the Entity interface.

func (*WrappedEntity) UID

func (e *WrappedEntity) UID() string

UID implements the Entity interface.

Jump to

Keyboard shortcuts

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