@xeplr/auth 1.0.6 → 1.0.7
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/index.js +11 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -97,6 +97,17 @@ async function start(config = {}) {
|
|
|
97
97
|
const adminRtr = createAdminRouter();
|
|
98
98
|
|
|
99
99
|
return createApp(port, 'xeplr-auth', {
|
|
100
|
+
// THE ONE SERVICE THAT CANNOT USE createApp's DEFAULT GATE — that gate
|
|
101
|
+
// validates a token by asking the auth service over HTTP, and this IS the
|
|
102
|
+
// auth service. It would be asking itself, and /login has no token to ask
|
|
103
|
+
// with.
|
|
104
|
+
//
|
|
105
|
+
// Not a hole. createAuthRouter gates its own protected routes per-route
|
|
106
|
+
// with authMiddleware (/me, /profile, /change-password, /sse-ticket, and
|
|
107
|
+
// all of /admin). What is left open — login, register, activate, refresh,
|
|
108
|
+
// forgot/reset-password — is open by design, because it is how a caller
|
|
109
|
+
// obtains a token in the first place.
|
|
110
|
+
auth: false,
|
|
100
111
|
corsOptions: config.corsOptions,
|
|
101
112
|
middleware: config.middleware,
|
|
102
113
|
routes: { '/auth/api': authRouter, '/auth/api/admin': adminRtr }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeplr/auth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Pluggable authentication service: register, login, forgot/reset password, RBAC, multi-tenancy",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ioredis": "^5.6.1",
|
|
43
43
|
"jsonwebtoken": "^9.0.3",
|
|
44
44
|
"multer": "^2.3.0",
|
|
45
|
-
"@xeplr/base-apis": "^
|
|
45
|
+
"@xeplr/base-apis": "^2.0.0",
|
|
46
46
|
"@xeplr/db": "^1.0.0",
|
|
47
47
|
"@xeplr/utils": "^1.0.0"
|
|
48
48
|
},
|