Documentation
¶
Index ¶
- Variables
- func AllowGlobalScope(ctx context.Context, endpoint string, operation openapi.AclOperation) error
- func AllowOrganizationScope(ctx context.Context, endpoint string, operation openapi.AclOperation, ...) error
- func AllowProjectScope(ctx context.Context, endpoint string, operation openapi.AclOperation, ...) error
- func AllowRole(ctx context.Context, role *unikornv1.Role, organizationID string) error
- func FromContext(ctx context.Context) *openapi.Acl
- func NewContext(ctx context.Context, acl *openapi.Acl) context.Context
- type Options
- type RBAC
- func (r *RBAC) GetACL(ctx context.Context, organizationID string) (*openapi.Acl, error)
- func (r *RBAC) GetActiveOrganizationUser(ctx context.Context, organizationID string, user *unikornv1.User) (*unikornv1.OrganizationUser, error)
- func (r *RBAC) GetActiveUser(ctx context.Context, subject string) (*unikornv1.User, error)
- func (r *RBAC) GetServiceAccount(ctx context.Context, id string) (*unikornv1.ServiceAccount, error)
- func (r *RBAC) UserExists(ctx context.Context, subject string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrResourceReference = errors.New("resource reference error")
)
Functions ¶
func AllowGlobalScope ¶ added in v0.2.20
AllowGlobalScope tries to allow the requested operation at the global scope.
func AllowOrganizationScope ¶ added in v0.2.20
func AllowOrganizationScope(ctx context.Context, endpoint string, operation openapi.AclOperation, organizationID string) error
AllowOrganizationScope tries to allow the requested operation at the global scope, then the organization scope.
func AllowProjectScope ¶ added in v0.2.20
func AllowProjectScope(ctx context.Context, endpoint string, operation openapi.AclOperation, organizationID, projectID string) error
AllowProjectScope tries to allow the requested operation at the global scope, then the organization scope, and finally at the project scope.
Types ¶
type Options ¶ added in v0.2.54
type RBAC ¶
type RBAC struct {
// contains filtered or unexported fields
}
RBAC contains all the scoping rules for services across the platform.
func (*RBAC) GetACL ¶ added in v0.1.23
GetACL returns a granular set of permissions for a user based on their scope. This is used for API level access control and UX.
func (*RBAC) GetActiveOrganizationUser ¶
func (r *RBAC) GetActiveOrganizationUser(ctx context.Context, organizationID string, user *unikornv1.User) (*unikornv1.OrganizationUser, error)
GetActiveOrganizationUser gets an organization user that references the actual user.
func (*RBAC) GetActiveUser ¶
GetActiveUser returns a user that match the subject and is active.
func (*RBAC) GetServiceAccount ¶ added in v0.2.53
GetServiceAccount looks up a service account.