safe

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultHash string = `0`

Variables

This section is empty.

Functions

func IsNotSet

func IsNotSet(s string) bool

func IsSet

func IsSet(s string) bool

Types

type RelationScope

type RelationScope int
const (
	AsRelation RelationScope = iota
	AsPermission
	AsEither
)

type SafeAssert added in v0.1.11

type SafeAssert struct {
	*dsa3.Assert
}

func Assert added in v0.1.11

func Assert(i *dsa3.Assert) *SafeAssert

func (*SafeAssert) Validate added in v0.1.11

func (i *SafeAssert) Validate(mc *cache.Cache) error

type SafeCheck

type SafeCheck struct {
	*dsr3.CheckRequest
}

func Check

func Check(i *dsr3.CheckRequest) *SafeCheck

func (*SafeCheck) Object

func (i *SafeCheck) Object() *dsc3.ObjectIdentifier

func (*SafeCheck) Subject

func (i *SafeCheck) Subject() *dsc3.ObjectIdentifier

func (*SafeCheck) Validate

func (i *SafeCheck) Validate(mc *cache.Cache) error

type SafeGetGraph

type SafeGetGraph struct {
	*dsr3.GetGraphRequest
}

func GetGraph

func GetGraph(i *dsr3.GetGraphRequest) *SafeGetGraph

func (*SafeGetGraph) Object

func (i *SafeGetGraph) Object() *dsc3.ObjectIdentifier

func (*SafeGetGraph) RelationRef added in v0.1.1

func (i *SafeGetGraph) RelationRef() *model.RelationRef

func (*SafeGetGraph) Subject

func (i *SafeGetGraph) Subject() *dsc3.ObjectIdentifier

func (*SafeGetGraph) Validate

func (i *SafeGetGraph) Validate(mc *cache.Cache) error

type SafeObject

type SafeObject struct {
	*dsc3.Object
}

func Object

func Object(i *dsc3.Object) *SafeObject

func (*SafeObject) Hash

func (i *SafeObject) Hash() string

func (*SafeObject) Validate

func (i *SafeObject) Validate(mc *cache.Cache) error

type SafeObjectIdentifier

type SafeObjectIdentifier struct {
	*dsc3.ObjectIdentifier
}

func (*SafeObjectIdentifier) Equal

func (*SafeObjectIdentifier) IsComplete

func (i *SafeObjectIdentifier) IsComplete() bool

func (*SafeObjectIdentifier) Validate

func (i *SafeObjectIdentifier) Validate(mc *cache.Cache) error

type SafeObjectSelector

type SafeObjectSelector struct {
	*dsc3.ObjectIdentifier
}

func ObjectSelector

func ObjectSelector(i *dsc3.ObjectIdentifier) *SafeObjectSelector

func (*SafeObjectSelector) IsComplete

func (i *SafeObjectSelector) IsComplete() bool

func (*SafeObjectSelector) Validate

func (i *SafeObjectSelector) Validate(mc *cache.Cache) error

Validate rules: valid states - empty object - type only - type + key.

type SafeRelation

type SafeRelation struct {
	*dsc3.RelationIdentifier
	HasSubjectRelation bool
}

SafeRelation identifier.

func Relation

func Relation(i *dsc3.RelationIdentifier) *SafeRelation

func (*SafeRelation) Hash

func (i *SafeRelation) Hash() string

func (*SafeRelation) Object

func (i *SafeRelation) Object() *dsc3.ObjectIdentifier

func (*SafeRelation) Subject

func (i *SafeRelation) Subject() *dsc3.ObjectIdentifier

func (*SafeRelation) Validate

func (i *SafeRelation) Validate(mc *cache.Cache) error

type SafeRelationIdentifier

type SafeRelationIdentifier struct {
	*model.RelationRef
}

func RelationIdentifier

func RelationIdentifier(i *model.RelationRef) *SafeRelationIdentifier

func (*SafeRelationIdentifier) Validate

func (r *SafeRelationIdentifier) Validate(scope RelationScope, mc *cache.Cache) error

type SafeRelations

type SafeRelations struct {
	*SafeRelation
}

Relation selector.

func GetRelation

func GetRelation(i *dsr3.GetRelationRequest) *SafeRelations

func GetRelations

func GetRelations(i *dsr3.GetRelationsRequest) *SafeRelations

func (*SafeRelations) Validate

func (i *SafeRelations) Validate(mc *cache.Cache) error

Jump to

Keyboard shortcuts

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