Documentation ¶
Index ¶
- Constants
- Variables
- type ActivityService
- type Filter
- type GroupService
- type LogData
- type NamespaceService
- type OrganizationService
- type PagedResources
- type PolicyService
- type ProjectService
- type RelationService
- type Repository
- type Resource
- type ResourcePermissions
- type SchemaService
- type Service
- func (s Service) AddOrgToResource(ctx context.Context, org organization.Organization, res Resource) error
- func (s Service) AddProjectToResource(ctx context.Context, project project.Project, res Resource) error
- func (s Service) BulkCheckAuthz(ctx context.Context, resources []Resource, actions []action.Action) ([]relation.Permission, error)
- func (s Service) CheckAuthz(ctx context.Context, res Resource, act action.Action) (bool, error)
- func (s Service) Create(ctx context.Context, res Resource) (Resource, error)
- func (s Service) Get(ctx context.Context, id string) (Resource, error)
- func (s Service) GetByURN(ctx context.Context, id string) (Resource, error)
- func (s Service) List(ctx context.Context, flt Filter) (PagedResources, error)
- func (s Service) ListAllUserResources(ctx context.Context, userID string, resourceTypes []string, ...) (map[string]ResourcePermissions, error)
- func (s Service) ListUserResourcesByType(ctx context.Context, userID string, resourceType string, permissions []string) (ResourcePermissions, error)
- func (s Service) Update(ctx context.Context, id string, resource Resource) (Resource, error)
- func (s Service) Upsert(ctx context.Context, res Resource) (Resource, error)
- func (s Service) UpsertConfig(ctx context.Context, name string, config string) (schema.Config, error)
- type UserService
- type YAML
Constants ¶
View Source
const ( NON_RESOURCE_ID = "*" AuditEntity = "resource" )
Variables ¶
View Source
var ( ErrNotExist = errors.New("resource doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("resource id is invalid") ErrInvalidURN = errors.New("resource urn is invalid") ErrConflict = errors.New("resource already exist") ErrInvalidDetail = errors.New("invalid resource detail") ErrLogActivity = errors.New("error while logging activity") ErrUpsertConfigNotSupported = errors.New("upsert resource config is currently not supported") ErrMarshal = errors.New("error while marshalling resource config") )
Functions ¶
This section is empty.
Types ¶
type ActivityService ¶ added in v0.6.15
type GroupService ¶ added in v0.6.13
type LogData ¶ added in v0.6.25
type LogData struct { Entity string `mapstructure:"entity"` URN string `mapstructure:"urn"` Name string `mapstructure:"name"` OrganizationID string `mapstructure:"organization_id"` ProjectID string `mapstructure:"project_id"` NamespaceID string `mapstructure:"namespace_id"` UserID string `mapstructure:"user_id"` }
type NamespaceService ¶ added in v0.6.33
type OrganizationService ¶ added in v0.6.13
type OrganizationService interface {
Get(ctx context.Context, id string) (organization.Organization, error)
}
type PagedResources ¶ added in v0.6.14
type PolicyService ¶ added in v0.6.33
type ProjectService ¶
type RelationService ¶
type RelationService interface { Create(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error) Delete(ctx context.Context, rel relation.Relation) error CheckPermission(ctx context.Context, usr user.User, resourceNS namespace.Namespace, resourceIdxa string, action action.Action) (bool, error) BulkCheckPermission(ctx context.Context, rels []relation.Relation, acts []action.Action) ([]relation.Permission, error) DeleteSubjectRelations(ctx context.Context, resourceType, optionalResourceID string) error LookupResources(ctx context.Context, resourceType, permission, subjectType, subjectID string) ([]string, error) }
type Repository ¶
type Repository interface { GetByID(ctx context.Context, id string) (Resource, error) GetByURN(ctx context.Context, urn string) (Resource, error) Upsert(ctx context.Context, resource Resource) (Resource, error) Create(ctx context.Context, resource Resource) (Resource, error) List(ctx context.Context, flt Filter) ([]Resource, error) Update(ctx context.Context, id string, resource Resource) (Resource, error) GetByNamespace(ctx context.Context, name string, ns string) (Resource, error) }
type Resource ¶
type ResourcePermissions ¶ added in v0.6.33
type SchemaService ¶ added in v0.6.34
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger log.Logger, repository Repository, relationService RelationService, userService UserService, projectService ProjectService, organizationService OrganizationService, groupService GroupService, policyService PolicyService, namespaceService NamespaceService, schemaService SchemaService, activityService ActivityService) *Service
func (Service) AddOrgToResource ¶
func (s Service) AddOrgToResource(ctx context.Context, org organization.Organization, res Resource) error
func (Service) AddProjectToResource ¶
func (Service) BulkCheckAuthz ¶ added in v0.6.30
func (Service) CheckAuthz ¶
TODO(krkvrm): Separate Authz for Resources & System Namespaces
func (Service) ListAllUserResources ¶ added in v0.6.33
func (Service) ListUserResourcesByType ¶ added in v0.6.33
type UserService ¶
Click to show internal directories.
Click to hide internal directories.