Updating API endpoints, to include the new system one, updating hosting envoy yaml to cover these.
This commit is contained in:
parent
10bb31afd2
commit
f6d0db4c4b
|
@ -26,6 +26,14 @@ static_resources:
|
|||
cluster: couchdb-service
|
||||
prefix_rewrite: "/"
|
||||
|
||||
- match: { prefix: "/api/system/" }
|
||||
route:
|
||||
cluster: worker-dev
|
||||
|
||||
- match: { prefix: "/api/admin/" }
|
||||
route:
|
||||
cluster: worker-dev
|
||||
|
||||
- match: { prefix: "/api/global/" }
|
||||
route:
|
||||
cluster: worker-dev
|
||||
|
|
|
@ -37,11 +37,19 @@ static_resources:
|
|||
route:
|
||||
cluster: app-service
|
||||
|
||||
# special case for worker admin API
|
||||
# special cases for worker admin (deprecated), global and system API
|
||||
- match: { prefix: "/api/global/" }
|
||||
route:
|
||||
cluster: worker-service
|
||||
|
||||
- match: { prefix: "/api/admin/" }
|
||||
route:
|
||||
cluster: worker-service
|
||||
|
||||
- match: { prefix: "/api/system/" }
|
||||
route:
|
||||
cluster: worker-service
|
||||
|
||||
- match: { path: "/" }
|
||||
route:
|
||||
cluster: app-service
|
||||
|
|
|
@ -41,7 +41,7 @@ export function createAdminStore() {
|
|||
async function multiTenancyEnabled() {
|
||||
let enabled = false
|
||||
try {
|
||||
const response = await api.get(`/api/global/flags`)
|
||||
const response = await api.get(`/api/system/flags`)
|
||||
const json = await response.json()
|
||||
enabled = json.multiTenancy
|
||||
} catch (err) {
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
const Router = require("@koa/router")
|
||||
const controller = require("../../controllers/global/flags")
|
||||
|
||||
const router = Router()
|
||||
|
||||
router.get("/api/global/flags", controller.fetch)
|
||||
|
||||
module.exports = router
|
|
@ -1,11 +0,0 @@
|
|||
const Router = require("@koa/router")
|
||||
const controller = require("../../controllers/global/tenants")
|
||||
const adminOnly = require("../../../middleware/adminOnly")
|
||||
|
||||
const router = Router()
|
||||
|
||||
router
|
||||
.get("/api/global/tenants/:tenantId/exists", controller.exists)
|
||||
.get("/api/global/tenants", adminOnly, controller.fetch)
|
||||
|
||||
module.exports = router
|
|
@ -2,12 +2,12 @@ const userRoutes = require("./global/users")
|
|||
const configRoutes = require("./global/configs")
|
||||
const workspaceRoutes = require("./global/workspaces")
|
||||
const templateRoutes = require("./global/templates")
|
||||
const tenantsRoutes = require("./global/tenants")
|
||||
const emailRoutes = require("./global/email")
|
||||
const authRoutes = require("./global/auth")
|
||||
const roleRoutes = require("./global/roles")
|
||||
const sessionRoutes = require("./global/sessions")
|
||||
const flagRoutes = require("./global/flags")
|
||||
const flagRoutes = require("./system/flags")
|
||||
const tenantsRoutes = require("./system/tenants")
|
||||
const appRoutes = require("./app")
|
||||
|
||||
exports.routes = [
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
const Router = require("@koa/router")
|
||||
const controller = require("../../controllers/system/flags")
|
||||
|
||||
const router = Router()
|
||||
|
||||
router.get("/api/system/flags", controller.fetch)
|
||||
|
||||
module.exports = router
|
|
@ -0,0 +1,11 @@
|
|||
const Router = require("@koa/router")
|
||||
const controller = require("../../controllers/system/tenants")
|
||||
const adminOnly = require("../../../middleware/adminOnly")
|
||||
|
||||
const router = Router()
|
||||
|
||||
router
|
||||
.get("/api/system/tenants/:tenantId/exists", controller.exists)
|
||||
.get("/api/system/tenants", adminOnly, controller.fetch)
|
||||
|
||||
module.exports = router
|
Loading…
Reference in New Issue