file

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	// ContextualTuples is a slice of strings that represent the contextual tuples involved in the authorization check.
	ContextualTuples []string `yaml:"contextual_tuples"`

	// Entity is a string that represents the entity type involved in the authorization check.
	Entity string `yaml:"entity"`

	// Subject is a string that represents the subject of the authorization check.
	Subject string `yaml:"subject"`

	// Assertions is a map that contains the authorization assertions to be evaluated.
	Assertions map[string]bool `yaml:"assertions"`
}

Check is a struct that represents an individual authorization check.

type Decoder

type Decoder interface {
	Decode(out interface{}) error
}

Decoder - Decoder interface

func NewDecoderFromURL

func NewDecoderFromURL(url *url.URL) (Decoder, error)

NewDecoderFromURL - Creates new decoder

type EntityFilter

type EntityFilter struct {
	// ContextualTuples is a slice of strings that represent the contextual tuples involved in the authorization check.
	ContextualTuples []string `yaml:"contextual_tuples"`

	// EntityType is a string that represents the type of entity the filter applies to.
	EntityType string `yaml:"entity_type"`

	// Subject is a string that represents the subject of the filter.
	Subject string `yaml:"subject"`

	// Assertions is a map that contains the filter assertions to be applied.
	Assertions map[string][]string `yaml:"assertions"`
}

EntityFilter is a struct that represents a filter to be applied during an authorization check.

type FileDecoder

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

func NewFileDecoder

func NewFileDecoder(path string) *FileDecoder

func (FileDecoder) Decode

func (d FileDecoder) Decode(out interface{}) (err error)

Decode - Decode a file

type HTTPDecoder

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

func NewHTTPDecoder

func NewHTTPDecoder(url string) *HTTPDecoder

NewHTTPDecoder - Creates new HTTP decoder

func (HTTPDecoder) Decode

func (d HTTPDecoder) Decode(out interface{}) (err error)

Decode - decode HTTP

type Scenario

type Scenario struct {
	// Name is a string that represents the name of the scenario.
	Name string `yaml:"name"`

	// Description is a string that provides a brief explanation of the scenario.
	Description string `yaml:"description"`

	// Checks is a slice of Check structs that represent the authorization checks to be performed.
	Checks []Check `yaml:"checks"`

	// EntityFilters is a slice of Filter structs that represent the filters to be applied during the checks.
	EntityFilters []EntityFilter `yaml:"entity_filters"`

	// SubjectFilters is a slice of Filter structs that represent the filters to be applied during the checks.
	SubjectFilters []SubjectFilter `yaml:"subject_filters"`
}

Scenario is a struct that represents a specific authorization scenario.

type Shape

type Shape struct {
	// Schema is a string that represents the authorization model schema.
	Schema string `yaml:"schema"`

	// Relationships is a slice of strings that represent the authorization relationships.
	Relationships []string `yaml:"relationships"`

	// Scenarios is a slice of Scenario structs that represent the different authorization scenarios.
	Scenarios []Scenario `yaml:"scenarios"`
}

Shape is a struct that represents an authorization configuration.

type SubjectFilter added in v0.4.2

type SubjectFilter struct {
	// ContextualTuples is a slice of strings that represent the contextual tuples involved in the authorization check.
	ContextualTuples []string `yaml:"contextual_tuples"`

	// EntityType is a string that represents the type of entity the filter applies to.
	SubjectReference string `yaml:"subject_reference"`

	// Entity is a string that represents the entity type involved in the authorization check.
	Entity string `yaml:"entity"`

	// Assertions is a map that contains the filter assertions to be applied.
	Assertions map[string][]string `yaml:"assertions"`
}

SubjectFilter is a struct that represents a filter to be applied during an authorization check.

Jump to

Keyboard shortcuts

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