Documentation
¶
Index ¶
- Constants
- func AuthorizeHandler(svc CheckService, w http.ResponseWriter, r *http.Request) error
- type CheckManySpec
- type CheckResultSpec
- type CheckService
- func (svc CheckService) Check(ctx context.Context, authInfo *service.AuthInfo, warrantCheck CheckSpec) (match bool, decisionPath []warrant.WarrantSpec, err error)
- func (svc CheckService) CheckMany(ctx context.Context, authInfo *service.AuthInfo, warrantCheck *CheckManySpec) (*CheckResultSpec, error)
- func (svc CheckService) Routes() []service.Route
- type CheckSpec
- type SessionCheckManySpec
Constants ¶
View Source
const Authorized = "Authorized"
View Source
const NotAuthorized = "Not Authorized"
Variables ¶
This section is empty.
Functions ¶
func AuthorizeHandler ¶ added in v0.11.0
func AuthorizeHandler(svc CheckService, w http.ResponseWriter, r *http.Request) error
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 CheckService ¶
type CheckService struct {
service.BaseService
WarrantRepository warrant.WarrantRepository
EventSvc event.EventService
CtxSvc wntContext.ContextService
ObjectTypeSvc objecttype.ObjectTypeService
}
func NewService ¶
func NewService(env service.Env, warrantRepo warrant.WarrantRepository, ctxSvc wntContext.ContextService, eventSvc event.EventService, objectTypeSvc objecttype.ObjectTypeService) CheckService
func (CheckService) Check ¶
func (svc CheckService) Check(ctx context.Context, authInfo *service.AuthInfo, 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, authInfo *service.AuthInfo, warrantCheck *CheckManySpec) (*CheckResultSpec, error)
func (CheckService) Routes ¶ added in v0.8.0
func (svc CheckService) Routes() []service.Route
type CheckSpec ¶
type CheckSpec struct {
warrant.WarrantSpec
ConsistentRead bool `json:"consistentRead"`
Debug bool `json:"debug"`
}
type SessionCheckManySpec ¶ added in v0.7.0
type SessionCheckManySpec struct {
Op string `json:"op"`
Warrants []warrant.SessionWarrantSpec `json:"warrants" validate:"min=1,dive"`
Context context.ContextSetSpec `json:"context"`
ConsistentRead bool `json:"consistentRead"`
Debug bool `json:"debug"`
}
Click to show internal directories.
Click to hide internal directories.