Documentation
¶
Index ¶
- Constants
- func NewPipeline(maxServiceConcurrency int, maxSubtaskConcurrency int) *pipeline
- type CheckContextFunc
- type CheckManySpec
- type CheckResultSpec
- type CheckService
- func (svc CheckService) Check(ctx context.Context, authInfo *service.AuthInfo, warrantCheck CheckSpec) (bool, []warrant.WarrantSpec, bool, error)
- func (svc CheckService) CheckMany(ctx context.Context, authInfo *service.AuthInfo, warrantCheck *CheckManySpec) (*CheckResultSpec, error)
- func (svc CheckService) Routes() ([]service.Route, error)
- type CheckSessionWarrantSpec
- type CheckSpec
- type CheckWarrantSpec
- type SessionCheckManySpec
Constants ¶
View Source
const Authorized = "Authorized"
View Source
const (
MaxWarrants = 10000
)
View Source
const NotAuthorized = "Not Authorized"
Variables ¶
This section is empty.
Functions ¶
func NewPipeline ¶ added in v0.31.0
Types ¶
type CheckContextFunc ¶ added in v0.32.2
type CheckManySpec ¶
type CheckManySpec struct {
Op string `json:"op"`
Warrants []CheckWarrantSpec `json:"warrants" validate:"min=1,dive"`
Context warrant.PolicyContext `json:"context"`
Debug bool `json:"debug"`
}
type CheckResultSpec ¶
type CheckService ¶
type CheckService struct {
service.BaseService
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env service.Env, warrantSvc warrant.Service, objectTypeSvc objecttype.Service, checkConfig *config.CheckConfig, checkContext CheckContextFunc) *CheckService
func (CheckService) Check ¶
func (svc CheckService) Check(ctx context.Context, authInfo *service.AuthInfo, warrantCheck CheckSpec) (bool, []warrant.WarrantSpec, bool, 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)
type CheckSessionWarrantSpec ¶ added in v0.18.0
type CheckSessionWarrantSpec struct {
ObjectType string `json:"objectType" validate:"required,valid_object_type"`
ObjectId string `json:"objectId" validate:"required,valid_object_id"`
Relation string `json:"relation" validate:"required,valid_relation"`
Context warrant.PolicyContext `json:"context"`
}
type CheckSpec ¶
type CheckSpec struct {
CheckWarrantSpec
Debug bool `json:"debug" validate:"boolean"`
}
type CheckWarrantSpec ¶ added in v0.18.0
type CheckWarrantSpec struct {
ObjectType string `json:"objectType" validate:"required,valid_object_type"`
ObjectId string `json:"objectId" validate:"required,valid_object_id"`
Relation string `json:"relation" validate:"required,valid_relation"`
Subject *warrant.SubjectSpec `json:"subject" validate:"required"`
Context warrant.PolicyContext `json:"context"`
}
func (CheckWarrantSpec) String ¶ added in v0.18.0
func (spec CheckWarrantSpec) String() string
type SessionCheckManySpec ¶ added in v0.7.0
type SessionCheckManySpec struct {
Op string `json:"op"`
Warrants []CheckSessionWarrantSpec `json:"warrants" validate:"min=1,dive"`
Context warrant.PolicyContext `json:"context"`
Debug bool `json:"debug"`
}
Click to show internal directories.
Click to hide internal directories.