v1beta1

package
v0.6.17 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 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) error

Types

type ActionService

type ActionService interface {
	Get(ctx context.Context, id string) (action.Action, error)
	List(ctx context.Context) ([]action.Action, error)
	Create(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

type Handler struct {
	shieldv1beta1.UnimplementedShieldServiceServer
	// contains filtered or unexported fields
}

func (Handler) GetAction

func (Handler) GetGroup

func (Handler) GetPolicy

func (Handler) GetProject

func (Handler) GetRole

func (Handler) GetUser

func (Handler) ListActivities added in v0.6.17

func (Handler) ListProjects

func (Handler) ListRoles

func (Handler) ListUsers

type PolicyService

type PolicyService interface {
	Get(ctx context.Context, id string) (policy.Policy, error)
	List(ctx context.Context) ([]policy.Policy, error)
	Create(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)
}

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)
	Create(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)
}

type RoleService

type RoleService interface {
	Get(ctx context.Context, id string) (role.Role, error)
	Create(ctx context.Context, toCreate 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 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