@aws-sdk/middleware-token 3.972.11 → 3.972.12

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var protocolHttp = require('@smithy/protocol-http');
3
+ var protocols = require('@smithy/core/protocols');
4
4
  var types = require('@smithy/types');
5
- var propertyProvider = require('@smithy/property-provider');
6
- var utilMiddleware = require('@smithy/util-middleware');
5
+ var client = require('@smithy/core/client');
6
+ var config = require('@smithy/core/config');
7
7
  var tokenDefaultProvider = require('./tokenDefaultProvider');
8
8
 
9
9
  const tokenMiddlewareOptions = {
@@ -14,7 +14,7 @@ const tokenMiddlewareOptions = {
14
14
  override: true,
15
15
  };
16
16
  const tokenMiddleware = (options) => (next, context) => async (args) => {
17
- if (!protocolHttp.HttpRequest.isInstance(args.request) || context.currentAuthConfig)
17
+ if (!protocols.HttpRequest.isInstance(args.request) || context.currentAuthConfig)
18
18
  return next(args);
19
19
  const token = options.token && (await options.token());
20
20
  if (token?.token) {
@@ -42,9 +42,9 @@ const isTokenWithExpiry = (token) => token.expiration !== undefined;
42
42
  const isTokenExpiringWithinFiveMins = (token) => isTokenWithExpiry(token) && token.expiration.getTime() - Date.now() < 300000;
43
43
  const normalizeTokenProvider = (token) => {
44
44
  if (typeof token === "function") {
45
- return propertyProvider.memoize(token, isTokenExpiringWithinFiveMins, isTokenWithExpiry);
45
+ return config.memoize(token, isTokenExpiringWithinFiveMins, isTokenWithExpiry);
46
46
  }
47
- return utilMiddleware.normalizeProvider(token);
47
+ return client.normalizeProvider(token);
48
48
  };
49
49
 
50
50
  const resolveTokenConfig = (input) => {
@@ -1,5 +1,5 @@
1
- import { memoize } from "@smithy/property-provider";
2
- import { normalizeProvider } from "@smithy/util-middleware";
1
+ import { normalizeProvider } from "@smithy/core/client";
2
+ import { memoize } from "@smithy/core/config";
3
3
  const isTokenWithExpiry = (token) => token.expiration !== undefined;
4
4
  const isTokenExpiringWithinFiveMins = (token) => isTokenWithExpiry(token) && token.expiration.getTime() - Date.now() < 300000;
5
5
  export const normalizeTokenProvider = (token) => {
@@ -1,4 +1,4 @@
1
- import { HttpRequest } from "@smithy/protocol-http";
1
+ import { HttpRequest } from "@smithy/core/protocols";
2
2
  import { HttpAuthLocation } from "@smithy/types";
3
3
  export const tokenMiddlewareOptions = {
4
4
  name: "tokenMiddleware",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-token",
3
- "version": "3.972.11",
3
+ "version": "3.972.12",
4
4
  "description": "Middleware and Plugin for setting token authentication",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -30,12 +30,10 @@
30
30
  },
31
31
  "license": "Apache-2.0",
32
32
  "dependencies": {
33
- "@aws-sdk/token-providers": "3.1031.0",
33
+ "@aws-sdk/token-providers": "3.1046.0",
34
34
  "@aws-sdk/types": "^3.973.8",
35
- "@smithy/property-provider": "^4.2.14",
36
- "@smithy/protocol-http": "^5.3.14",
35
+ "@smithy/core": "^3.24.1",
37
36
  "@smithy/types": "^4.14.1",
38
- "@smithy/util-middleware": "^4.2.14",
39
37
  "tslib": "^2.6.2"
40
38
  },
41
39
  "devDependencies": {