Documentation ¶
Index ¶
- type AuthAdapter
- type AuthorizerAdapter
- func (c *AuthorizerAdapter) Check() error
- func (c *AuthorizerAdapter) WithAction(action string) *AuthorizerAdapter
- func (c *AuthorizerAdapter) WithConstraints(constraints string) *AuthorizerAdapter
- func (c *AuthorizerAdapter) WithContext(ctx ...string) *AuthorizerAdapter
- func (c *AuthorizerAdapter) WithResource(resource *types.Resource) *AuthorizerAdapter
- func (c *AuthorizerAdapter) WithResourceName(resource string) *AuthorizerAdapter
- func (c *AuthorizerAdapter) WithScope(scope string) *AuthorizerAdapter
- type GroupAdapter
- func (c *GroupAdapter) AddRoles(roles ...*types.Role) error
- func (c *GroupAdapter) Create() (*GroupAdapter, error)
- func (c *GroupAdapter) DeleteRoles(roles ...*types.Role) error
- func (c *GroupAdapter) Get(id string) error
- func (c *GroupAdapter) Update() error
- func (c *GroupAdapter) WithName(name string) *GroupAdapter
- func (c *GroupAdapter) WithParents(parents ...*types.Group) *GroupAdapter
- type OrganizationAdapter
- func (c *OrganizationAdapter) Delete() error
- func (c *OrganizationAdapter) Groups(namespace string) *GroupAdapter
- func (c *OrganizationAdapter) Permissions(namespace string) *PermissionAdapter
- func (c *OrganizationAdapter) Principals() *PrincipalAdapter
- func (c *OrganizationAdapter) Resources(namespace string) *ResourceAdapter
- func (c *OrganizationAdapter) Roles(namespace string) *RoleAdapter
- func (c *OrganizationAdapter) Update() error
- type PermissionAdapter
- func (c *PermissionAdapter) Create() (*PermissionAdapter, error)
- func (c *PermissionAdapter) Get(id string) error
- func (c *PermissionAdapter) Update() error
- func (c *PermissionAdapter) WithActions(actions ...string) *PermissionAdapter
- func (c *PermissionAdapter) WithConstraints(constraints string) *PermissionAdapter
- func (c *PermissionAdapter) WithEffect(effect types.Effect) *PermissionAdapter
- func (c *PermissionAdapter) WithResource(resource *types.Resource) *PermissionAdapter
- func (c *PermissionAdapter) WithScope(scope string) *PermissionAdapter
- type PrincipalAdapter
- func (c *PrincipalAdapter) AddGroups(groups ...*types.Group) error
- func (c *PrincipalAdapter) AddPermissions(permissions ...*types.Permission) error
- func (c *PrincipalAdapter) AddRelations(relations ...*types.Relationship) error
- func (c *PrincipalAdapter) AddRoles(roles ...*types.Role) error
- func (c *PrincipalAdapter) Authorizer(namespace string) *AuthorizerAdapter
- func (c *PrincipalAdapter) Create() (*PrincipalAdapter, error)
- func (c *PrincipalAdapter) Delete() error
- func (c *PrincipalAdapter) DeleteGroups(groups ...*types.Group) error
- func (c *PrincipalAdapter) DeletePermissions(permissions ...*types.Permission) error
- func (c *PrincipalAdapter) DeleteRelations(relations ...*types.Relationship) error
- func (c *PrincipalAdapter) DeleteRoles(roles ...*types.Role) error
- func (c *PrincipalAdapter) Get(principalID string) error
- func (c *PrincipalAdapter) Relationships(namespace string) *RelationshipAdapter
- func (c *PrincipalAdapter) Update() error
- func (c *PrincipalAdapter) WithAttributes(kv ...string) *PrincipalAdapter
- func (c *PrincipalAdapter) WithEmail(email string) *PrincipalAdapter
- func (c *PrincipalAdapter) WithName(name string) *PrincipalAdapter
- func (c *PrincipalAdapter) WithUsername(username string) *PrincipalAdapter
- type RelationshipAdapter
- func (c *RelationshipAdapter) Create() (*RelationshipAdapter, error)
- func (c *RelationshipAdapter) Get(id string) error
- func (c *RelationshipAdapter) Update() error
- func (c *RelationshipAdapter) WithAttributes(kv ...string) *RelationshipAdapter
- func (c *RelationshipAdapter) WithRelation(relation string) *RelationshipAdapter
- func (c *RelationshipAdapter) WithResource(resource *types.Resource) *RelationshipAdapter
- type ResourceAdapter
- func (c *ResourceAdapter) Allocate(principal *types.Principal) error
- func (c *ResourceAdapter) AllocatedCount() (allocated int32, err error)
- func (c *ResourceAdapter) Create() (*ResourceAdapter, error)
- func (c *ResourceAdapter) Deallocate(principal *types.Principal) error
- func (c *ResourceAdapter) Get(id string) error
- func (c *ResourceAdapter) Update() error
- func (c *ResourceAdapter) WithActions(actions ...string) *ResourceAdapter
- func (c *ResourceAdapter) WithAttributes(kv ...string) *ResourceAdapter
- func (c *ResourceAdapter) WithCapacity(capacity int) *ResourceAdapter
- func (c *ResourceAdapter) WithConstraints(constraints string) *ResourceAdapter
- func (c *ResourceAdapter) WithContext(kv ...string) *ResourceAdapter
- func (c *ResourceAdapter) WithExpiration(expiry time.Duration) *ResourceAdapter
- func (c *ResourceAdapter) WithName(name string) *ResourceAdapter
- type RoleAdapter
- func (c *RoleAdapter) AddPermissions(permissions ...*types.Permission) error
- func (c *RoleAdapter) Create() (*RoleAdapter, error)
- func (c *RoleAdapter) DeletePermissions(permissions ...*types.Permission) error
- func (c *RoleAdapter) Get(id string) error
- func (c *RoleAdapter) Update() error
- func (c *RoleAdapter) WithName(name string) *RoleAdapter
- func (c *RoleAdapter) WithParents(parents ...*types.Role) *RoleAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthAdapter ¶
type AuthAdapter struct {
// contains filtered or unexported fields
}
AuthAdapter adapter for auth-service.
func New ¶
func New( authorizer authz.Authorizer, authAdminService service.AuthAdminService, ) *AuthAdapter
New constructor
func (*AuthAdapter) CreateOrganization ¶
func (c *AuthAdapter) CreateOrganization( org *types.Organization) (*OrganizationAdapter, error)
CreateOrganization adapter
func (*AuthAdapter) GetOrganization ¶
func (c *AuthAdapter) GetOrganization( orgID string) (*OrganizationAdapter, error)
GetOrganization adapter
type AuthorizerAdapter ¶
type AuthorizerAdapter struct { Principal *types.Principal LastMessage string // contains filtered or unexported fields }
AuthorizerAdapter for authorization request.
func (*AuthorizerAdapter) Check ¶
func (c *AuthorizerAdapter) Check() error
Check checks for authorization access.
func (*AuthorizerAdapter) WithAction ¶
func (c *AuthorizerAdapter) WithAction(action string) *AuthorizerAdapter
WithAction setter.
func (*AuthorizerAdapter) WithConstraints ¶
func (c *AuthorizerAdapter) WithConstraints(constraints string) *AuthorizerAdapter
WithConstraints setter.
func (*AuthorizerAdapter) WithContext ¶
func (c *AuthorizerAdapter) WithContext(ctx ...string) *AuthorizerAdapter
WithContext setter.
func (*AuthorizerAdapter) WithResource ¶
func (c *AuthorizerAdapter) WithResource(resource *types.Resource) *AuthorizerAdapter
WithResource setter.
func (*AuthorizerAdapter) WithResourceName ¶
func (c *AuthorizerAdapter) WithResourceName(resource string) *AuthorizerAdapter
WithResourceName setter.
func (*AuthorizerAdapter) WithScope ¶
func (c *AuthorizerAdapter) WithScope(scope string) *AuthorizerAdapter
WithScope setter.
type GroupAdapter ¶
GroupAdapter adapter for managing groups.
func (*GroupAdapter) AddRoles ¶
func (c *GroupAdapter) AddRoles(roles ...*types.Role) error
AddRoles adapter for adding roles.
func (*GroupAdapter) Create ¶
func (c *GroupAdapter) Create() (*GroupAdapter, error)
Create adapter.
func (*GroupAdapter) DeleteRoles ¶
func (c *GroupAdapter) DeleteRoles(roles ...*types.Role) error
DeleteRoles adapter for deleting roles.
func (*GroupAdapter) WithName ¶
func (c *GroupAdapter) WithName( name string, ) *GroupAdapter
WithName setter.
func (*GroupAdapter) WithParents ¶
func (c *GroupAdapter) WithParents( parents ...*types.Group, ) *GroupAdapter
WithParents setter.
type OrganizationAdapter ¶
type OrganizationAdapter struct { Organization *types.Organization // contains filtered or unexported fields }
OrganizationAdapter for managing organizations.
func (*OrganizationAdapter) Delete ¶
func (c *OrganizationAdapter) Delete() error
Delete adapter for deleting organization.
func (*OrganizationAdapter) Groups ¶
func (c *OrganizationAdapter) Groups(namespace string) *GroupAdapter
Groups adapter for managing groups.
func (*OrganizationAdapter) Permissions ¶
func (c *OrganizationAdapter) Permissions(namespace string) *PermissionAdapter
Permissions adapter for managing permissions.
func (*OrganizationAdapter) Principals ¶
func (c *OrganizationAdapter) Principals() *PrincipalAdapter
Principals adapter for managing principals.
func (*OrganizationAdapter) Resources ¶
func (c *OrganizationAdapter) Resources(namespace string) *ResourceAdapter
Resources adapter for managing resources.
func (*OrganizationAdapter) Roles ¶
func (c *OrganizationAdapter) Roles(namespace string) *RoleAdapter
Roles adapter for managing roles.
func (*OrganizationAdapter) Update ¶
func (c *OrganizationAdapter) Update() error
Update adapter for updating organization.
type PermissionAdapter ¶
type PermissionAdapter struct { Permission *types.Permission // contains filtered or unexported fields }
PermissionAdapter adapter for permissions.
func (*PermissionAdapter) Create ¶
func (c *PermissionAdapter) Create() (*PermissionAdapter, error)
Create adapter.
func (*PermissionAdapter) Get ¶
func (c *PermissionAdapter) Get(id string) error
Get adapter for fetching permission.
func (*PermissionAdapter) Update ¶
func (c *PermissionAdapter) Update() error
Update adapter for updating permissions.
func (*PermissionAdapter) WithActions ¶
func (c *PermissionAdapter) WithActions( actions ...string) *PermissionAdapter
WithActions setter.
func (*PermissionAdapter) WithConstraints ¶
func (c *PermissionAdapter) WithConstraints( constraints string, ) *PermissionAdapter
WithConstraints setter.
func (*PermissionAdapter) WithEffect ¶
func (c *PermissionAdapter) WithEffect( effect types.Effect, ) *PermissionAdapter
WithEffect setter.
func (*PermissionAdapter) WithResource ¶
func (c *PermissionAdapter) WithResource( resource *types.Resource, ) *PermissionAdapter
WithResource setter.
func (*PermissionAdapter) WithScope ¶
func (c *PermissionAdapter) WithScope( scope string, ) *PermissionAdapter
WithScope setter.
type PrincipalAdapter ¶
type PrincipalAdapter struct { Principal *types.Principal // contains filtered or unexported fields }
PrincipalAdapter for managing principals.
func (*PrincipalAdapter) AddGroups ¶
func (c *PrincipalAdapter) AddGroups(groups ...*types.Group) error
AddGroups adds groups to principal.
func (*PrincipalAdapter) AddPermissions ¶
func (c *PrincipalAdapter) AddPermissions(permissions ...*types.Permission) error
AddPermissions adds permissions to principal.
func (*PrincipalAdapter) AddRelations ¶
func (c *PrincipalAdapter) AddRelations(relations ...*types.Relationship) error
AddRelations adds relations to principal.
func (*PrincipalAdapter) AddRoles ¶
func (c *PrincipalAdapter) AddRoles(roles ...*types.Role) error
AddRoles adds roles to principal.
func (*PrincipalAdapter) Authorizer ¶
func (c *PrincipalAdapter) Authorizer( namespace string, ) *AuthorizerAdapter
Authorizer builds authorizer adapter.
func (*PrincipalAdapter) Create ¶
func (c *PrincipalAdapter) Create() (*PrincipalAdapter, error)
Create adds Principal in the database.
func (*PrincipalAdapter) Delete ¶
func (c *PrincipalAdapter) Delete() error
Delete removes principal.
func (*PrincipalAdapter) DeleteGroups ¶
func (c *PrincipalAdapter) DeleteGroups(groups ...*types.Group) error
DeleteGroups removes groups from the principal.
func (*PrincipalAdapter) DeletePermissions ¶
func (c *PrincipalAdapter) DeletePermissions(permissions ...*types.Permission) error
DeletePermissions removes permissions to principal.
func (*PrincipalAdapter) DeleteRelations ¶
func (c *PrincipalAdapter) DeleteRelations(relations ...*types.Relationship) error
DeleteRelations removes relations to principal.
func (*PrincipalAdapter) DeleteRoles ¶
func (c *PrincipalAdapter) DeleteRoles(roles ...*types.Role) error
DeleteRoles removes roles to principal.
func (*PrincipalAdapter) Get ¶
func (c *PrincipalAdapter) Get(principalID string) error
Get finds Principal from the database.
func (*PrincipalAdapter) Relationships ¶
func (c *PrincipalAdapter) Relationships(namespace string) *RelationshipAdapter
Relationships manages relationships.
func (*PrincipalAdapter) Update ¶
func (c *PrincipalAdapter) Update() error
Update updates Principal.
func (*PrincipalAdapter) WithAttributes ¶
func (c *PrincipalAdapter) WithAttributes( kv ...string, ) *PrincipalAdapter
WithAttributes setter.
func (*PrincipalAdapter) WithEmail ¶
func (c *PrincipalAdapter) WithEmail(email string) *PrincipalAdapter
WithEmail setter.
func (*PrincipalAdapter) WithName ¶
func (c *PrincipalAdapter) WithName(name string) *PrincipalAdapter
WithName setter.
func (*PrincipalAdapter) WithUsername ¶
func (c *PrincipalAdapter) WithUsername(username string) *PrincipalAdapter
WithUsername setter.
type RelationshipAdapter ¶
type RelationshipAdapter struct { Relationship *types.Relationship // contains filtered or unexported fields }
RelationshipAdapter adapter for managing relationships.
func (*RelationshipAdapter) Create ¶
func (c *RelationshipAdapter) Create() (*RelationshipAdapter, error)
Create adapter for adding relationship.
func (*RelationshipAdapter) Get ¶
func (c *RelationshipAdapter) Get(id string) error
Get adapter for initializing relationship from the database.
func (*RelationshipAdapter) Update ¶
func (c *RelationshipAdapter) Update() error
Update adapter for updating relationship.
func (*RelationshipAdapter) WithAttributes ¶
func (c *RelationshipAdapter) WithAttributes( kv ...string, ) *RelationshipAdapter
WithAttributes setter.
func (*RelationshipAdapter) WithRelation ¶
func (c *RelationshipAdapter) WithRelation(relation string) *RelationshipAdapter
WithRelation setter.
func (*RelationshipAdapter) WithResource ¶
func (c *RelationshipAdapter) WithResource(resource *types.Resource) *RelationshipAdapter
WithResource setter.
type ResourceAdapter ¶
ResourceAdapter adapter for managing resources.
func (*ResourceAdapter) Allocate ¶
func (c *ResourceAdapter) Allocate(principal *types.Principal) error
Allocate adapter for allocating resource.
func (*ResourceAdapter) AllocatedCount ¶
func (c *ResourceAdapter) AllocatedCount() (allocated int32, err error)
AllocatedCount adapter for counting allocated resources.
func (*ResourceAdapter) Create ¶
func (c *ResourceAdapter) Create() (*ResourceAdapter, error)
Create adapter for adding resource.
func (*ResourceAdapter) Deallocate ¶
func (c *ResourceAdapter) Deallocate(principal *types.Principal) error
Deallocate adapter for deallocating resource.
func (*ResourceAdapter) Get ¶
func (c *ResourceAdapter) Get(id string) error
Get adapter for initializing resource.
func (*ResourceAdapter) Update ¶
func (c *ResourceAdapter) Update() error
Update adapter for updating resource.
func (*ResourceAdapter) WithActions ¶
func (c *ResourceAdapter) WithActions( actions ...string) *ResourceAdapter
WithActions setter.
func (*ResourceAdapter) WithAttributes ¶
func (c *ResourceAdapter) WithAttributes( kv ...string, ) *ResourceAdapter
WithAttributes setter.
func (*ResourceAdapter) WithCapacity ¶
func (c *ResourceAdapter) WithCapacity( capacity int, ) *ResourceAdapter
WithCapacity setter.
func (*ResourceAdapter) WithConstraints ¶
func (c *ResourceAdapter) WithConstraints( constraints string) *ResourceAdapter
WithConstraints setter.
func (*ResourceAdapter) WithContext ¶
func (c *ResourceAdapter) WithContext( kv ...string, ) *ResourceAdapter
WithContext setter.
func (*ResourceAdapter) WithExpiration ¶
func (c *ResourceAdapter) WithExpiration( expiry time.Duration, ) *ResourceAdapter
WithExpiration setter.
func (*ResourceAdapter) WithName ¶
func (c *ResourceAdapter) WithName( name string, ) *ResourceAdapter
WithName setter.
type RoleAdapter ¶
RoleAdapter adapter for managing roles.
func (*RoleAdapter) AddPermissions ¶
func (c *RoleAdapter) AddPermissions(permissions ...*types.Permission) error
AddPermissions adapter for adding permissions.
func (*RoleAdapter) DeletePermissions ¶
func (c *RoleAdapter) DeletePermissions(permissions ...*types.Permission) error
DeletePermissions adapter for deleting permissions.
func (*RoleAdapter) WithName ¶
func (c *RoleAdapter) WithName( name string, ) *RoleAdapter
WithName setter.
func (*RoleAdapter) WithParents ¶
func (c *RoleAdapter) WithParents( parents ...*types.Role) *RoleAdapter
WithParents setter.