@sebspark/openapi-auth-iam 1.0.0 → 1.0.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/index.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
2
|
|
|
3
|
-
declare const apiGatewayTokenByUrlGenerator: (apiKey: string, logger?: Logger) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}>>;
|
|
7
|
-
declare const apiGatewayTokenByClientIdGenerator: (apiKey: string, clientId: string) => Promise<() => Promise<{
|
|
8
|
-
'Proxy-Authorization': string;
|
|
9
|
-
'x-api-key': string;
|
|
10
|
-
}>>;
|
|
11
|
-
declare const apiGatewayTokenRefresh: () => Promise<(url: string) => Promise<void>>;
|
|
3
|
+
declare const apiGatewayTokenByUrlGenerator: (apiKey: string, logger?: Logger) => (url: string) => Promise<Map<string, string>>;
|
|
4
|
+
declare const apiGatewayTokenByClientIdGenerator: (apiKey: string, clientId: string) => () => Promise<Map<string, string>>;
|
|
5
|
+
declare const apiGatewayTokenRefresh: () => (url: string) => Promise<void>;
|
|
12
6
|
|
|
13
7
|
export { apiGatewayTokenByClientIdGenerator, apiGatewayTokenByUrlGenerator, apiGatewayTokenRefresh };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
2
|
|
|
3
|
-
declare const apiGatewayTokenByUrlGenerator: (apiKey: string, logger?: Logger) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}>>;
|
|
7
|
-
declare const apiGatewayTokenByClientIdGenerator: (apiKey: string, clientId: string) => Promise<() => Promise<{
|
|
8
|
-
'Proxy-Authorization': string;
|
|
9
|
-
'x-api-key': string;
|
|
10
|
-
}>>;
|
|
11
|
-
declare const apiGatewayTokenRefresh: () => Promise<(url: string) => Promise<void>>;
|
|
3
|
+
declare const apiGatewayTokenByUrlGenerator: (apiKey: string, logger?: Logger) => (url: string) => Promise<Map<string, string>>;
|
|
4
|
+
declare const apiGatewayTokenByClientIdGenerator: (apiKey: string, clientId: string) => () => Promise<Map<string, string>>;
|
|
5
|
+
declare const apiGatewayTokenRefresh: () => (url: string) => Promise<void>;
|
|
12
6
|
|
|
13
7
|
export { apiGatewayTokenByClientIdGenerator, apiGatewayTokenByUrlGenerator, apiGatewayTokenRefresh };
|
package/dist/index.js
CHANGED
|
@@ -26,28 +26,28 @@ __export(index_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
var import_gcp_iam = require("@sebspark/gcp-iam");
|
|
29
|
-
var apiGatewayTokenByUrlGenerator =
|
|
29
|
+
var apiGatewayTokenByUrlGenerator = (apiKey, logger) => {
|
|
30
30
|
return async (url) => {
|
|
31
31
|
const token = await (0, import_gcp_iam.getApiGatewayTokenByUrl)({
|
|
32
32
|
apiURL: url,
|
|
33
33
|
logger
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
"Proxy-Authorization"
|
|
37
|
-
"x-api-key"
|
|
38
|
-
|
|
35
|
+
return /* @__PURE__ */ new Map([
|
|
36
|
+
["Proxy-Authorization", `Bearer ${token}`],
|
|
37
|
+
["x-api-key", apiKey]
|
|
38
|
+
]);
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
var apiGatewayTokenByClientIdGenerator =
|
|
41
|
+
var apiGatewayTokenByClientIdGenerator = (apiKey, clientId) => {
|
|
42
42
|
return async () => {
|
|
43
43
|
const token = await (0, import_gcp_iam.getApiGatewayTokenByClientId)(clientId);
|
|
44
|
-
return
|
|
45
|
-
"Proxy-Authorization"
|
|
46
|
-
"x-api-key"
|
|
47
|
-
|
|
44
|
+
return /* @__PURE__ */ new Map([
|
|
45
|
+
["Proxy-Authorization", `Bearer ${token}`],
|
|
46
|
+
["x-api-key", apiKey]
|
|
47
|
+
]);
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
var apiGatewayTokenRefresh =
|
|
50
|
+
var apiGatewayTokenRefresh = () => {
|
|
51
51
|
return async (url) => {
|
|
52
52
|
return await (0, import_gcp_iam.clearCache)(url);
|
|
53
53
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -4,28 +4,28 @@ import {
|
|
|
4
4
|
getApiGatewayTokenByClientId,
|
|
5
5
|
getApiGatewayTokenByUrl
|
|
6
6
|
} from "@sebspark/gcp-iam";
|
|
7
|
-
var apiGatewayTokenByUrlGenerator =
|
|
7
|
+
var apiGatewayTokenByUrlGenerator = (apiKey, logger) => {
|
|
8
8
|
return async (url) => {
|
|
9
9
|
const token = await getApiGatewayTokenByUrl({
|
|
10
10
|
apiURL: url,
|
|
11
11
|
logger
|
|
12
12
|
});
|
|
13
|
-
return
|
|
14
|
-
"Proxy-Authorization"
|
|
15
|
-
"x-api-key"
|
|
16
|
-
|
|
13
|
+
return /* @__PURE__ */ new Map([
|
|
14
|
+
["Proxy-Authorization", `Bearer ${token}`],
|
|
15
|
+
["x-api-key", apiKey]
|
|
16
|
+
]);
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
var apiGatewayTokenByClientIdGenerator =
|
|
19
|
+
var apiGatewayTokenByClientIdGenerator = (apiKey, clientId) => {
|
|
20
20
|
return async () => {
|
|
21
21
|
const token = await getApiGatewayTokenByClientId(clientId);
|
|
22
|
-
return
|
|
23
|
-
"Proxy-Authorization"
|
|
24
|
-
"x-api-key"
|
|
25
|
-
|
|
22
|
+
return /* @__PURE__ */ new Map([
|
|
23
|
+
["Proxy-Authorization", `Bearer ${token}`],
|
|
24
|
+
["x-api-key", apiKey]
|
|
25
|
+
]);
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
var apiGatewayTokenRefresh =
|
|
28
|
+
var apiGatewayTokenRefresh = () => {
|
|
29
29
|
return async (url) => {
|
|
30
30
|
return await clearCache(url);
|
|
31
31
|
};
|