http

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthAdminServiceHTTP

func NewAuthAdminServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) service.AuthAdminService

NewAuthAdminServiceHTTP manages persistence of AuthZ data

Types

type GroupServiceHTTP

type GroupServiceHTTP struct {
	// contains filtered or unexported fields
}

GroupServiceHTTP - manages persistence of groups data

func NewGroupServiceHTTP

func NewGroupServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *GroupServiceHTTP

NewGroupServiceHTTP manages persistence of groups data

func (*GroupServiceHTTP) AddRolesToGroup

func (h *GroupServiceHTTP) AddRolesToGroup(
	ctx context.Context,
	organizationID string,
	namespace string,
	groupID string,
	roleIDs ...string,
) error

AddRolesToGroup helper

func (*GroupServiceHTTP) CreateGroup

func (h *GroupServiceHTTP) CreateGroup(
	ctx context.Context,
	organizationID string,
	group *types.Group) (*types.Group, error)

CreateGroup - creates a new group

func (*GroupServiceHTTP) DeleteGroup

func (h *GroupServiceHTTP) DeleteGroup(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string) error

DeleteGroup removes group

func (*GroupServiceHTTP) DeleteRolesToGroup

func (h *GroupServiceHTTP) DeleteRolesToGroup(
	ctx context.Context,
	organizationID string,
	namespace string,
	groupID string,
	roleIDs ...string,
) error

DeleteRolesToGroup helper

func (*GroupServiceHTTP) GetGroup

func (h *GroupServiceHTTP) GetGroup(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (*types.Group, error)

GetGroup - finds group

func (*GroupServiceHTTP) GetGroups

func (h *GroupServiceHTTP) GetGroups(
	ctx context.Context,
	organizationID string,
	namespace string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Group, nextOffset string, err error)

GetGroups - queries groups

func (*GroupServiceHTTP) UpdateGroup

func (h *GroupServiceHTTP) UpdateGroup(
	ctx context.Context,
	organizationID string,
	group *types.Group) error

UpdateGroup - updates an existing group

type OrganizationServiceHTTP

type OrganizationServiceHTTP struct {
	// contains filtered or unexported fields
}

OrganizationServiceHTTP - manages persistence of AuthZ data.

func NewOrganizationServiceHTTP

func NewOrganizationServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *OrganizationServiceHTTP

NewOrganizationServiceHTTP manages persistence of organization.

func (*OrganizationServiceHTTP) CreateOrganization

func (h *OrganizationServiceHTTP) CreateOrganization(
	ctx context.Context,
	org *types.Organization) (*types.Organization, error)

CreateOrganization - adds an organization.

func (*OrganizationServiceHTTP) DeleteOrganization

func (h *OrganizationServiceHTTP) DeleteOrganization(
	ctx context.Context,
	id string) error

DeleteOrganization removes organization.

func (*OrganizationServiceHTTP) GetOrganization

func (h *OrganizationServiceHTTP) GetOrganization(
	ctx context.Context,
	id string) (org *types.Organization, err error)

GetOrganization finds organization

func (*OrganizationServiceHTTP) GetOrganizations

func (h *OrganizationServiceHTTP) GetOrganizations(
	ctx context.Context,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Organization, nextOffset string, err error)

GetOrganizations - queries organizations

func (*OrganizationServiceHTTP) UpdateOrganization

func (h *OrganizationServiceHTTP) UpdateOrganization(
	ctx context.Context,
	org *types.Organization) error

UpdateOrganization - updates organization in the database.

type PermissionServiceHTTP

type PermissionServiceHTTP struct {
	// contains filtered or unexported fields
}

PermissionServiceHTTP - manages persistence of permission data

func NewPermissionServiceHTTP

func NewPermissionServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *PermissionServiceHTTP

NewPermissionServiceHTTP manages persistence of permission data

func (*PermissionServiceHTTP) CreatePermission

func (h *PermissionServiceHTTP) CreatePermission(
	ctx context.Context,
	organizationID string,
	permission *types.Permission) (*types.Permission, error)

CreatePermission - creates a new permission

func (*PermissionServiceHTTP) DeletePermission

func (h *PermissionServiceHTTP) DeletePermission(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string) error

DeletePermission removes permission

func (*PermissionServiceHTTP) GetPermission

func (h *PermissionServiceHTTP) GetPermission(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (*types.Permission, error)

GetPermission - finds permission

func (*PermissionServiceHTTP) GetPermissions

func (h *PermissionServiceHTTP) GetPermissions(
	ctx context.Context,
	organizationID string,
	namespace string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Permission, nextOffset string, err error)

GetPermissions - queries permissions

func (*PermissionServiceHTTP) UpdatePermission

func (h *PermissionServiceHTTP) UpdatePermission(
	ctx context.Context,
	organizationID string,
	permission *types.Permission) error

UpdatePermission - updates an existing permission

type PrincipalServiceHTTP

type PrincipalServiceHTTP struct {
	// contains filtered or unexported fields
}

PrincipalServiceHTTP - manages persistence of principal objects

func NewPrincipalServiceHTTP

func NewPrincipalServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *PrincipalServiceHTTP

NewPrincipalServiceHTTP manages persistence of principal data

func (*PrincipalServiceHTTP) AddGroupsToPrincipal

func (h *PrincipalServiceHTTP) AddGroupsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	groupIDs ...string,
) error

AddGroupsToPrincipal helper

func (*PrincipalServiceHTTP) AddPermissionsToPrincipal

func (h *PrincipalServiceHTTP) AddPermissionsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	permissionIds ...string,
) error

