@ditojs/server 2.68.0 → 2.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "2.68.0",
3
+ "version": "2.70.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/server",
@@ -26,10 +26,10 @@
26
26
  "node >= 18"
27
27
  ],
28
28
  "dependencies": {
29
- "@ditojs/admin": "^2.68.0",
30
- "@ditojs/build": "^2.68.0",
31
- "@ditojs/router": "^2.68.0",
32
- "@ditojs/utils": "^2.68.0",
29
+ "@ditojs/admin": "^2.70.0",
30
+ "@ditojs/build": "^2.70.0",
31
+ "@ditojs/router": "^2.70.0",
32
+ "@ditojs/utils": "^2.70.0",
33
33
  "@koa/cors": "^5.0.0",
34
34
  "@koa/etag": "^5.0.1",
35
35
  "@koa/multer": "^4.0.0",
@@ -47,7 +47,7 @@
47
47
  "koa-compose": "^4.1.0",
48
48
  "koa-compress": "^5.1.1",
49
49
  "koa-conditional-get": "^3.0.0",
50
- "koa-helmet": "^8.0.1",
50
+ "koa-helmet": "^8.0.3",
51
51
  "koa-mount": "^4.2.0",
52
52
  "koa-passport": "^6.0.0",
53
53
  "koa-response-time": "^2.1.0",
@@ -58,7 +58,7 @@
58
58
  "multer": "^2.0.2",
59
59
  "multer-s3": "https://github.com/ditojs/multer-s3#dito",
60
60
  "nanoid": "^5.1.6",
61
- "parse-duration": "^2.1.4",
61
+ "parse-duration": "^2.1.5",
62
62
  "passport-local": "^1.0.0",
63
63
  "passthrough-counter": "^1.0.0",
64
64
  "picocolors": "^1.1.1",
@@ -67,7 +67,7 @@
67
67
  "pino-pretty": "^13.1.3",
68
68
  "pluralize": "^8.0.0",
69
69
  "repl": "^0.1.3",
70
- "type-fest": "^5.3.0",
70
+ "type-fest": "^5.3.1",
71
71
  "uuid": "^13.0.0"
72
72
  },
73
73
  "peerDependencies": {
@@ -85,10 +85,10 @@
85
85
  "@types/koa-session": "^6.4.5",
86
86
  "@types/koa-static": "^4.0.4",
87
87
  "@types/koa__cors": "^5.0.1",
88
- "@types/node": "^24.10.1",
88
+ "@types/node": "^25.0.3",
89
89
  "knex": "^3.1.0",
90
90
  "objection": "^3.1.5",
91
91
  "typescript": "^5.9.3"
92
92
  },
93
- "gitHead": "8dbd4ce3ff84d83e8e4ebd8e90772ae51b25b8ce"
93
+ "gitHead": "2010c0695b5a7296e10c2b6bf2539d552c576fd9"
94
94
  }
@@ -435,10 +435,12 @@ export class Controller {
435
435
  }
436
436
  }
437
437
 
438
- const handleAuthorize = authorize => {
438
+ const handleAuthorize = (authorize, allowOverride) => {
439
439
  const add = (key, value) => {
440
440
  if (key in values && includeKey(key)) {
441
- authorizeMap[key] = value
441
+ if (allowOverride || !(key in authorizeMap)) {
442
+ authorizeMap[key] = value
443
+ }
442
444
  }
443
445
  }
444
446
 
@@ -466,14 +468,14 @@ export class Controller {
466
468
 
467
469
  for (const current of chain) {
468
470
  handleAllow(getOwnProperty(current, 'allow'), current)
469
- handleAuthorize(getOwnProperty(current, 'authorize'))
471
+ handleAuthorize(getOwnProperty(current, 'authorize'), true)
470
472
  }
471
473
 
472
474
  // At the end of the chain, also support authorize settings on the
473
- // controller-level, and thus applied to all action objects in the
474
- // controller.
475
+ // controller-level, acting as a fallback for actions that don't already
476
+ // have authorization.
475
477
  if (this.authorize) {
476
- handleAuthorize(this.authorize)
478
+ handleAuthorize(this.authorize, false)
477
479
  }
478
480
 
479
481
  return {