server

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVolumeName = "default-volume"

Variables

View Source
var StandardNamespaceFilter = database.NamespaceFilter{
	NotDeleted: true,
}

Functions

func AddOwnerLogin

func AddOwnerLogin(ctx context.Context, r *model.Resource, client clients.UserManagerClient) error

func AddUserLogins

func AddUserLogins(ctx context.Context, permissions []model.Permission, client clients.UserManagerClient) error

func CheckTariff

func CheckTariff(tariff billing.Tariff, isAdmin bool) error

CheckTariff checks if user has permissions to use tariff

func IsAdminRole

func IsAdminRole(ctx context.Context) bool

IsAdminRole checks that request came from user with admin permissions.

func NamespaceAddUsage

func NamespaceAddUsage(ctx context.Context, ns *kubeClientModel.Namespace, client clients.KubeAPIClient) error

func OwnerCheck

func OwnerCheck(ctx context.Context, resource model.Resource) error

func UserGroupAccessToDBAccess added in v1.0.2

func UserGroupAccessToDBAccess(access kubeClientModel.UserGroupAccess) kubeClientModel.AccessLevel

Types

type AccessActions

type AccessActions interface {
	GetUserAccesses(ctx context.Context) (*authProto.ResourcesAccess, error)
	SetUserAccesses(ctx context.Context, accessLevel kubeClientModel.AccessLevel) error
	GetNamespaceAccess(ctx context.Context, id string) (kubeClientModel.Namespace, error)
	SetNamespaceAccess(ctx context.Context, id, targetUser string, accessLevel kubeClientModel.AccessLevel) error
	DeleteNamespaceAccess(ctx context.Context, id string, targetUser string) error
}

type Clients

func (*Clients) Close

func (c *Clients) Close() error

type NamespaceActions

type NamespaceActions interface {
	CreateNamespace(ctx context.Context, req model.NamespaceCreateRequest) error
	GetNamespace(ctx context.Context, id string) (kubeClientModel.Namespace, error)
	GetUserNamespaces(ctx context.Context, filters ...string) ([]kubeClientModel.Namespace, error)
	GetAllNamespaces(ctx context.Context, page, perPage int, filters ...string) ([]kubeClientModel.Namespace, error)
	AdminCreateNamespace(ctx context.Context, req model.NamespaceAdminCreateRequest) error
	AdminResizeNamespace(ctx context.Context, id string, req model.NamespaceAdminResizeRequest) error
	RenameNamespace(ctx context.Context, id, newLabel string) error
	ResizeNamespace(ctx context.Context, id, newTariffID string) error
	DeleteNamespace(ctx context.Context, id string) error
	DeleteAllUserNamespaces(ctx context.Context) error
	AddGroupNamespace(ctx context.Context, namespace, groupID string) error
	SetGroupMemberNamespaceAccess(ctx context.Context, namespace, groupID string, req model.SetGroupMemberAccessRequest) error
	GetNamespaceGroups(ctx context.Context, projectID string) ([]kubeClientModel.UserGroup, error)
	DeleteGroupFromNamespace(ctx context.Context, namespace, groupID string) error
	GetGroupsNamespaces(ctx context.Context, groupID string) ([]kubeClientModel.Namespace, error)
	ImportNamespaces(ctx context.Context, req kubeClientModel.NamespacesList) kubeClientModel.ImportResponse
}

type ProjectActions added in v1.0.2