AddPermissionsToPrincipal helper

func (*PrincipalServiceHTTP) AddRelationshipsToPrincipal

func (h *PrincipalServiceHTTP) AddRelationshipsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	relationshipIds ...string,
) error

AddRelationshipsToPrincipal helper

func (*PrincipalServiceHTTP) AddRolesToPrincipal

func (h *PrincipalServiceHTTP) AddRolesToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	roleIDs ...string,
) error

AddRolesToPrincipal helper

func (*PrincipalServiceHTTP) CreatePrincipal

func (h *PrincipalServiceHTTP) CreatePrincipal(
	ctx context.Context,
	principal *types.Principal) (*types.Principal, error)

CreatePrincipal - creates new instance of principal Note - this method won't be used to update any role-ids, group-ids, relations, and permission-ids

func (*PrincipalServiceHTTP) DeleteGroupsToPrincipal

func (h *PrincipalServiceHTTP) DeleteGroupsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	groupIDs ...string,
) error

DeleteGroupsToPrincipal helper

func (*PrincipalServiceHTTP) DeletePermissionsToPrincipal

func (h *PrincipalServiceHTTP) DeletePermissionsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	permissionIds ...string,
) error

DeletePermissionsToPrincipal helper

func (*PrincipalServiceHTTP) DeletePrincipal

func (h *PrincipalServiceHTTP) DeletePrincipal(
	ctx context.Context,
	organizationID string,
	id string) error

DeletePrincipal removes principal

func (*PrincipalServiceHTTP) DeleteRelationshipsToPrincipal

func (h *PrincipalServiceHTTP) DeleteRelationshipsToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	relationshipIds ...string,
) error

DeleteRelationshipsToPrincipal helper

func (*PrincipalServiceHTTP) DeleteRolesToPrincipal

func (h *PrincipalServiceHTTP) DeleteRolesToPrincipal(
	ctx context.Context,
	organizationID string,
	namespace string,
	principalID string,
	roleIDs ...string,
) error

DeleteRolesToPrincipal helper

func (*PrincipalServiceHTTP) GetPrincipal

func (h *PrincipalServiceHTTP) GetPrincipal(
	ctx context.Context,
	organizationID string,
	id string,
) (*types.Principal, error)

GetPrincipal - retrieves principal

func (*PrincipalServiceHTTP) GetPrincipalExt

