Documentation ¶
Index ¶
- Variables
- func Register(ctx context.Context, s *grpc.Server, deps api.Deps, checkAPILimit int) error
- type ActionService
- type GroupService
- type Handler
- func (h Handler) CheckResourcePermission(ctx context.Context, req *shieldv1beta1.CheckResourcePermissionRequest) (*shieldv1beta1.CheckResourcePermissionResponse, error)
- func (h Handler) CreateAction(ctx context.Context, request *shieldv1beta1.CreateActionRequest) (*shieldv1beta1.CreateActionResponse, error)
- func (h Handler) CreateGroup(ctx context.Context, request *shieldv1beta1.CreateGroupRequest) (*shieldv1beta1.CreateGroupResponse, error)
- func (h Handler) CreateMetadataKey(ctx context.Context, request *shieldv1beta1.CreateMetadataKeyRequest) (*shieldv1beta1.CreateMetadataKeyResponse, error)
- func (h Handler) CreateNamespace(ctx context.Context, request *shieldv1beta1.CreateNamespaceRequest) (*shieldv1beta1.CreateNamespaceResponse, error)
- func (h Handler) CreateOrganization(ctx context.Context, request *shieldv1beta1.CreateOrganizationRequest) (*shieldv1beta1.CreateOrganizationResponse, error)
- func (h Handler) CreatePolicy(ctx context.Context, request *shieldv1beta1.CreatePolicyRequest) (*shieldv1beta1.CreatePolicyResponse, error)
- func (h Handler) CreateProject(ctx context.Context, request *shieldv1beta1.CreateProjectRequest) (*shieldv1beta1.CreateProjectResponse, error)
- func (h Handler) CreateRelation(ctx context.Context, request *shieldv1beta1.CreateRelationRequest) (*shieldv1beta1.CreateRelationResponse, error)
- func (h Handler) CreateResource(ctx context.Context, request *shieldv1beta1.CreateResourceRequest) (*shieldv1beta1.CreateResourceResponse, error)
- func (h Handler) CreateRole(ctx context.Context, request *shieldv1beta1.CreateRoleRequest) (*shieldv1beta1.CreateRoleResponse, error)
- func (h Handler) CreateUser(ctx context.Context, request *shieldv1beta1.CreateUserRequest) (*shieldv1beta1.CreateUserResponse, error)
- func (h Handler) DeleteRelation(ctx context.Context, request *shieldv1beta1.DeleteRelationRequest) (*shieldv1beta1.DeleteRelationResponse, error)
- func (h Handler) GetAction(ctx context.Context, request *shieldv1beta1.GetActionRequest) (*shieldv1beta1.GetActionResponse, error)
- func (h Handler) GetCurrentUser(ctx context.Context, request *shieldv1beta1.GetCurrentUserRequest) (*shieldv1beta1.GetCurrentUserResponse, error)
- func (h Handler) GetGroup(ctx context.Context, request *shieldv1beta1.GetGroupRequest) (*shieldv1beta1.GetGroupResponse, error)
- func (h Handler) GetNamespace(ctx context.Context, request *shieldv1beta1.GetNamespaceRequest) (*shieldv1beta1.GetNamespaceResponse, error)
- func (h Handler) GetOrganization(ctx context.Context, request *shieldv1beta1.GetOrganizationRequest) (*shieldv1beta1.GetOrganizationResponse, error)
- func (h Handler) GetPolicy(ctx context.Context, request *shieldv1beta1.GetPolicyRequest) (*shieldv1beta1.GetPolicyResponse, error)
- func (h Handler) GetProject(ctx context.Context, request *shieldv1beta1.GetProjectRequest) (*shieldv1beta1.GetProjectResponse, error)
- func (h Handler) GetRelation(ctx context.Context, request *shieldv1beta1.GetRelationRequest) (*shieldv1beta1.GetRelationResponse, error)
- func (h Handler) GetResource(ctx context.Context, request *shieldv1beta1.GetResourceRequest) (*shieldv1beta1.GetResourceResponse, error)
- func (h Handler) GetRole(ctx context.Context, request *shieldv1beta1.GetRoleRequest) (*shieldv1beta1.GetRoleResponse, error)
- func (h Handler) GetUser(ctx context.Context, request *shieldv1beta1.GetUserRequest) (*shieldv1beta1.GetUserResponse, error)
- func (h Handler) ListActions(ctx context.Context, request *shieldv1beta1.ListActionsRequest) (*shieldv1beta1.ListActionsResponse, error)
- func (h Handler) ListGroupRelations(ctx context.Context, request *shieldv1beta1.ListGroupRelationsRequest) (*shieldv1beta1.ListGroupRelationsResponse, error)
- func (h Handler) ListGroups(ctx context.Context, request *shieldv1beta1.ListGroupsRequest) (*shieldv1beta1.ListGroupsResponse, error)
- func (h Handler) ListNamespaces(ctx context.Context, request *shieldv1beta1.ListNamespacesRequest) (*shieldv1beta1.ListNamespacesResponse, error)
- func (h Handler) ListOrganizationAdmins(ctx context.Context, request *shieldv1beta1.ListOrganizationAdminsRequest) (*shieldv1beta1.ListOrganizationAdminsResponse, error)
- func (h Handler) ListOrganizations(ctx context.Context, request *shieldv1beta1.ListOrganizationsRequest) (*shieldv1beta1.ListOrganizationsResponse, error)
- func (h Handler) ListPolicies(ctx context.Context, request *shieldv1beta1.ListPoliciesRequest) (*shieldv1beta1.ListPoliciesResponse, error)
- func (h Handler) ListProjectAdmins(ctx context.Context, request *shieldv1beta1.ListProjectAdminsRequest) (*shieldv1beta1.ListProjectAdminsResponse, error)
- func (h Handler) ListProjects(ctx context.Context, request *shieldv1beta1.ListProjectsRequest) (*shieldv1beta1.ListProjectsResponse, error)
- func (h Handler) ListRelations(ctx context.Context, request *shieldv1beta1.ListRelationsRequest) (*shieldv1beta1.ListRelationsResponse, error)
- func (h Handler) ListResources(ctx context.Context, request *shieldv1beta1.ListResourcesRequest) (*shieldv1beta1.ListResourcesResponse, error)
- func (h Handler) ListRoles(ctx context.Context, request *shieldv1beta1.ListRolesRequest) (*shieldv1beta1.ListRolesResponse, error)
- func (h Handler) ListUserGroups(ctx context.Context, request *shieldv1beta1.ListUserGroupsRequest) (*shieldv1beta1.ListUserGroupsResponse, error)
- func (h Handler) ListUsers(ctx context.Context, request *shieldv1beta1.ListUsersRequest) (*shieldv1beta1.ListUsersResponse, error)
- func (h Handler) UpdateAction(ctx context.Context, request *shieldv1beta1.UpdateActionRequest) (*shieldv1beta1.UpdateActionResponse, error)
- func (h Handler) UpdateCurrentUser(ctx context.Context, request *shieldv1beta1.UpdateCurrentUserRequest) (*shieldv1beta1.UpdateCurrentUserResponse, error)
- func (h Handler) UpdateGroup(ctx context.Context, request *shieldv1beta1.UpdateGroupRequest) (*shieldv1beta1.UpdateGroupResponse, error)
- func (h Handler) UpdateNamespace(ctx context.Context, request *shieldv1beta1.UpdateNamespaceRequest) (*shieldv1beta1.UpdateNamespaceResponse, error)
- func (h Handler) UpdateOrganization(ctx context.Context, request *shieldv1beta1.UpdateOrganizationRequest) (*shieldv1beta1.UpdateOrganizationResponse, error)
- func (h Handler) UpdatePolicy(ctx context.Context, request *shieldv1beta1.UpdatePolicyRequest) (*shieldv1beta1.UpdatePolicyResponse, error)
- func (h Handler) UpdateProject(ctx context.Context, request *shieldv1beta1.UpdateProjectRequest) (*shieldv1beta1.UpdateProjectResponse, error)
- func (h Handler) UpdateResource(ctx context.Context, request *shieldv1beta1.UpdateResourceRequest) (*shieldv1beta1.UpdateResourceResponse, error)
- func (h Handler) UpdateRole(ctx context.Context, request *shieldv1beta1.UpdateRoleRequest) (*shieldv1beta1.UpdateRoleResponse, error)
- func (h Handler) UpdateUser(ctx context.Context, request *shieldv1beta1.UpdateUserRequest) (*shieldv1beta1.UpdateUserResponse, error)
- type NamespaceService
- type OrganizationService
- type PolicyService
- type ProjectService
- type RelationService
- type ResourceService
- type RoleService
- type RuleService
- type UserService
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 ¶
Types ¶
type ActionService ¶
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) CheckResourcePermission ¶
func (h Handler) CheckResourcePermission(ctx context.Context, req *shieldv1beta1.CheckResourcePermissionRequest) (*shieldv1beta1.CheckResourcePermissionResponse, error)
func (Handler) CreateAction ¶
func (h Handler) CreateAction(ctx context.Context, request *shieldv1beta1.CreateActionRequest) (*shieldv1beta1.CreateActionResponse, error)
func (Handler) CreateGroup ¶
func (h Handler) CreateGroup(ctx context.Context, request *shieldv1beta1.CreateGroupRequest) (*shieldv1beta1.CreateGroupResponse, error)
func (Handler) CreateMetadataKey ¶
func (h Handler) CreateMetadataKey(ctx context.Context, request *shieldv1beta1.CreateMetadataKeyRequest) (*shieldv1beta1.CreateMetadataKeyResponse, error)
func (Handler) CreateNamespace ¶
func (h Handler) CreateNamespace(ctx context.Context, request *shieldv1beta1.CreateNamespaceRequest) (*shieldv1beta1.CreateNamespaceResponse, error)
func (Handler) CreateOrganization ¶
func (h Handler) CreateOrganization(ctx context.Context, request *shieldv1beta1.CreateOrganizationRequest) (*shieldv1beta1.CreateOrganizationResponse, error)
func (Handler) CreatePolicy ¶
func (h Handler) CreatePolicy(ctx context.Context, request *shieldv1beta1.CreatePolicyRequest) (*shieldv1beta1.CreatePolicyResponse, error)
func (Handler) CreateProject ¶
func (h Handler) CreateProject( ctx context.Context, request *shieldv1beta1.CreateProjectRequest, ) (*shieldv1beta1.CreateProjectResponse, error)
func (Handler) CreateRelation ¶
func (h Handler) CreateRelation(ctx context.Context, request *shieldv1beta1.CreateRelationRequest) (*shieldv1beta1.CreateRelationResponse, error)
func (Handler) CreateResource ¶
func (h Handler) CreateResource(ctx context.Context, request *shieldv1beta1.CreateResourceRequest) (*shieldv1beta1.CreateResourceResponse, error)
func (Handler) CreateRole ¶
func (h Handler) CreateRole(ctx context.Context, request *shieldv1beta1.CreateRoleRequest) (*shieldv1beta1.CreateRoleResponse, error)
func (Handler) CreateUser ¶
func (h Handler) CreateUser(ctx context.Context, request *shieldv1beta1.CreateUserRequest) (*shieldv1beta1.CreateUserResponse, error)
func (Handler) DeleteRelation ¶
func (h Handler) DeleteRelation(ctx context.Context, request *shieldv1beta1.DeleteRelationRequest) (*shieldv1beta1.DeleteRelationResponse, error)
func (Handler) GetAction ¶
func (h Handler) GetAction(ctx context.Context, request *shieldv1beta1.GetActionRequest) (*shieldv1beta1.GetActionResponse, error)
func (Handler) GetCurrentUser ¶
func (h Handler) GetCurrentUser(ctx context.Context, request *shieldv1beta1.GetCurrentUserRequest) (*shieldv1beta1.GetCurrentUserResponse, error)
func (Handler) GetGroup ¶
func (h Handler) GetGroup(ctx context.Context, request *shieldv1beta1.GetGroupRequest) (*shieldv1beta1.GetGroupResponse, error)
func (Handler) GetNamespace ¶
func (h Handler) GetNamespace(ctx context.Context, request *shieldv1beta1.GetNamespaceRequest) (*shieldv1beta1.GetNamespaceResponse, error)
func (Handler) GetOrganization ¶
func (h Handler) GetOrganization(ctx context.Context, request *shieldv1beta1.GetOrganizationRequest) (*shieldv1beta1.GetOrganizationResponse, error)
func (Handler) GetPolicy ¶
func (h Handler) GetPolicy(ctx context.Context, request *shieldv1beta1.GetPolicyRequest) (*shieldv1beta1.GetPolicyResponse, error)
func (Handler) GetProject ¶
func (h Handler) GetProject( ctx context.Context, request *shieldv1beta1.GetProjectRequest, ) (*shieldv1beta1.GetProjectResponse, error)
func (Handler) GetRelation ¶
func (h Handler) GetRelation(ctx context.Context, request *shieldv1beta1.GetRelationRequest) (*shieldv1beta1.GetRelationResponse, error)
func (Handler) GetResource ¶
func (h Handler) GetResource(ctx context.Context, request *shieldv1beta1.GetResourceRequest) (*shieldv1beta1.GetResourceResponse, error)
func (Handler) GetRole ¶
func (h Handler) GetRole(ctx context.Context, request *shieldv1beta1.GetRoleRequest) (*shieldv1beta1.GetRoleResponse, error)
func (Handler) GetUser ¶
func (h Handler) GetUser(ctx context.Context, request *shieldv1beta1.GetUserRequest) (*shieldv1beta1.GetUserResponse, error)
func (Handler) ListActions ¶
func (h Handler) ListActions(ctx context.Context, request *shieldv1beta1.ListActionsRequest) (*shieldv1beta1.ListActionsResponse, error)
func (Handler) ListGroupRelations ¶
func (h Handler) ListGroupRelations(ctx context.Context, request *shieldv1beta1.ListGroupRelationsRequest) (*shieldv1beta1.ListGroupRelationsResponse, error)
func (Handler) ListGroups ¶
func (h Handler) ListGroups(ctx context.Context, request *shieldv1beta1.ListGroupsRequest) (*shieldv1beta1.ListGroupsResponse, error)
func (Handler) ListNamespaces ¶
func (h Handler) ListNamespaces(ctx context.Context, request *shieldv1beta1.ListNamespacesRequest) (*shieldv1beta1.ListNamespacesResponse, error)
func (Handler) ListOrganizationAdmins ¶
func (h Handler) ListOrganizationAdmins(ctx context.Context, request *shieldv1beta1.ListOrganizationAdminsRequest) (*shieldv1beta1.ListOrganizationAdminsResponse, error)
func (Handler) ListOrganizations ¶
func (h Handler) ListOrganizations(ctx context.Context, request *shieldv1beta1.ListOrganizationsRequest) (*shieldv1beta1.ListOrganizationsResponse, error)
func (Handler) ListPolicies ¶
func (h Handler) ListPolicies(ctx context.Context, request *shieldv1beta1.ListPoliciesRequest) (*shieldv1beta1.ListPoliciesResponse, error)
func (Handler) ListProjectAdmins ¶
func (h Handler) ListProjectAdmins( ctx context.Context, request *shieldv1beta1.ListProjectAdminsRequest, ) (*shieldv1beta1.ListProjectAdminsResponse, error)
func (Handler) ListProjects ¶
func (h Handler) ListProjects( ctx context.Context, request *shieldv1beta1.ListProjectsRequest, ) (*shieldv1beta1.ListProjectsResponse, error)
func (Handler) ListRelations ¶
func (h Handler) ListRelations(ctx context.Context, request *shieldv1beta1.ListRelationsRequest) (*shieldv1beta1.ListRelationsResponse, error)
func (Handler) ListResources ¶
func (h Handler) ListResources(ctx context.Context, request *shieldv1beta1.ListResourcesRequest) (*shieldv1beta1.ListResourcesResponse, error)
func (Handler) ListRoles ¶
func (h Handler) ListRoles(ctx context.Context, request *shieldv1beta1.ListRolesRequest) (*shieldv1beta1.ListRolesResponse, error)
func (Handler) ListUserGroups ¶
func (h Handler) ListUserGroups(ctx context.Context, request *shieldv1beta1.ListUserGroupsRequest) (*shieldv1beta1.ListUserGroupsResponse, error)
func (Handler) ListUsers ¶
func (h Handler) ListUsers(ctx context.Context, request *shieldv1beta1.ListUsersRequest) (*shieldv1beta1.ListUsersResponse, error)
func (Handler) UpdateAction ¶
func (h Handler) UpdateAction(ctx context.Context, request *shieldv1beta1.UpdateActionRequest) (*shieldv1beta1.UpdateActionResponse, error)
func (Handler) UpdateCurrentUser ¶
func (h Handler) UpdateCurrentUser(ctx context.Context, request *shieldv1beta1.UpdateCurrentUserRequest) (*shieldv1beta1.UpdateCurrentUserResponse, error)
func (Handler) UpdateGroup ¶
func (h Handler) UpdateGroup(ctx context.Context, request *shieldv1beta1.UpdateGroupRequest) (*shieldv1beta1.UpdateGroupResponse, error)
func (Handler) UpdateNamespace ¶
func (h Handler) UpdateNamespace(ctx context.Context, request *shieldv1beta1.UpdateNamespaceRequest) (*shieldv1beta1.UpdateNamespaceResponse, error)
func (Handler) UpdateOrganization ¶
func (h Handler) UpdateOrganization(ctx context.Context, request *shieldv1beta1.UpdateOrganizationRequest) (*shieldv1beta1.UpdateOrganizationResponse, error)
func (Handler) UpdatePolicy ¶
func (h Handler) UpdatePolicy(ctx context.Context, request *shieldv1beta1.UpdatePolicyRequest) (*shieldv1beta1.UpdatePolicyResponse, error)
func (Handler) UpdateProject ¶
func (h Handler) UpdateProject( ctx context.Context, request *shieldv1beta1.UpdateProjectRequest, ) (*shieldv1beta1.UpdateProjectResponse, error)
func (Handler) UpdateResource ¶
func (h Handler) UpdateResource(ctx context.Context, request *shieldv1beta1.UpdateResourceRequest) (*shieldv1beta1.UpdateResourceResponse, error)
func (Handler) UpdateRole ¶
func (h Handler) UpdateRole(ctx context.Context, request *shieldv1beta1.UpdateRoleRequest) (*shieldv1beta1.UpdateRoleResponse, error)
func (Handler) UpdateUser ¶
func (h Handler) UpdateUser(ctx context.Context, request *shieldv1beta1.UpdateUserRequest) (*shieldv1beta1.UpdateUserResponse, error)
type NamespaceService ¶
type NamespaceService interface { Get(ctx context.Context, id string) (namespace.Namespace, error) List(ctx context.Context) ([]namespace.Namespace, error) Create(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error) Update(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error) }
type OrganizationService ¶
type OrganizationService interface { Get(ctx context.Context, idOrSlug string) (organization.Organization, error) Create(ctx context.Context, org organization.Organization) (organization.Organization, error) List(ctx context.Context) ([]organization.Organization, error) Update(ctx context.Context, toUpdate organization.Organization) (organization.Organization, error) ListAdmins(ctx context.Context, id string) ([]user.User, error) }
type PolicyService ¶
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 ResourceService ¶
type ResourceService interface { Get(ctx context.Context, id string) (resource.Resource, error) List(ctx context.Context, flt resource.Filter) ([]resource.Resource, 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 RuleService ¶
type UserService ¶
type UserService interface { GetByID(ctx context.Context, id 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) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.