Documentation ¶
Index ¶
- Variables
- func DeleteWorkspaceTemplates(ctx context.Context, workspaceID int) error
- func TemplateByName(ctx context.Context, name string) (model.Template, error)
- func UnmarshalTemplateConfig(ctx context.Context, name string, user *model.User, out interface{}, ...) error
- type TemplateAPIServer
- func (a *TemplateAPIServer) DeleteTemplate(ctx context.Context, req *apiv1.DeleteTemplateRequest) (*apiv1.DeleteTemplateResponse, error)
- func (a *TemplateAPIServer) GetTemplate(ctx context.Context, req *apiv1.GetTemplateRequest) (*apiv1.GetTemplateResponse, error)
- func (a *TemplateAPIServer) GetTemplates(ctx context.Context, req *apiv1.GetTemplatesRequest) (*apiv1.GetTemplatesResponse, error)
- func (a *TemplateAPIServer) PatchTemplateConfig(ctx context.Context, req *apiv1.PatchTemplateConfigRequest) (*apiv1.PatchTemplateConfigResponse, error)
- func (a *TemplateAPIServer) PostTemplate(ctx context.Context, req *apiv1.PostTemplateRequest) (*apiv1.PostTemplateResponse, error)
- func (a *TemplateAPIServer) PutTemplate(ctx context.Context, req *apiv1.PutTemplateRequest) (*apiv1.PutTemplateResponse, error)
- type TemplateAuthZ
- type TemplateAuthZBasic
- func (a *TemplateAuthZBasic) CanCreateTemplate(ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID) (permErr error, err error)
- func (a *TemplateAuthZBasic) CanDeleteTemplate(ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID) (permErr error, err error)
- func (a *TemplateAuthZBasic) CanUpdateTemplate(ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID) (permErr error, err error)
- func (a *TemplateAuthZBasic) CanViewTemplate(ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID) (permErr error, err error)
- func (a *TemplateAuthZBasic) ViewableScopes(ctx context.Context, curUser *model.User, requestedScope model.AccessScopeID) (model.AccessScopeSet, error)
Constants ¶
This section is empty.
Variables ¶
var AuthZProvider authz.AuthZProviderType[TemplateAuthZ]
AuthZProvider is the authz registry for Notebooks, Shells, and Commands.
Functions ¶
func DeleteWorkspaceTemplates ¶
DeleteWorkspaceTemplates deletes all the templates in a workspace.
func TemplateByName ¶
TemplateByName looks up a config template by name in a database.
Types ¶
type TemplateAPIServer ¶
type TemplateAPIServer struct{}
TemplateAPIServer implements the template APIs for Determined's API server.
func (*TemplateAPIServer) DeleteTemplate ¶
func (a *TemplateAPIServer) DeleteTemplate( ctx context.Context, req *apiv1.DeleteTemplateRequest, ) (*apiv1.DeleteTemplateResponse, error)
DeleteTemplate a template by name. Returns an error if the template does not exist.
func (*TemplateAPIServer) GetTemplate ¶
func (a *TemplateAPIServer) GetTemplate( ctx context.Context, req *apiv1.GetTemplateRequest, ) (*apiv1.GetTemplateResponse, error)
GetTemplate by name. Returns an error if the requested template does not exist.
func (*TemplateAPIServer) GetTemplates ¶
func (a *TemplateAPIServer) GetTemplates( ctx context.Context, req *apiv1.GetTemplatesRequest, ) (*apiv1.GetTemplatesResponse, error)
GetTemplates viewable by the user. If there are no matches, returns an empty list.
func (*TemplateAPIServer) PatchTemplateConfig ¶
func (a *TemplateAPIServer) PatchTemplateConfig( ctx context.Context, req *apiv1.PatchTemplateConfigRequest, ) (*apiv1.PatchTemplateConfigResponse, error)
PatchTemplateConfig does a full update of the requested template's config.
func (*TemplateAPIServer) PostTemplate ¶
func (a *TemplateAPIServer) PostTemplate( ctx context.Context, req *apiv1.PostTemplateRequest, ) (*apiv1.PostTemplateResponse, error)
PostTemplate creates a template. If a template with the same name exists, an error is returned.
func (*TemplateAPIServer) PutTemplate ¶
func (a *TemplateAPIServer) PutTemplate( ctx context.Context, req *apiv1.PutTemplateRequest, ) (*apiv1.PutTemplateResponse, error)
PutTemplate creates or updates a template.
type TemplateAuthZ ¶
type TemplateAuthZ interface { // ViewableScopes returns the set of scopes that the user can view templates in. ViewableScopes( ctx context.Context, curUser *model.User, requestedScope model.AccessScopeID, ) (model.AccessScopeSet, error) // CanCreateTemplate checks if the user can create a template. CanCreateTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error) // CanViewTemplate checks if the user can view a template. CanViewTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error) // CanUpdateTemplate checks if the user can update a template. CanUpdateTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error) // CanDeleteTemplate checks if the user can delete a template. CanDeleteTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error) }
TemplateAuthZ describes authz methods for template actions.
type TemplateAuthZBasic ¶
type TemplateAuthZBasic struct{}
TemplateAuthZBasic is basic OSS controls.
func (*TemplateAuthZBasic) CanCreateTemplate ¶
func (a *TemplateAuthZBasic) CanCreateTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error)
CanCreateTemplate implements the TemplateAuthZ interface.
func (*TemplateAuthZBasic) CanDeleteTemplate ¶
func (a *TemplateAuthZBasic) CanDeleteTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error)
CanDeleteTemplate implements the TemplateAuthZ interface.
func (*TemplateAuthZBasic) CanUpdateTemplate ¶
func (a *TemplateAuthZBasic) CanUpdateTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error)
CanUpdateTemplate implements the TemplateAuthZ interface.
func (*TemplateAuthZBasic) CanViewTemplate ¶
func (a *TemplateAuthZBasic) CanViewTemplate( ctx context.Context, curUser *model.User, workspaceID model.AccessScopeID, ) (permErr error, err error)
CanViewTemplate implements the TemplateAuthZ interface.
func (*TemplateAuthZBasic) ViewableScopes ¶
func (a *TemplateAuthZBasic) ViewableScopes( ctx context.Context, curUser *model.User, requestedScope model.AccessScopeID, ) (model.AccessScopeSet, error)
ViewableScopes implements the TemplateAuthZ interface.