infoModel

package
v0.70.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionInfo

type ActionInfo struct {
	Name       string         `json:"name,omitempty"`
	Properties propertiesInfo `json:"properties,omitempty"`
}

type AzInfo

type AzInfo struct {
	Req      *hexaOpaClient.ReqParams   `json:"req"`
	Subject  *hexaOpaClient.SubjectInfo `json:"subject"`
	Resource ResourceInfo               `json:"resource"` // Resource #deprecated not used. see ReqParams.ResourceIds
}

type ContextInfo

type ContextInfo propertiesInfo

func (ContextInfo) GetProperty added in v0.69.0

func (c ContextInfo) GetProperty(id string) interface{}

func (ContextInfo) GetPropertyString added in v0.69.0

func (c ContextInfo) GetPropertyString(id string) string

func (ContextInfo) GetSubProperty added in v0.69.0

func (c ContextInfo) GetSubProperty(id, sub string) string

type DecisionResponse added in v0.69.0

type DecisionResponse struct {
	Decision    bool              `json:"decision"`
	ReasonAdmin map[string]string `json:"reason_admin,omitempty"`
	ReasonUser  map[string]string `json:"reason_user,omitempty"`
	Context     *ContextInfo      `json:"context,omitempty"`
}

type EvaluationBlock added in v0.69.0

type EvaluationBlock struct {
	Items   *[]EvaluationItem         `json:"-"`
	ItemMap map[string]EvaluationItem `json:"-"`
}

func (*EvaluationBlock) GetItemMap added in v0.69.0

func (e *EvaluationBlock) GetItemMap() map[string]EvaluationItem

func (*EvaluationBlock) GetItemSlice added in v0.69.0

func (e *EvaluationBlock) GetItemSlice() []EvaluationItem

func (*EvaluationBlock) IsMap added in v0.69.0

func (e *EvaluationBlock) IsMap() bool

func (EvaluationBlock) MarshalJSON added in v0.69.0

func (e EvaluationBlock) MarshalJSON() ([]byte, error)

func (*EvaluationBlock) UnmarshalJSON added in v0.69.0

func (e *EvaluationBlock) UnmarshalJSON(data []byte) error

type EvaluationItem added in v0.69.0

type EvaluationItem struct {
	Subject  *SubjectInfo  `json:"subject,omitempty"`
	Action   *ActionInfo   `json:"action,omitempty"`
	Resource *ResourceInfo `json:"resource,omitempty"`
	Context  *ContextInfo  `json:"context,omitempty"`
}

type EvaluationsResponse

type EvaluationsResponse struct {
	Evaluations *[]DecisionResponse `json:"evaluations,omitempty"`
}

type QueryRequest

type QueryRequest struct {
	*EvaluationItem
	Evaluations *EvaluationBlock `json:"evaluations,omitempty"`
}

QueryRequest is used to make multiple decisions via the evaluations endpoint

func (QueryRequest) EvaluationItems added in v0.69.0

func (q QueryRequest) EvaluationItems() []EvaluationItem

func (QueryRequest) MarshalJSON added in v0.69.0

func (q QueryRequest) MarshalJSON() ([]byte, error)

type ResourceInfo

type ResourceInfo struct {
	Type       string         `json:"type,omitempty"`
	Id         string         `json:"id,omitempty"`
	Properties propertiesInfo `json:"properties,omitempty"`
}

func (*ResourceInfo) UnmarshalJSON added in v0.69.0

func (r *ResourceInfo) UnmarshalJSON(data []byte) error

type SubjectInfo

type SubjectInfo struct {
	Type       string         `json:"type,omitempty"`
	Id         string         `json:"id,omitempty"`
	UserID     string         `json:"userID,omitempty"`
	Properties propertiesInfo `json:"properties,omitempty"`
}

func (*SubjectInfo) UnmarshalJSON added in v0.69.0

func (e *SubjectInfo) UnmarshalJSON(data []byte) error

type UserInfo

type UserInfo struct {
	Id      string   `json:"id"`
	Name    string   `json:"name"`
	Email   string   `json:"email"`
	Roles   []string `json:"roles"`
	Picture string   `json:"picture"`
}

type UserRecs

type UserRecs map[string]UserInfo

func (UserRecs) GetUser added in v0.69.0

func (u UserRecs) GetUser(id string) *UserInfo

Jump to

Keyboard shortcuts

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