func (h *PrincipalServiceHTTP) GetPrincipalExt(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (xPrincipal *domain.PrincipalExt, err error)

GetPrincipalExt - retrieves full principal

func (*PrincipalServiceHTTP) GetPrincipals

func (h *PrincipalServiceHTTP) GetPrincipals(
	ctx context.Context,
	organizationID string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Principal, nextOffset string, err error)

GetPrincipals - queries principals

func (*PrincipalServiceHTTP) UpdatePrincipal

func (h *PrincipalServiceHTTP) UpdatePrincipal(
	ctx context.Context,
	principal *types.Principal) error

UpdatePrincipal - updates existing instance of principal Note - this method won't be used to update any role-ids, group-ids, relations, and permission-ids

type RelationshipServiceHTTP

type RelationshipServiceHTTP struct {
	// contains filtered or unexported fields
}

RelationshipServiceHTTP - manages persistence of relationship data

func NewRelationshipServiceHTTP

func NewRelationshipServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *RelationshipServiceHTTP

NewRelationshipServiceHTTP manages persistence of relationship data

func (*RelationshipServiceHTTP) CreateRelationship

func (h *RelationshipServiceHTTP) CreateRelationship(
	ctx context.Context,
	organizationID string,
	relationship *types.Relationship) (*types.Relationship, error)

CreateRelationship - creates a new relationship

func (*RelationshipServiceHTTP) DeleteRelationship

func (h *RelationshipServiceHTTP) DeleteRelationship(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string) error

DeleteRelationship removes relationship

func (*RelationshipServiceHTTP) GetRelationship

func (h *RelationshipServiceHTTP) GetRelationship(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (*types.Relationship, error)

GetRelationship - finds relationship

func (*RelationshipServiceHTTP) GetRelationships

func (h *RelationshipServiceHTTP) GetRelationships(
	ctx context.Context,
	organizationID string,
	namespace string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Relationship, nextOffset string, err error)

GetRelationships - queries relationships

func (*RelationshipServiceHTTP) UpdateRelationship

func (h *RelationshipServiceHTTP) UpdateRelationship(
	ctx context.Context,
	organizationID string,
	relationship *types.Relationship) error

UpdateRelationship - updates an existing relationship

type ResourceServiceHTTP

type ResourceServiceHTTP struct {
	// contains filtered or unexported fields
}

ResourceServiceHTTP - manages persistence of resources and resource instances

func NewResourceServiceHTTP

func NewResourceServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *ResourceServiceHTTP

NewResourceServiceHTTP manages persistence of resources

func (*ResourceServiceHTTP) AllocateResourceInstance

func (h *ResourceServiceHTTP) AllocateResourceInstance(
	ctx context.Context,
	organizationID string,
	namespace string,
	resourceID string,
	principalID string,
	constraints string,
	expiry time.Duration,
	context map[string]string,
) error

AllocateResourceInstance - allocates resource-instance

func (*ResourceServiceHTTP) CountResourceInstances

func (h *ResourceServiceHTTP) CountResourceInstances(
	ctx context.Context,
	organizationID string,
	namespace string,
	resourceID string,
) (capacity int32, allocated int32, err error)

CountResourceInstances - size of total and allocated resource-instances

func (*ResourceServiceHTTP) CreateResource

func (h *ResourceServiceHTTP) CreateResource(
	ctx context.Context,
	organizationID string,
	resource *types.Resource) (*types.Resource, error)

CreateResource - creates a new instance of resource

func (*ResourceServiceHTTP) DeallocateResourceInstance

func (h *ResourceServiceHTTP) DeallocateResourceInstance(
	ctx context.Context,
	organizationID string,
	namespace string,
	resourceID string,
	principalID string,
) error

DeallocateResourceInstance - deallocates resource-instance

func (*ResourceServiceHTTP) DeleteResource

func (h *ResourceServiceHTTP) DeleteResource(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string) error

DeleteResource removes resource

func (*ResourceServiceHTTP) GetResource

func (h *ResourceServiceHTTP) GetResource(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (*types.Resource, error)

GetResource - finds resource

func (*ResourceServiceHTTP) QueryResourceInstances

func (h *ResourceServiceHTTP) QueryResourceInstances(
	ctx context.Context,
	organizationID string,
	namespace string,
	resourceID string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.ResourceInstance, nextOffset string, err error)

QueryResourceInstances - queries resource-instances.

func (*ResourceServiceHTTP) QueryResources

func (h *ResourceServiceHTTP) QueryResources(
	ctx context.Context,
	organizationID string,
	namespace string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Resource, nextOffset string, err error)

QueryResources - queries resources.

func (*ResourceServiceHTTP) UpdateResource

func (h *ResourceServiceHTTP) UpdateResource(
	ctx context.Context,
	organizationID string,
	resource *types.Resource) error

UpdateResource - updates an existing resource

type RoleServiceHTTP

type RoleServiceHTTP struct {
	// contains filtered or unexported fields
}

RoleServiceHTTP - manages persistence of roles data

func NewRoleServiceHTTP

func NewRoleServiceHTTP(
	client web.HTTPClient,
	baseURL string,
) *RoleServiceHTTP

NewRoleServiceHTTP manages persistence of roles data

func (*RoleServiceHTTP) AddPermissionsToRole

func (h *RoleServiceHTTP) AddPermissionsToRole(
	ctx context.Context,
	organizationID string,
	namespace string,
	roleID string,
	permissionIds ...string,
) error

AddPermissionsToRole helper

func (*RoleServiceHTTP) CreateRole

func (h *RoleServiceHTTP) CreateRole(
	ctx context.Context,
	organizationID string,
	role *types.Role) (*types.Role, error)

CreateRole - creates a new role

func (*RoleServiceHTTP) DeletePermissionsToRole

func (h *RoleServiceHTTP) DeletePermissionsToRole(
	ctx context.Context,
	organizationID string,
	namespace string,
	roleID string,
	permissionIds ...string,
) error

DeletePermissionsToRole helper

func (*RoleServiceHTTP) DeleteRole

func (h *RoleServiceHTTP) DeleteRole(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string) error

DeleteRole removes role

func (*RoleServiceHTTP) GetRole

func (h *RoleServiceHTTP) GetRole(
	ctx context.Context,
	organizationID string,
	namespace string,
	id string,
) (*types.Role, error)

GetRole - finds role

func (*RoleServiceHTTP) GetRoles

func (h *RoleServiceHTTP) GetRoles(
	ctx context.Context,
	organizationID string,
	namespace string,
	predicates map[string]string,
	offset string,
	limit int64) (arr []*types.Role, nextOffset string, err error)

GetRoles - queries roles

func (*RoleServiceHTTP) UpdateRole

func (h *RoleServiceHTTP) UpdateRole(
	ctx context.Context,
	organizationID string,
	role *types.Role) error

UpdateRole - updates an existing role

Jump to

Keyboard shortcuts

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