@openstax/ts-utils 1.38.0 → 1.38.2
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/cjs/misc/jwks.d.ts +1 -1
- package/dist/cjs/misc/jwks.js +3 -3
- package/dist/cjs/services/authProvider/index.d.ts +3 -3
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/misc/jwks.d.ts +1 -1
- package/dist/esm/misc/jwks.js +3 -3
- package/dist/esm/services/authProvider/index.d.ts +3 -3
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/cjs/misc/jwks.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { JWK } from 'node-jose';
|
|
|
3
3
|
export type JwksFetcher = (uri: string) => Promise<{
|
|
4
4
|
keys: JWK.RawKey[];
|
|
5
5
|
}>;
|
|
6
|
-
export declare const getJwksClient: (
|
|
6
|
+
export declare const getJwksClient: (jwksUri: string, fetcher?: JwksFetcher) => JwksClient;
|
|
7
7
|
export declare const getJwksKey: (iss: string, kid?: string, fetcher?: JwksFetcher) => Promise<import("jwks-rsa").SigningKey>;
|
package/dist/cjs/misc/jwks.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getJwksKey = exports.getJwksClient = void 0;
|
|
4
4
|
const jwks_rsa_1 = require("jwks-rsa");
|
|
5
5
|
const helpers_1 = require("./helpers");
|
|
6
|
-
exports.getJwksClient = (0, helpers_1.memoize)((
|
|
7
|
-
const jwksUri = new URL('/.well-known/jwks.json', iss).toString();
|
|
6
|
+
exports.getJwksClient = (0, helpers_1.memoize)((jwksUri, fetcher) => {
|
|
8
7
|
return new jwks_rsa_1.JwksClient({ jwksUri, fetcher });
|
|
9
8
|
});
|
|
10
9
|
exports.getJwksKey = (0, helpers_1.memoize)(async (iss, kid, fetcher) => {
|
|
11
|
-
const
|
|
10
|
+
const jwksUri = new URL('/.well-known/jwks.json', iss).toString();
|
|
11
|
+
const client = (0, exports.getJwksClient)(jwksUri, fetcher);
|
|
12
12
|
return client.getSigningKey(kid);
|
|
13
13
|
});
|
|
@@ -8,13 +8,11 @@ export type ConsentPreferences = {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export type TokenUser = {
|
|
11
|
-
id: number;
|
|
12
11
|
name: string;
|
|
13
12
|
uuid: string;
|
|
14
|
-
faculty_status: string;
|
|
15
|
-
is_admin: boolean;
|
|
16
13
|
};
|
|
17
14
|
export type ApiUser = TokenUser & {
|
|
15
|
+
id: number;
|
|
18
16
|
first_name: string;
|
|
19
17
|
last_name: string;
|
|
20
18
|
full_name: string;
|
|
@@ -30,6 +28,8 @@ export type ApiUser = TokenUser & {
|
|
|
30
28
|
roles: string[];
|
|
31
29
|
}>;
|
|
32
30
|
external_ids: string[];
|
|
31
|
+
faculty_status: string;
|
|
32
|
+
is_admin: boolean;
|
|
33
33
|
is_not_gdpr_location: boolean;
|
|
34
34
|
self_reported_role: string;
|
|
35
35
|
signed_contract_names: string[];
|