v1beta1

package
v0.6.33-beta Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalServer        = errors.New("internal server error")
	ErrBadRequest            = errors.New("invalid syntax in body")
	ErrConflictRequest       = errors.New("already exist")
	ErrRequestBodyValidation = errors.New("invalid format for field(s)")
	ErrEmptyEmailID          = errors.New("email id is empty")
)

HTTP Codes defined here: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/errors.go#L36

Functions

func Register

func Register(ctx context.Context, s *grpc.Server, deps api.Deps, checkAPILimit int, serviceDataConfig ServiceDataConfig) error

Types

type ActionService

type ActionService interface {
	Get(ctx context.Context, id string) (action.Action, error)
	List(ctx context.Context) ([]action.Action, error)
	Upsert(ctx context.Context, action action.Action) (action.Action, error)
	Update(ctx context.Context, id string, action action.Action) (action.Action, error)
}

type ActivityService added in v0.6.17

type ActivityService interface {
	List(ctx context.Context, filter activity.Filter) (activity.PagedActivity, error)
}

type GroupService

type GroupService interface {
	Create(ctx context.Context, grp group.Group) (group.Group, error)
	Get(ctx context.Context, id string) (group.Group, error)
	List(ctx context.Context, flt group.Filter) ([]group.Group, error)
	Update(ctx context.Context, grp group.Group) (group.Group, error)
	ListUserGroups(ctx context.Context, userId string, roleId string) ([]group.Group, error)
	ListGroupRelations(ctx context.Context, objectId, subjectType, role string) ([]user.User, []group.Group, map[string][]string, map[string][]string, error)
}

type Handler

func (Handler) CreateServiceDataKey added in v0.6.20

func (Handler) GetAction

func (Handler) GetGroup

func (Handler) GetGroupServiceData added in v0.6.22

func (Handler) GetPolicy

func (Handler) GetProject

func (Handler) GetRole

func (Handler) GetUser

func (Handler) GetUserServiceData added in v0.6.22

func (Handler) ListActivities added in v0.6.17

func (Handler) ListAllUserResources added in v0.6.33

func (Handler) ListProjects

func (Handler) ListRoles

func (Handler) ListUserResourcesByType added in v0.6.33

func (Handler) ListUsers

func (Handler) UpsertGroupServiceData added in v0.6.22

func (Handler) UpsertUserServiceData added in v0.6.22

type PolicyService

type PolicyService interface {
	Get(ctx context.Context, id string) (policy.Policy, error)
	List(ctx context.Context, filter policy.Filters) ([]policy.Policy, error)
	Upsert(ctx context.Context, pol *policy.Policy) ([]policy.Policy, error)
	Update(ctx context.Context, pol *policy.Policy) ([]policy.Policy, error)
}

type ProjectService

type ProjectService interface {
	Get(ctx context.Context, idOrSlugd string) (project.Project, error)
	Create(ctx context.Context, prj project.Project) (project.Project, error)
	List(ctx context.Context) ([]project.Project, error)
	Update(ctx context.Context, toUpdate project.Project) (project.Project, error)
	ListAdmins(ctx context.Context, id string) ([]user.User, error)
}

type RelationService

type RelationService interface {
	Get(ctx context.Context, id string) (relation.RelationV2, error)
	Create(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error)
	List(ctx context.Context) ([]relation.RelationV2, error)
	DeleteV2(ctx context.Context, rel relation.RelationV2) error
	GetRelationByFields(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error)
	LookupResources(ctx context.Context, resourceType, permission, subjectType, subjectID string) ([]string, error)
	CheckPermission(ctx context.Context, usr user.User, resourceNS namespace.Namespace, resourceIdxa string, action action.Action) (bool, error)
	CheckIsPublic(ctx context.Context, resourceNS namespace.Namespace, resourceIdxa string, action action.Action) (bool, error)
}

type RelationTransformer added in v0.6.5

type RelationTransformer interface {
	TransformRelation(ctx context.Context, rlt relation.RelationV2) (relation.RelationV2, error)
}

type ResourceService

type ResourceService interface {
	Get(ctx context.Context, id string) (resource.Resource, error)
	List(ctx context.Context, flt resource.Filter) (resource.PagedResources, error)
	Upsert(ctx context.Context, resource resource.Resource) (resource.Resource, error)
	Update(ctx context.Context, id string, resource resource.Resource) (resource.Resource, error)
	CheckAuthz(ctx context.Context, resource resource.Resource, action action.Action) (bool, error)
	BulkCheckAuthz(ctx context.Context, resources []resource.Resource, actions []action.Action) ([]relation.Permission, error)
	ListUserResourcesByType(ctx context.Context, userID string, resourceType string, permissions []string) (resource.ResourcePermissions, error)
	ListAllUserResources(ctx context.Context, userID string, resourceTypes []string, permissions []string) (map[string]resource.ResourcePermissions, error)
}

type RoleService

type RoleService interface {
	Get(ctx context.Context, id string) (role.Role, error)
	Upsert(ctx context.Context, toUpsert role.Role) (role.Role, error)
	List(ctx context.Context) ([]role.Role, error)
	Update(ctx context.Context, toUpdate role.Role) (role.Role, error)
}

type RuleService

type RuleService interface {
	GetAllConfigs(ctx context.Context) ([]rule.Ruleset, error)
}

type ServiceDataConfig added in v0.6.22

type ServiceDataConfig struct {
	MaxUpsert                 int
	DefaultServiceDataProject string
}

type ServiceDataService added in v0.6.20

type ServiceDataService interface {
	CreateKey(ctx context.Context, key servicedata.Key) (servicedata.Key, error)
	Upsert(ctx context.Context, serviceData servicedata.ServiceData) (servicedata.ServiceData, error)
	Get(ctx context.Context, filter servicedata.Filter) ([]servicedata.ServiceData, error)
	GetKeyByURN(ctx context.Context, urn string) (servicedata.Key, error)
}

type UserService

type UserService interface {
	Get(ctx context.Context, idOrEmail string) (user.User, error)
	GetByIDs(ctx context.Context, userIDs []string) ([]user.User, error)
	GetByEmail(ctx context.Context, email string) (user.User, error)
	Create(ctx context.Context, user user.User) (user.User, error)
	List(ctx context.Context, flt user.Filter) (user.PagedUsers, error)
	UpdateByID(ctx context.Context, toUpdate user.User) (user.User, error)
	UpdateByEmail(ctx context.Context, toUpdate user.User) (user.User, error)
	FetchCurrentUser(ctx context.Context) (user.User, error)
	CreateMetadataKey(ctx context.Context, key user.UserMetadataKey) (user.UserMetadataKey, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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