type ProjectActions interface {
	CreateProject(ctx context.Context, label string) error
	AddGroup(ctx context.Context, project, groupID string) error
	GetProjectGroups(ctx context.Context, projectID string) ([]kubeClientModel.UserGroup, error)
	SetGroupMemberAccess(ctx context.Context, projectID, groupID string, req model.SetGroupMemberAccessRequest) error
	DeleteGroupFromProject(ctx context.Context, projectID, groupID string) error
	AddMemberToProject(ctx context.Context, projectID string, req model.AddMemberToProjectRequest) error
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(db database.DB, clients *Clients) *Server

func (*Server) AddGroup added in v1.0.2

func (s *Server) AddGroup(ctx context.Context, project, groupID string) error

func (*Server) AddGroupNamespace added in v1.0.2

func (s *Server) AddGroupNamespace(ctx context.Context, namespace, groupID string) error

func (*Server) AddMemberToProject added in v1.0.2

func (s *Server) AddMemberToProject(ctx context.Context, projectID string, req model.AddMemberToProjectRequest) error

func (*Server) AdminCreateNamespace

func (s *Server) AdminCreateNamespace(ctx context.Context, req model.NamespaceAdminCreateRequest) error

func (*Server) AdminResizeNamespace

func (s *Server) AdminResizeNamespace(ctx context.Context, name string, req model.NamespaceAdminResizeRequest) error

func (*Server) Close

func (s *Server) Close() error

func (*Server) CreateNamespace

func (s *Server) CreateNamespace(ctx context.Context, req model.NamespaceCreateRequest) error

func (*Server) CreateProject added in v1.0.2

func (s *Server) CreateProject(ctx context.Context, label string) error

func (*Server) DeleteAllUserNamespaces

func (s *Server) DeleteAllUserNamespaces(ctx context.Context) error

func (*Server) DeleteGroupFromNamespace added in v1.0.2

func (s *Server) DeleteGroupFromNamespace(ctx context.Context, namespace, groupID string) error

func (*Server) DeleteGroupFromProject added in v1.0.2

func (s *Server) DeleteGroupFromProject(ctx context.Context, projectID, groupID string) error

func (*Server) DeleteNamespace

func (s *Server) DeleteNamespace(ctx context.Context, name string) error

func (*Server) DeleteNamespaceAccess

func (s *Server) DeleteNamespaceAccess(ctx context.Context, id string, targetUser string) error

func (*Server) GetAllNamespaces

func (s *Server) GetAllNamespaces(ctx context.Context, page, perPage int, filters ...string) ([]kubeClientModel.Namespace, error)

func (*Server) GetGroupsNamespaces added in v1.0.2

func (s *Server) GetGroupsNamespaces(ctx context.Context, groupID string) ([]kubeClientModel.Namespace, error)

func (*Server) GetNamespace

func (s *Server) GetNamespace(ctx context.Context, name string) (kubeClientModel.Namespace, error)

func (*Server) GetNamespaceAccess

func (s *Server) GetNamespaceAccess(ctx context.Context, id string) (kubeClientModel.Namespace, error)

func (*Server) GetNamespaceGroups added in v1.0.2

func (s *Server) GetNamespaceGroups(ctx context.Context, namespace string) ([]kubeClientModel.UserGroup, error)

func (*Server) GetProjectGroups added in v1.0.2

func (s *Server) GetProjectGroups(ctx context.Context, projectID string) ([]kubeClientModel.UserGroup, error)

func (*Server) GetUserAccesses

func (s *Server) GetUserAccesses(ctx context.Context) (*authProto.ResourcesAccess, error)

func (*Server) GetUserNamespaces

func (s *Server) GetUserNamespaces(ctx context.Context, filters ...string) ([]kubeClientModel.Namespace, error)

func (*Server) ImportNamespaces added in v1.0.3

func (*Server) RenameNamespace

func (s *Server) RenameNamespace(ctx context.Context, id, newLabel string) error

func (*Server) ResizeNamespace

func (s *Server) ResizeNamespace(ctx context.Context, id, newTariffID string) error

func (*Server) SetGroupMemberAccess added in v1.0.2

func (s *Server) SetGroupMemberAccess(ctx context.Context, projectID, groupID string, req model.SetGroupMemberAccessRequest) error

func (*Server) SetGroupMemberNamespaceAccess added in v1.0.2

func (s *Server) SetGroupMemberNamespaceAccess(ctx context.Context, namespace, groupID string, req model.SetGroupMemberAccessRequest) error

func (*Server) SetNamespaceAccess

func (s *Server) SetNamespaceAccess(ctx context.Context, id, targetUser string, accessLevel kubeClientModel.AccessLevel) error

func (*Server) SetUserAccesses

func (s *Server) SetUserAccesses(ctx context.Context, access kubeClientModel.AccessLevel) error

Jump to

Keyboard shortcuts

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