@tekcify/auth-backend 2.1.0 → 2.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwks-verifier.d.ts","sourceRoot":"","sources":["../src/jwks-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"jwks-verifier.d.ts","sourceRoot":"","sources":["../src/jwks-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAK3D,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAWD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,OAAO,EAAE,mBAAmB;IAelC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAsC7C,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAIjD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAE7E"}
|
package/dist/jwks-verifier.js
CHANGED
|
@@ -7,16 +7,14 @@ exports.JwksVerifier = void 0;
|
|
|
7
7
|
exports.createJwksVerifier = createJwksVerifier;
|
|
8
8
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
9
9
|
const jwks_rsa_1 = __importDefault(require("jwks-rsa"));
|
|
10
|
+
const DEFAULT_AUTH_SERVER_URL = 'https://auth-api.tekcify.com';
|
|
10
11
|
const JWKS_PATH = '/api/.well-known/jwks.json';
|
|
11
12
|
function resolveJwksUri(options) {
|
|
12
13
|
if (options.jwksUri) {
|
|
13
14
|
return options.jwksUri;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return `${baseUrl}${JWKS_PATH}`;
|
|
18
|
-
}
|
|
19
|
-
throw new Error('Either authServerUrl or jwksUri must be provided in JwksVerifierOptions');
|
|
16
|
+
const baseUrl = (options.authServerUrl ?? DEFAULT_AUTH_SERVER_URL).replace(/\/$/, '');
|
|
17
|
+
return `${baseUrl}${JWKS_PATH}`;
|
|
20
18
|
}
|
|
21
19
|
class JwksVerifier {
|
|
22
20
|
constructor(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekcify/auth-backend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Backend authentication helpers for Tekcify Auth. Provides middleware, guards, and utilities for validating JWT tokens and protecting API routes in NestJS and Express applications.",
|
|
5
5
|
"author": "Tekcify",
|
|
6
6
|
"main": "./dist/index.js",
|