Documentation
¶
Index ¶
Constants ¶
View Source
const Authorized = "Authorized"
View Source
const NotAuthorized = "Not Authorized"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckManySpec ¶
type CheckManySpec struct {
Op string `json:"op"`
Warrants []warrant.WarrantSpec `json:"warrants" validate:"min=1,dive"`
Context context.ContextSetSpec `json:"context"`
ConsistentRead bool `json:"consistentRead"`
Debug bool `json:"debug"`
}
func (CheckManySpec) ToMap ¶
func (spec CheckManySpec) ToMap() map[string]interface{}
type CheckResultSpec ¶
type CheckResultSpec struct {
Code int64 `json:"code,omitempty"`
Result string `json:"result"`
ProcessingTime int64 `json:"processingTime,omitempty"`
DecisionPath []warrant.WarrantSpec `json:"decisionPath,omitempty"`
}
type CheckService ¶
type CheckService struct {
service.BaseService
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env service.Env) CheckService
func (CheckService) Check ¶
func (svc CheckService) Check(ctx context.Context, warrantCheck CheckSpec) (match bool, decisionPath []warrant.WarrantSpec, err error)
Check returns true if the subject has a warrant (explicitly or implicitly) for given objectType:objectId#relation and context
func (CheckService) CheckMany ¶
func (svc CheckService) CheckMany(ctx context.Context, warrantCheck *CheckManySpec) (*CheckResultSpec, error)
func (CheckService) GetRoutes ¶
func (svc CheckService) GetRoutes() []service.Route
Click to show internal directories.
Click to hide internal directories.