@sebspark/openapi-auth-iam 1.0.0 → 1.0.1

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