feat(backend): introduce org namespaced api routes

This commit is contained in:
2026-01-02 00:22:08 +00:00
parent ebcdcf2cea
commit 490699e113
10 changed files with 233 additions and 37 deletions

View File

@@ -10,6 +10,7 @@ const authenticatedUserKey = "authenticatedUser"
const vfsAccessScope = "vfsAccessScope"
const currentAccountKey = "currentAccount"
const currentDriveKey = "currentDrive"
const currentOrganizationKey = "currentOrganization"
var ErrUnauthenticatedRequest = errors.New("unauthenticated request")
@@ -40,6 +41,11 @@ func SetVFSAccessScope(c *fiber.Ctx, scope any) {
c.Locals(vfsAccessScope, scope)
}
// SetCurrentOrganization sets the current organization in the fiber context.
func SetCurrentOrganization(c *fiber.Ctx, organization any) {
c.Locals(currentOrganizationKey, organization)
}
// CurrentAccount returns the current account from the given fiber context.
func CurrentAccount(c *fiber.Ctx) any {
return c.Locals(currentAccountKey)
@@ -50,6 +56,11 @@ func CurrentDrive(c *fiber.Ctx) any {
return c.Locals(currentDriveKey)
}
// CurrentOrganization returns the current organization from the given fiber context.
func CurrentOrganization(c *fiber.Ctx) any {
return c.Locals(currentOrganizationKey)
}
// VFSAccessScope returns the VFS access scope from the given fiber context.
func VFSAccessScope(c *fiber.Ctx) any {
return c.Locals(vfsAccessScope)