Documentation ¶
Index ¶
- Constants
- func NewRepoEnforcer(logger echo.Logger) (Repo, Enforcer, error)
- type APIAuditRepo
- type AuthzGroupingPolicy
- type AuthzPolicy
- type AuthzRequest
- type CreateAPIAuditOption
- type CreateFactOption
- type CreateGrantOption
- type CreateScopeOption
- type Enforcer
- type FactRepo
- type GetFactBlindIndexesOption
- type GetFactOption
- type GetFactSearchOption
- type GetScopeOption
- type GrantRepo
- type NotFoundError
- type QueryAPIAuditOption
- type Repo
- type ScopeRepo
- type UnauthorizedError
- type ValidationError
Constants ¶
View Source
const ( // DataplaneName ... DataplaneName = "dataplane" // ControlplaneName ... ControlplaneName = "controlplane" // ProxyplaneName ... ProxyplaneName = "proxyplane" )
Variables ¶
This section is empty.
Functions ¶
func NewRepoEnforcer ¶
NewRepoEnforcer creates a new RepoEnforcer
Types ¶
type APIAuditRepo ¶
type APIAuditRepo interface { CreateAPIAudit(ctx context.Context, opt *CreateAPIAuditOption) (*ent.APIAudit, error) QueryAPIAudits(ctx context.Context, opt *QueryAPIAuditOption) ([]*ent.APIAudit, error) }
APIAuditRepo is a repository for APIAudit
type AuthzGroupingPolicy ¶
type AuthzPolicy ¶
type AuthzRequest ¶
type CreateAPIAuditOption ¶
type CreateAPIAuditOption struct { Plane string HashedGrantToken *string Domain *string HTTPMethod *string HTTPPath *string SentHTTPStatus *int }
CreateAPIAuditOption ...
type CreateFactOption ¶
type CreateFactOption struct { Domain string HashedValue string EncryptedValue string Collection string Key string BlindIndexes []string Scope *ent.Scope }
CreateFactOption ...
type CreateGrantOption ¶
type CreateGrantOption struct { HashedGrantToken string Domain string Version string AllowedHTTPMethods []string Paths []string }
CreateGrantOption ...
type CreateScopeOption ¶
CreateScopeOption ...
type Enforcer ¶
type Enforcer interface { AddPolicy(AuthzPolicy) (bool, error) Enforce(AuthzRequest) (bool, error) AddGroupingPolicy(AuthzGroupingPolicy) (bool, error) }
Enforcer is an interface that enforces the authz access e.g. Enforce(sub, dom, obj, act)
type FactRepo ¶
type FactRepo interface { CreateFact(ctx context.Context, opt *CreateFactOption) (*ent.Fact, error) GetFact(ctx context.Context, opt *GetFactOption) (*ent.Fact, error) GetFactBlindIndexes(ctx context.Context, opt *GetFactBlindIndexesOption) ([]string, error) GetFactExactMatch(ctx context.Context, opt *GetFactSearchOption) ([]string, error) GetFactPartialMatch(ctx context.Context, opt *GetFactSearchOption) (f []string, err error) DestroyFact(ctx context.Context, opt *GetFactOption) error }
FactRepo is a repository for Fact
type GetFactBlindIndexesOption ¶
type GetFactBlindIndexesOption struct {
BlindIndexes []string
}
GetFactBlindIndexesOption ...
type GetFactSearchOption ¶
type GetFactSearchOption struct { BlindIndex string Domain string HashedValue string Collection string Key string }
GetFactBlindIndexesOption ...
type GetScopeOption ¶
GetScopeOption ...
type GrantRepo ¶
type GrantRepo interface {
CreateGrant(ctx context.Context, opt *CreateGrantOption) (*ent.Grant, error)
}
GrantRepo is a repository for Grant
type NotFoundError ¶
type NotFoundError struct {
Err error
}
NotFoundError ...
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type QueryAPIAuditOption ¶
type QueryAPIAuditOption struct { Plane *string HashedGrantToken *string Domain *string HTTPMethod *string HTTPPath *string SentHTTPStatus *int Limit *int Offset *int OrderBy *string OrderDesc bool // default is false, which means Asc }
QueryAPIAuditOption ...
type Repo ¶
type Repo interface { FactRepo ScopeRepo GrantRepo APIAuditRepo HandleError(err error) error Close() }
Repo is a set of repositories
type ScopeRepo ¶
type ScopeRepo interface { CreateScope(ctx context.Context, opt *CreateScopeOption) (*ent.Scope, error) GetScope(ctx context.Context, opt *GetScopeOption) (*ent.Scope, error) }
ScopeRepo is a repository for Scope
type UnauthorizedError ¶
type UnauthorizedError struct {
}UnauthorizedError ...
func (UnauthorizedError) Error ¶
func (err UnauthorizedError) Error() string
type ValidationError ¶
ValidationError ...
func (ValidationError) Error ¶
func (err ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.