@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 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
- }>>;
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) => 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
- }>>;
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 = async (apiKey, logger) => {
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": `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
- var apiGatewayTokenByClientIdGenerator = async (apiKey, clientId) => {
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": `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
- var apiGatewayTokenRefresh = async () => {
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 = async (apiKey, logger) => {
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": `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
- var apiGatewayTokenByClientIdGenerator = async (apiKey, clientId) => {
19
+ var apiGatewayTokenByClientIdGenerator = (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
- var apiGatewayTokenRefresh = async () => {
28
+ var apiGatewayTokenRefresh = () => {
29
29
  return async (url) => {
30
30
  return await clearCache(url);
31
31
  };
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.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",