emilsoftware-utilities 2.0.0-dev.73 → 2.0.0-dev.75
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/README.MD +2 -0
- package/dist/accessi/resource-server/token.js +62 -18
- package/dist/accessi/resource-server/token.js.map +1 -1
- package/dist/accessi/resource-server/types.d.ts +22 -0
- package/dist/accessi/resource-server/types.js.map +1 -1
- package/dist/accessi/server/index.d.ts +1 -1
- package/dist/accessi/server/index.js +2 -1
- package/dist/accessi/server/index.js.map +1 -1
- package/dist/accessi/server/standalone.d.ts +2 -4
- package/dist/accessi/server/standalone.js +4 -79
- package/dist/accessi/server/standalone.js.map +1 -1
- package/dist/accessi-module/AccessiModule.d.ts +12 -3
- package/dist/accessi-module/AccessiModule.js.map +1 -1
- package/dist/accessi-module/Console/console.js +2 -1
- package/dist/accessi-module/Console/wiki.js +2 -1
- package/dist/accessi-module/Console/wiki.js.map +1 -1
- package/dist/accessi-module/Services/AuthService/AuthService.js +2 -2
- package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.d.ts +9 -1
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.js +53 -1
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.js.map +1 -1
- package/dist/accessi-module/health/nest.d.ts +31 -0
- package/dist/accessi-module/health/nest.js +89 -0
- package/dist/accessi-module/health/nest.js.map +1 -0
- package/dist/accessi-module/health/readiness.d.ts +53 -0
- package/dist/accessi-module/health/readiness.js +110 -0
- package/dist/accessi-module/health/readiness.js.map +1 -0
- package/dist/accessi-module/index.d.ts +6 -0
- package/dist/accessi-module/index.js +16 -1
- package/dist/accessi-module/index.js.map +1 -1
- package/dist/accessi-module/jwt/jwt.strategy.js +1 -35
- package/dist/accessi-module/jwt/jwt.strategy.js.map +1 -1
- package/dist/accessi-module/middleware/authenticateGen.js +1 -35
- package/dist/accessi-module/middleware/authenticateGen.js.map +1 -1
- package/dist/accessi-module/security/jwtTokenOptions.d.ts +44 -9
- package/dist/accessi-module/security/jwtTokenOptions.js +118 -7
- package/dist/accessi-module/security/jwtTokenOptions.js.map +1 -1
- package/dist/accessi-module/security/validateOptions.js +31 -4
- package/dist/accessi-module/security/validateOptions.js.map +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.75.tgz +0 -0
- package/docs/jwt-key-rotation.md +143 -0
- package/docs/proxy-ip.md +99 -0
- package/docs/standalone-service.md +25 -0
- package/package.json +5 -3
- package/dist/emilsoftware-utilities-2.0.0-dev.73.tgz +0 -0
|
@@ -50,6 +50,31 @@ GET /health/metrics -> metriche Prometheus testuali
|
|
|
50
50
|
- `healthCheck()` degli store Redis configurati
|
|
51
51
|
- `readinessChecks` aggiuntivi passati dal chiamante
|
|
52
52
|
|
|
53
|
+
### Host Nest con `AccessiModule.forRoot`
|
|
54
|
+
|
|
55
|
+
Un'app Nest che monta Accessi in-process ottiene gli stessi endpoint con il modulo di health:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { AccessiModule, createAccessiHealthModule } from "emilsoftware-utilities/accessi/server";
|
|
59
|
+
|
|
60
|
+
@Module({
|
|
61
|
+
imports: [
|
|
62
|
+
AccessiModule.forRoot(accessiOptions),
|
|
63
|
+
createAccessiHealthModule({
|
|
64
|
+
accessiOptions,
|
|
65
|
+
readinessChecks: [{ name: "coda", check: async () => queue.isReady() }],
|
|
66
|
+
path: "/health", // default
|
|
67
|
+
}),
|
|
68
|
+
],
|
|
69
|
+
})
|
|
70
|
+
export class AppModule {}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Il contratto e identico al servizio standalone (200/503, `checks` con `bootstrap`, `database`,
|
|
74
|
+
store configurati e check aggiuntivi). Per un uso programmatico (senza controller) ci sono
|
|
75
|
+
`checkAccessiReadiness(accessiOptions, checks)`, `createAccessiLiveReport()` e
|
|
76
|
+
`readinessHttpStatus(report)`.
|
|
77
|
+
|
|
53
78
|
## Esecuzione come processo
|
|
54
79
|
|
|
55
80
|
In produzione il servizio viene eseguito come processo Node gestito da systemd, PM2 o dal supervisor del cliente:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emilsoftware-utilities",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.75",
|
|
4
4
|
"description": "Utilities for EmilSoftware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -132,14 +132,15 @@
|
|
|
132
132
|
"accessi:serve": "ts-node src/scripts/startAccessiService.ts",
|
|
133
133
|
"accessi:serve:dist": "node dist/scripts/startAccessiService.js",
|
|
134
134
|
"accessi:generate-jwt-keys": "node scripts/generate-accessi-jwt-keys.cjs",
|
|
135
|
+
"accessi:rotate-jwt-keys": "node scripts/rotate-accessi-jwt-keys.cjs",
|
|
135
136
|
"db:catalog:accessi": "ts-node src/accessi-module/database-updates/runAccessiCatalogMigrations.ts",
|
|
136
137
|
"db:catalog:accessi:check": "ts-node src/accessi-module/database-updates/runAccessiCatalogMigrations.ts --check",
|
|
137
138
|
"prepublishOnly": "npm run build",
|
|
138
139
|
"typecheck": "tsc --noEmit",
|
|
139
140
|
"lint": "node scripts/lint.cjs",
|
|
140
141
|
"test": "npm run typecheck && npm run lint && npm run test:unit",
|
|
141
|
-
"test:unit": "node --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs",
|
|
142
|
-
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs",
|
|
142
|
+
"test:unit": "node --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs test/proxy-ip.cjs test/readiness.cjs test/jwt-key-rotation.cjs",
|
|
143
|
+
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs test/proxy-ip.cjs test/readiness.cjs test/jwt-key-rotation.cjs",
|
|
143
144
|
"test:accessi": "npm run test:unit",
|
|
144
145
|
"test:all": "npm test && npm run test:integration && npm run test:integration:redis",
|
|
145
146
|
"test:integration": "node test/integration/run-firebird.cjs 5",
|
|
@@ -149,6 +150,7 @@
|
|
|
149
150
|
"test:integration:fb25": "node test/integration/run-firebird.cjs 2.5",
|
|
150
151
|
"test:accessi-console": "npm run build && node test/console-two-factor.cjs",
|
|
151
152
|
"test:pack": "node scripts/pack-smoke-test.cjs",
|
|
153
|
+
"test:proxy-ip": "node --test test/proxy-ip.cjs test/readiness.cjs",
|
|
152
154
|
"accessi:seed-admin": "node scripts/seed-accessi-admin.cjs",
|
|
153
155
|
"accessi:console": "node scripts/run-accessi-console.cjs",
|
|
154
156
|
"test:accessi-schema": "node --test test/accessi-schema.cjs",
|
|
Binary file
|