authz

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxObjectTypes = 1000
	MaxEdges       = 10000
)
View Source
const PrimarySortKey = "id"

Variables

View Source
var ErrInvalidQuery = errors.New("invalid query")

Functions

This section is empty.

Types

type ByCreatedAtAsc added in v0.57.0

type ByCreatedAtAsc []QueryResult

func (ByCreatedAtAsc) Len added in v0.57.0

func (res ByCreatedAtAsc) Len() int

func (ByCreatedAtAsc) Less added in v0.57.0

func (res ByCreatedAtAsc) Less(i, j int) bool

func (ByCreatedAtAsc) Swap added in v0.57.0

func (res ByCreatedAtAsc) Swap(i, j int)

type ByCreatedAtDesc added in v0.57.0

type ByCreatedAtDesc []QueryResult

func (ByCreatedAtDesc) Len added in v0.57.0

func (res ByCreatedAtDesc) Len() int

func (ByCreatedAtDesc) Less added in v0.57.0

func (res ByCreatedAtDesc) Less(i, j int) bool

func (ByCreatedAtDesc) Swap added in v0.57.0

func (res ByCreatedAtDesc) Swap(i, j int)

type ByObjectTypeAndObjectIdAsc added in v0.57.0

type ByObjectTypeAndObjectIdAsc []QueryResult

func (ByObjectTypeAndObjectIdAsc) Len added in v0.57.0

func (res ByObjectTypeAndObjectIdAsc) Len() int

func (ByObjectTypeAndObjectIdAsc) Less added in v0.57.0

func (res ByObjectTypeAndObjectIdAsc) Less(i, j int) bool

func (ByObjectTypeAndObjectIdAsc) Swap added in v0.57.0

func (res ByObjectTypeAndObjectIdAsc) Swap(i, j int)

type ByObjectTypeAndObjectIdDesc added in v0.57.0

type ByObjectTypeAndObjectIdDesc []QueryResult

func (ByObjectTypeAndObjectIdDesc) Len added in v0.57.0

func (res ByObjectTypeAndObjectIdDesc) Len() int

func (ByObjectTypeAndObjectIdDesc) Less added in v0.57.0

func (res ByObjectTypeAndObjectIdDesc) Less(i, j int) bool

func (ByObjectTypeAndObjectIdDesc) Swap added in v0.57.0

func (res ByObjectTypeAndObjectIdDesc) Swap(i, j int)

type Query

type Query struct {
	Expand         bool
	SelectSubjects *SelectSubjects
	SelectObjects  *SelectObjects
	Context        *baseWarrant.PolicyContext
	// contains filtered or unexported fields
}

func NewQueryFromString

func NewQueryFromString(queryString string) (*Query, error)

func (Query) String added in v0.54.0

func (q Query) String() string

type QueryHaving

type QueryHaving struct {
	ObjectType  string `json:"objectType,omitempty"`
	ObjectId    string `json:"objectId,omitempty"`
	Relation    string `json:"relation,omitempty"`
	SubjectType string `json:"subjectType,omitempty"`
	SubjectId   string `json:"subjectId,omitempty"`
}

type QueryListParamParser

type QueryListParamParser struct{}

func (QueryListParamParser) GetDefaultSortBy

func (parser QueryListParamParser) GetDefaultSortBy() string

func (QueryListParamParser) GetSupportedSortBys

func (parser QueryListParamParser) GetSupportedSortBys() []string

func (QueryListParamParser) ParseValue

func (parser QueryListParamParser) ParseValue(val string, sortBy string) (interface{}, error)

type QueryResponseV1 added in v0.57.0

type QueryResponseV1 struct {
	Results []QueryResult `json:"results"`
	LastId  string        `json:"lastId,omitempty"`
}

type QueryResponseV2 added in v0.57.0

type QueryResponseV2 struct {
	Results    []QueryResult   `json:"results"`
	PrevCursor *service.Cursor `json:"prevCursor,omitempty"`
	NextCursor *service.Cursor `json:"nextCursor,omitempty"`
}

type QueryResult

type QueryResult struct {
	ObjectType string                  `json:"objectType"`
	ObjectId   string                  `json:"objectId"`
	Warrant    baseWarrant.WarrantSpec `json:"warrant"`
	IsImplicit bool                    `json:"isImplicit"`
	Meta       map[string]interface{}  `json:"meta,omitempty"`
}

type QueryService

type QueryService struct {
	service.BaseService
	// contains filtered or unexported fields
}

func NewService

func NewService(env service.Env, objectTypeSvc objecttype.Service, warrantSvc warrant.Service, objectSvc object.Service) QueryService

func (QueryService) Query

func (svc QueryService) Query(ctx context.Context, query *Query, listParams service.ListParams) ([]QueryResult, *service.Cursor, *service.Cursor, error)

func (QueryService) Routes

func (svc QueryService) Routes() ([]service.Route, error)

type Resource

type Resource struct {
	Type string
	Id   string
}

type ResultSet

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

func NewResultSet

func NewResultSet() *ResultSet

func (*ResultSet) Add

func (rs *ResultSet) Add(objectType string, objectId string, warrant warrant.WarrantSpec, isImplicit bool)

func (*ResultSet) Get

func (rs *ResultSet) Get(objectType string, objectId string) *ResultSetNode

func (*ResultSet) Has

func (rs *ResultSet) Has(objectType string, objectId string) bool

func (*ResultSet) Intersect

func (rs *ResultSet) Intersect(other *ResultSet) *ResultSet

func (*ResultSet) Len

func (rs *ResultSet) Len() int

func (*ResultSet) List

func (rs *ResultSet) List() *ResultSetNode

func (*ResultSet) String

func (rs *ResultSet) String() string

func (*ResultSet) Union

func (rs *ResultSet) Union(other *ResultSet) *ResultSet

type ResultSetNode

type ResultSetNode struct {
	ObjectType string
	ObjectId   string
	Warrant    warrant.WarrantSpec
	IsImplicit bool
	// contains filtered or unexported fields
}

func (ResultSetNode) Next

func (node ResultSetNode) Next() *ResultSetNode

type SelectObjects

type SelectObjects struct {
	ObjectTypes  []string
	Relations    []string
	WhereSubject *Resource
}

type SelectSubjects

type SelectSubjects struct {
	ForObject    *Resource
	Relations    []string
	SubjectTypes []string
}

Jump to

Keyboard shortcuts

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