Documentation
¶
Index ¶
- func BuildAPIDependsOn(space *model.Space) []string
- func BuildAPIShares(space *model.Space) []string
- func CheckTemplateAccess(templateId string, user *model.User) error
- func FileStorageAllowed(next http.HandlerFunc) http.HandlerFunc
- func GetAccessibleSpace(spaceId string, user *model.User) (*model.Space, error)
- func GetLatestSpaceResourceUsage(spaceId string) *apiclient.SpaceResourceUsage
- func GetSpaceDetails(spaceId string, user *model.User) (*apiclient.SpaceDefinition, error)
- func GetTemplateDetails(templateId string, user *model.User) (*apiclient.TemplateDetails, error)
- func RequestSpace(r *http.Request) *model.Space
- func RequestSpaceTemplate(r *http.Request) *model.Template
- type ApiUtilsUsers
- func (auu *ApiUtilsUsers) DeleteUser(toDelete *model.User) error
- func (auu *ApiUtilsUsers) RemoveUsersSessions(user *model.User)
- func (auu *ApiUtilsUsers) RemoveUsersTokens(user *model.User)
- func (auu *ApiUtilsUsers) UpdateSpaceSSHKeys(space *model.Space, user *model.User)
- func (auu *ApiUtilsUsers) UpdateSpacesSSHKey(user *model.User)
- func (auu *ApiUtilsUsers) UpdateUserSpaces(user *model.User)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAPIDependsOn ¶ added in v0.24.0
func BuildAPIShares ¶ added in v0.24.0
func CheckTemplateAccess ¶ added in v0.33.0
CheckTemplateAccess enforces the same visibility as the template read path: template managers see everything; everyone else only templates returned by their permission-filtered, zone-restricted list. Callers map the error to a 404 so template existence isn't leaked.
func FileStorageAllowed ¶ added in v0.39.0
func FileStorageAllowed(next http.HandlerFunc) http.HandlerFunc
FileStorageAllowed refuses file storage requests from spaces whose template switches file storage off, or that have switched it off themselves.
func GetAccessibleSpace ¶ added in v0.24.2
func GetLatestSpaceResourceUsage ¶ added in v0.24.2
func GetLatestSpaceResourceUsage(spaceId string) *apiclient.SpaceResourceUsage
func GetSpaceDetails ¶ added in v0.19.0
GetSpaceDetails returns detailed space information with permission checks
func GetTemplateDetails ¶ added in v0.19.0
GetTemplateDetails returns detailed template information with permission checks
func RequestSpace ¶ added in v0.40.0
RequestSpace returns the space a request comes from, or nil when the request isn't from a space (only the agent's token carries one) or the space can't be found. It is read on every call, so restrictions the space applies to itself take effect straight away.
func RequestSpaceTemplate ¶ added in v0.39.0
RequestSpaceTemplate returns the template of the space a request comes from, or nil when the request isn't from a space or the template can't be found. It is read on every call, so changing a template's settings applies to its spaces straight away.
Types ¶
type ApiUtilsUsers ¶
type ApiUtilsUsers struct {
}
func NewApiUtilsUsers ¶
func NewApiUtilsUsers() *ApiUtilsUsers
func (*ApiUtilsUsers) DeleteUser ¶
func (auu *ApiUtilsUsers) DeleteUser(toDelete *model.User) error
func (*ApiUtilsUsers) RemoveUsersSessions ¶
func (auu *ApiUtilsUsers) RemoveUsersSessions(user *model.User)
Delete the sessions owned by a user
func (*ApiUtilsUsers) RemoveUsersTokens ¶
func (auu *ApiUtilsUsers) RemoveUsersTokens(user *model.User)
Delete the tokens owned by a user
func (*ApiUtilsUsers) UpdateSpaceSSHKeys ¶
func (auu *ApiUtilsUsers) UpdateSpaceSSHKeys(space *model.Space, user *model.User)
func (*ApiUtilsUsers) UpdateSpacesSSHKey ¶
func (auu *ApiUtilsUsers) UpdateSpacesSSHKey(user *model.User)
func (*ApiUtilsUsers) UpdateUserSpaces ¶
func (auu *ApiUtilsUsers) UpdateUserSpaces(user *model.User)
For disabled users ensure all spaces are stopped, for enabled users update the SSH key on the agents