client

package
v0.0.0-...-794f3e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

type GroupAdapter struct {
	Group *types.Group
	// contains filtered or unexported fields
}

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) Get

func (c *GroupAdapter) Get(id string) error

Get adapter.

func (*GroupAdapter) Update

func (c *GroupAdapter) Update() error

Update adapter.

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

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

type ResourceAdapter struct {
	Resource *types.Resource
	// contains filtered or unexported fields
}

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

type RoleAdapter struct {
	Role *types.Role
	// contains filtered or unexported fields
}

RoleAdapter adapter for managing roles.

func (*RoleAdapter) AddPermissions

func (c *RoleAdapter) AddPermissions(permissions ...*types.Permission) error

AddPermissions adapter for adding permissions.

func (*RoleAdapter) Create

func (c *RoleAdapter) Create() (*RoleAdapter, error)

Create adapter.

func (*RoleAdapter) DeletePermissions

func (c *RoleAdapter) DeletePermissions(permissions ...*types.Permission) error

DeletePermissions adapter for deleting permissions.

func (*RoleAdapter) Get

func (c *RoleAdapter) Get(id string) error

Get adapter.

func (*RoleAdapter) Update

func (c *RoleAdapter) Update() error

Update adapter.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL