Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountWorkspaceHandlers ¶
MountWorkspaceHandlers initialises the workspace schema, registers workspace permission scopes with apikit (via MountHandlers), and mounts workspace API handlers on the server's API group.
This is the single entry point for wiring up workspace support in af-hub. It calls s.MountHandlers to register both apikit's built-in handlers and workspace-specific permission scopes, then registers workspace routes.
Must be called after NewServer and before Start.
func RegisterRoutes ¶
RegisterRoutes mounts workspace API handlers on the given echo group. This is also used by tests which set up their own echo instance and auth middleware instead of using the full apikit server stack.
func WorkspacePermissions ¶
func WorkspacePermissions() []apikit.Permission
WorkspacePermissions returns the Permission values that hub registers with apikit's MountHandlers for workspace operations.
Types ¶
type AuthInfo ¶
type AuthInfo struct {
CredType CredentialType `json:"cred_type"`
UserID string `json:"user_id"`
Permissions []string `json:"permissions"`
}
AuthInfo holds the authenticated identity and permissions for a request.
type CredentialType ¶
type CredentialType string
CredentialType identifies the type of credential used to authenticate a request.
const ( // CredentialAdmin represents an admin token. CredentialAdmin CredentialType = "admin" // CredentialAPIKey represents a user API key. CredentialAPIKey CredentialType = "apikey" // CredentialPAT represents a personal access token. CredentialPAT CredentialType = "pat" )
type OrgMembershipCheckFunc ¶
OrgMembershipCheckFunc is the signature for org membership checks. Returns (0, "") on success, or (httpCode, message) on failure.