@owox/idp-owox 0.8.0-next-20250930075523 → 0.8.0-next-20250930142201
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/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -1
- package/dist/owoxIdp.d.ts +1 -0
- package/dist/owoxIdp.d.ts.map +1 -1
- package/dist/owoxIdp.js +7 -4
- package/package.json +3 -3
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,IAAI,CAAC;AA8DpB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCtB,CAAC;AAEH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB;;;;;;;;;;;;;;;;;;;;;EAGvE;AAED,gDAAgD;AAEhD,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;mBAaoB,EAAE,CAAC,WAAW;;;;;EAE/D,CAAC;AAEL,sDAAsD;AAEtD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;EAgBb,CAAC;AAEN,uCAAuC;AAEvC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;EAYb,CAAC;AAEN,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC3E,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AAExE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACnF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,aAAa,CAgB5F"}
|
package/dist/config.js
CHANGED
|
@@ -12,6 +12,7 @@ const env_paths_1 = __importDefault(require("env-paths"));
|
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const fs_1 = require("fs");
|
|
14
14
|
const internal_helpers_1 = require("@owox/internal-helpers");
|
|
15
|
+
const internal_helpers_2 = require("@owox/internal-helpers");
|
|
15
16
|
const zMsString = zod_1.z
|
|
16
17
|
.string()
|
|
17
18
|
.refine((s) => (0, ms_1.default)(s) !== undefined, {
|
|
@@ -56,7 +57,8 @@ const DbEnvRaw = zod_1.z.discriminatedUnion('IDP_OWOX_DB_TYPE', [SqliteEnvRaw, M
|
|
|
56
57
|
exports.DbEnvSchema = DbEnvRaw.transform(e => {
|
|
57
58
|
if (e.IDP_OWOX_DB_TYPE === 'sqlite') {
|
|
58
59
|
const dbPath = e.IDP_OWOX_SQLITE_DB_PATH ?? getSqliteDefaultDbPath();
|
|
59
|
-
|
|
60
|
+
const logger = internal_helpers_2.LoggerFactory.createNamedLogger('IdpOwoxConfig');
|
|
61
|
+
logger.info(`idp-owox SQLite database path: ${dbPath}`);
|
|
60
62
|
return {
|
|
61
63
|
type: 'sqlite',
|
|
62
64
|
sqlite: {
|
package/dist/owoxIdp.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare class OwoxIdp implements IdpProvider {
|
|
|
5
5
|
private readonly config;
|
|
6
6
|
private readonly store;
|
|
7
7
|
private readonly identityClient;
|
|
8
|
+
private readonly logger;
|
|
8
9
|
constructor(config: IdpOwoxConfig);
|
|
9
10
|
initialize(): Promise<void>;
|
|
10
11
|
introspectToken(token: string): Promise<Payload | null>;
|
package/dist/owoxIdp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owoxIdp.d.ts","sourceRoot":"","sources":["../src/owoxIdp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAiB,MAAM,oBAAoB,CAAC;AAC/F,OAAO,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"owoxIdp.d.ts","sourceRoot":"","sources":["../src/owoxIdp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAiB,MAAM,oBAAoB,CAAC;AAC/F,OAAO,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBzC,qBAAa,OAAQ,YAAW,WAAW;IAK7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,C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C;IAWrF,qBAAqB,CACzB,GAAG,EAAE,CAAC,CAAC,OAAO,EACd,GAAG,EAAE,CAAC,CAAC,QAAQ,EACf,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC;IA0B7B,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI;YAyBtB,iBAAiB;YAyBjB,cAAc;IAgB5B,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,WAAW;CAOpB"}
|
package/dist/owoxIdp.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.OwoxIdp = void 0;
|
|
7
7
|
const idp_protocol_1 = require("@owox/idp-protocol");
|
|
8
|
+
const internal_helpers_1 = require("@owox/internal-helpers");
|
|
8
9
|
const client_1 = require("./client");
|
|
9
10
|
const AuthorizationStoreFactory_1 = require("./auth/AuthorizationStoreFactory");
|
|
10
11
|
const parseToken_1 = require("./token/parseToken");
|
|
@@ -16,10 +17,12 @@ class OwoxIdp {
|
|
|
16
17
|
config;
|
|
17
18
|
store;
|
|
18
19
|
identityClient;
|
|
20
|
+
logger;
|
|
19
21
|
constructor(config) {
|
|
20
22
|
this.config = config;
|
|
21
23
|
this.store = (0, AuthorizationStoreFactory_1.createAuthorizationStore)(config.dbConfig);
|
|
22
24
|
this.identityClient = new client_1.IdentityOwoxClient(config.identityOwoxClientConfig);
|
|
25
|
+
this.logger = internal_helpers_1.LoggerFactory.createNamedLogger('OwoxIdp');
|
|
23
26
|
}
|
|
24
27
|
initialize() {
|
|
25
28
|
return this.store.initialize();
|
|
@@ -113,7 +116,7 @@ class OwoxIdp {
|
|
|
113
116
|
return res.json(auth);
|
|
114
117
|
}
|
|
115
118
|
catch (error) {
|
|
116
|
-
|
|
119
|
+
this.logger.error(this.formatError(error));
|
|
117
120
|
res.clearCookie(COOKIE_NAME);
|
|
118
121
|
return res.json({ reason: 'atm4' });
|
|
119
122
|
}
|
|
@@ -123,11 +126,11 @@ class OwoxIdp {
|
|
|
123
126
|
const code = req.query.code;
|
|
124
127
|
const state = req.query.state;
|
|
125
128
|
if (!code) {
|
|
126
|
-
|
|
129
|
+
this.logger.warn('Redirect url should contain code param');
|
|
127
130
|
return res.redirect(idp_protocol_1.ProtocolRoute.SIGN_IN);
|
|
128
131
|
}
|
|
129
132
|
if (!state) {
|
|
130
|
-
|
|
133
|
+
this.logger.warn('Redirect url should contain state param');
|
|
131
134
|
return res.redirect(idp_protocol_1.ProtocolRoute.SIGN_IN);
|
|
132
135
|
}
|
|
133
136
|
try {
|
|
@@ -136,7 +139,7 @@ class OwoxIdp {
|
|
|
136
139
|
res.redirect('/');
|
|
137
140
|
}
|
|
138
141
|
catch (error) {
|
|
139
|
-
|
|
142
|
+
this.logger.error(this.formatError(error));
|
|
140
143
|
return res.redirect(idp_protocol_1.ProtocolRoute.SIGN_IN);
|
|
141
144
|
}
|
|
142
145
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owox/idp-owox",
|
|
3
|
-
"version": "0.8.0-next-
|
|
3
|
+
"version": "0.8.0-next-20250930142201",
|
|
4
4
|
"description": "Identity Provider implementation from OWOX",
|
|
5
5
|
"author": "OWOX",
|
|
6
6
|
"license": "ELv2",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"prepublishOnly": "npm run lint && npm run typecheck"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owox/idp-protocol": "0.8.0-next-
|
|
25
|
-
"@owox/internal-helpers": "0.8.0-next-
|
|
24
|
+
"@owox/idp-protocol": "0.8.0-next-20250930142201",
|
|
25
|
+
"@owox/internal-helpers": "0.8.0-next-20250930142201",
|
|
26
26
|
"pkce-challenge": "^5.0.0",
|
|
27
27
|
"cookie-parser": "^1.4.7",
|
|
28
28
|
"env-paths": "^3.0.0",
|