@aws-amplify/auth 4.6.14-unstable.4 → 4.6.15-unstable.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.
Files changed (84) hide show
  1. package/lib/.tsbuildinfo +3 -0
  2. package/lib/Auth.d.ts +301 -0
  3. package/lib/Auth.js +65 -140
  4. package/lib/Auth.js.map +1 -1
  5. package/lib/Errors.d.ts +9 -0
  6. package/lib/Errors.js +5 -27
  7. package/lib/Errors.js.map +1 -1
  8. package/lib/OAuth/OAuth.d.ts +29 -0
  9. package/lib/OAuth/OAuth.js +36 -118
  10. package/lib/OAuth/OAuth.js.map +1 -1
  11. package/lib/OAuth/oauthStorage.d.ts +5 -0
  12. package/lib/OAuth/oauthStorage.js +2 -12
  13. package/lib/OAuth/oauthStorage.js.map +1 -1
  14. package/lib/OAuth/oauthStorage.native.d.ts +5 -0
  15. package/lib/OAuth/oauthStorage.native.js +2 -12
  16. package/lib/OAuth/oauthStorage.native.js.map +1 -1
  17. package/lib/OAuth/urlOpener.d.ts +1 -0
  18. package/lib/OAuth/urlOpener.js +2 -12
  19. package/lib/OAuth/urlOpener.js.map +1 -1
  20. package/lib/OAuth/urlOpener.native.d.ts +1 -0
  21. package/lib/OAuth/urlOpener.native.js +2 -12
  22. package/lib/OAuth/urlOpener.native.js.map +1 -1
  23. package/lib/common/AuthErrorStrings.d.ts +17 -0
  24. package/lib/index.d.ts +9 -0
  25. package/lib/index.js +2 -12
  26. package/lib/index.js.map +1 -1
  27. package/lib/types/Auth.d.ts +170 -0
  28. package/lib/types/Auth.js +2 -12
  29. package/lib/types/Auth.js.map +1 -1
  30. package/lib/types/index.d.ts +1 -0
  31. package/lib/types/index.js +4 -16
  32. package/lib/types/index.js.map +1 -1
  33. package/lib/urlListener.d.ts +2 -0
  34. package/lib/urlListener.js +2 -12
  35. package/lib/urlListener.js.map +1 -1
  36. package/lib/urlListener.native.d.ts +2 -0
  37. package/lib/urlListener.native.js +9 -76
  38. package/lib/urlListener.native.js.map +1 -1
  39. package/lib-esm/.tsbuildinfo +3 -0
  40. package/lib-esm/Auth.js +5 -77
  41. package/lib-esm/Auth.js.map +1 -1
  42. package/lib-esm/Errors.js +3 -25
  43. package/lib-esm/Errors.js.map +1 -1
  44. package/lib-esm/OAuth/OAuth.js +13 -85
  45. package/lib-esm/OAuth/OAuth.js.map +1 -1
  46. package/lib-esm/OAuth/oauthStorage.js +2 -12
  47. package/lib-esm/OAuth/oauthStorage.js.map +1 -1
  48. package/lib-esm/OAuth/oauthStorage.native.js +2 -12
  49. package/lib-esm/OAuth/oauthStorage.native.js.map +1 -1
  50. package/lib-esm/OAuth/urlOpener.js +2 -12
  51. package/lib-esm/OAuth/urlOpener.js.map +1 -1
  52. package/lib-esm/OAuth/urlOpener.native.js +2 -12
  53. package/lib-esm/OAuth/urlOpener.native.js.map +1 -1
  54. package/lib-esm/index.js +2 -12
  55. package/lib-esm/index.js.map +1 -1
  56. package/lib-esm/types/Auth.js +2 -12
  57. package/lib-esm/types/Auth.js.map +1 -1
  58. package/lib-esm/types/index.js +2 -12
  59. package/lib-esm/types/index.js.map +1 -1
  60. package/lib-esm/urlListener.js +2 -12
  61. package/lib-esm/urlListener.js.map +1 -1
  62. package/lib-esm/urlListener.native.js +3 -70
  63. package/lib-esm/urlListener.native.js.map +1 -1
  64. package/package.json +13 -11
  65. package/src/Auth.ts +4 -14
  66. package/src/Errors.ts +2 -12
  67. package/src/OAuth/OAuth.ts +27 -37
  68. package/src/OAuth/oauthStorage.native.ts +2 -12
  69. package/src/OAuth/oauthStorage.ts +2 -12
  70. package/src/OAuth/urlOpener.native.ts +2 -12
  71. package/src/OAuth/urlOpener.ts +2 -12
  72. package/src/index.ts +2 -12
  73. package/src/types/Auth.ts +2 -12
  74. package/src/types/index.ts +2 -12
  75. package/src/urlListener.native.ts +2 -12
  76. package/src/urlListener.ts +2 -12
  77. package/build.js +0 -5
  78. package/dist/aws-amplify-auth.js +0 -14708
  79. package/dist/aws-amplify-auth.js.map +0 -1
  80. package/dist/aws-amplify-auth.min.js +0 -44
  81. package/dist/aws-amplify-auth.min.js.map +0 -1
  82. package/index.js +0 -7
  83. package/testSequencer.js +0 -24
  84. package/webpack.config.dev.js +0 -6
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  export var CognitoHostedUIIdentityProvider;
14
4
  (function (CognitoHostedUIIdentityProvider) {
15
5
  CognitoHostedUIIdentityProvider["Cognito"] = "COGNITO";
@@ -1 +1 @@
1
- {"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/types/Auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6CH,MAAM,CAAN,IAAY,+BAMX;AAND,WAAY,+BAA+B;IAC1C,sDAAmB,CAAA;IACnB,oDAAiB,CAAA;IACjB,wDAAqB,CAAA;IACrB,6DAA0B,CAAA;IAC1B,4DAAyB,CAAA;AAC1B,CAAC,EANW,+BAA+B,KAA/B,+BAA+B,QAM1C;AAmBD,MAAM,UAAU,wBAAwB,CACvC,GAAQ;IAER,IAAM,IAAI,GAAqC,CAAC,UAAU,CAAC,CAAC;IAC5D,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAArB,CAAqB,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,U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N,IAAY,cAgBX;AAhBD,WAAY,cAAc;IACzB,uCAAqB,CAAA;IACrB,yDAAuC,CAAA;IACvC,iDAA+B,CAAA;IAC/B,qDAAmC,CAAA;IACnC,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,qCAAmB,CAAA;IACnB,+CAA6B,CAAA;IAC7B,+CAA6B,CAAA;IAC7B,qDAAmC,CAAA;AACpC,CAAC,EAhBW,cAAc,KAAd,cAAc,QAgBzB;AAkBD,MAAM,UAAU,sBAAsB,CAAC,GAAQ;IAC9C,OAAO,CAAC,CAAE,GAA4B,CAAC,QAAQ,CAAC;AACjD,CAAC;AAaD,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC5B,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,4EAAuD,CAAA;IACvD,8CAAyB,CAAA;AAC1B,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B"}
@@ -1,14 +1,4 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  export * from './Auth';
14
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,cAAc,QAAQ,CAAC"}
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { browserOrNode } from '@aws-amplify/core';
14
4
  export default (function (callback) {
15
5
  if (browserOrNode().isBrowser && window.location) {
@@ -1 +1 @@
1
- {"version":3,"file":"urlListener.js","sourceRoot":"","sources":["../src/urlListener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,gBAAe,UAAA,QAAQ;IACtB,IAAI,aAAa,EAAE,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE;QACjD,IAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEjC,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;KAClB;SAAM,IAAI,aAAa,EAAE,CAAC,MAAM,EAAE;QAClC,2BAA2B;QAC3B,CAAA,cAAO,CAAC,CAAA,CAAC,CAAC,OAAO;KACjB;SAAM;QACN,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;KACjC;AACF,CAAC,EAAC"}
1
+ {"version":3,"file":"urlListener.js","sourceRoot":"","sources":["../src/urlListener.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,gBAAe,UAAA,QAAQ;IACtB,IAAI,aAAa,EAAE,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE;QACjD,IAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEjC,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;KAClB;SAAM,IAAI,aAAa,EAAE,CAAC,MAAM,EAAE;QAClC,2BAA2B;QAC3B,CAAA,cAAO,CAAC,CAAA,CAAC,CAAC,OAAO;KACjB;SAAM;QACN,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;KACjC;AACF,CAAC,EAAC"}
@@ -1,73 +1,6 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __rest = (this && this.__rest) || function (s, e) {
49
- var t = {};
50
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- };
59
- /*
60
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
61
- *
62
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
63
- * the License. A copy of the License is located at
64
- *
65
- * http://aws.amazon.com/apache2.0/
66
- *
67
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
68
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
69
- * and limitations under the License.
70
- */
1
+ import { __assign, __awaiter, __generator, __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
71
4
  import { ConsoleLogger as Logger } from '@aws-amplify/core';
72
5
  var logger = new Logger('urlListener');
73
6
  var handler;
@@ -1 +1 @@
1
- {"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzC,IAAI,OAAO,CAAC;AAEZ,gBAAe,UAAM,QAAQ;;;;;QAC5B,IAAI,OAAO,EAAE;YACZ,sBAAO;SACP;QAKD,IAAI;YACH,CAAC,4BAA+C,EAA7C,oBAAO,EAAE,sBAAQ,CAA6B,CAAC;SAClD;QAAC,OAAO,KAAK,EAAE;YACf,wBAAwB;SACxB;QAED,OAAO;YACN,OAAO;gBACP,CAAC,UAAC,EAAiC;oBAA/B,IAAA,YAAG,EAAE,0BAAO;oBACf,MAAM,CAAC,KAAK,CAAC,aAAa,aAAI,GAAG,KAAA,IAAK,IAAI,EAAG,CAAC;oBAC9C,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;QAEJ,oGAAoG;QACpG,IAAI,OAAO,CAAC,mBA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AAC;oBAC9C,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;QAEJ,oGAAoG;QACpG,IAAI,OAAO,CAAC,mBAAmB,KAAK,OAAO,UAAU,EAAE;YACtD,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACzC;aAAM;YACN,kDAAkD;YAClD,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,+CAApB,YAAY,EAAa;YACzB,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACxD;QACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAM,WAAW;;;;;6BAChD,CAAA,WAAW,KAAK,QAAQ,CAAA,EAAxB,wBAAwB;wBACR,qBAAM,OAAO,CAAC,aAAa,EAAE,EAAA;;wBAA1C,UAAU,GAAG,SAA6B;wBAChD,OAAO,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;;;;;aAE9B,CAAC,CAAC;;;KACH,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/auth",
3
- "version": "4.6.14-unstable.4+903a6400c",
3
+ "version": "4.6.15-unstable.2+55e13f5a7",
4
4
  "description": "Auth category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -9,11 +9,8 @@
9
9
  "./lib/index": "./lib-esm/index.js"
10
10
  },
11
11
  "sideEffects": [
12
- "./src/Auth.ts",
13
12
  "./lib/Auth.js",
14
- "./lib-esm/Auth.js",
15
- "./dist/aws-amplify-auth.js",
16
- "./dist/aws-amplify-auth.min.js"
13
+ "./lib-esm/Auth.js"
17
14
  ],
18
15
  "publishConfig": {
19
16
  "access": "public"
@@ -28,7 +25,8 @@
28
25
  "build": "npm run clean && npm run build:esm && npm run build:cjs",
29
26
  "clean": "rimraf lib-esm lib dist",
30
27
  "format": "echo \"Not implemented\"",
31
- "lint": "tslint '{__tests__,src}/**/*.ts'"
28
+ "lint": "tslint '{__tests__,src}/**/*.ts' && npm run ts-coverage",
29
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 77.44"
32
30
  },
33
31
  "repository": {
34
32
  "type": "git",
@@ -40,11 +38,15 @@
40
38
  "url": "https://github.com/aws/aws-amplify/issues"
41
39
  },
42
40
  "homepage": "https://aws-amplify.github.io/",
41
+ "files": [
42
+ "lib",
43
+ "lib-esm",
44
+ "src"
45
+ ],
43
46
  "dependencies": {
44
- "@aws-amplify/cache": "4.0.63-unstable.4+903a6400c",
45
- "@aws-amplify/core": "4.7.12-unstable.4+903a6400c",
46
- "amazon-cognito-identity-js": "5.2.13-unstable.10+903a6400c",
47
- "crypto-js": "^4.1.1"
47
+ "@aws-amplify/core": "4.7.13-unstable.2+55e13f5a7",
48
+ "amazon-cognito-identity-js": "5.2.13-unstable.11+55e13f5a7",
49
+ "tslib": "^1.8.0"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@jest/test-sequencer": "^24.9.0"
@@ -95,5 +97,5 @@
95
97
  ],
96
98
  "testSequencer": "./testSequencer.js"
97
99
  },
98
- "gitHead": "903a6400c04cdc1a60a920d96977a14df412507f"
100
+ "gitHead": "55e13f5a77488793f97b9c7ffe963aaa0c687884"
99
101
  }
package/src/Auth.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import {
15
5
  AuthOptions,
@@ -40,8 +30,8 @@ import {
40
30
  Hub,
41
31
  StorageHelper,
42
32
  ICredentials,
43
- Parser,
44
33
  browserOrNode,
34
+ parseAWSExports,
45
35
  UniversalStorage,
46
36
  urlSafeDecode,
47
37
  HubCallback,
@@ -150,7 +140,7 @@ export class AuthClass {
150
140
  const conf = Object.assign(
151
141
  {},
152
142
  this._config,
153
- Parser.parseMobilehubConfig(config).Auth,
143
+ parseAWSExports(config).Auth,
154
144
  config
155
145
  );
156
146
  this._config = conf;
package/src/Errors.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { AuthErrorMessages, AuthErrorTypes } from './types';
15
5
  import { ConsoleLogger as Logger } from '@aws-amplify/core';
@@ -1,19 +1,10 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI
15
5
  import { launchUri } from './urlOpener';
16
6
  import * as oAuthStorage from './oauthStorage';
7
+ import { Buffer } from 'buffer';
17
8
 
18
9
  import {
19
10
  OAuthOpts,
@@ -23,13 +14,12 @@ import {
23
14
 
24
15
  import { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core';
25
16
 
26
- import sha256 from 'crypto-js/sha256';
27
- import Base64 from 'crypto-js/enc-base64';
28
-
29
- const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&
30
- typeof Symbol.for === 'function'
31
- ? Symbol.for('amplify_default')
32
- : '@@amplify_default') as Symbol;
17
+ import { Sha256 } from '@aws-crypto/sha256-js';
18
+ const AMPLIFY_SYMBOL = (
19
+ typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
20
+ ? Symbol.for('amplify_default')
21
+ : '@@amplify_default'
22
+ ) as Symbol;
33
23
 
34
24
  const dispatchAuthEvent = (event: string, data: any, message: string) => {
35
25
  Hub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL);
@@ -169,18 +159,15 @@ export default class OAuth {
169
159
  .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
170
160
  .join('&');
171
161
 
172
- const {
173
- access_token,
174
- refresh_token,
175
- id_token,
176
- error,
177
- } = await ((await fetch(oAuthTokenEndpoint, {
178
- method: 'POST',
179
- headers: {
180
- 'Content-Type': 'application/x-www-form-urlencoded',
181
- },
182
- body,
183
- })) as any).json();
162
+ const { access_token, refresh_token, id_token, error } = await (
163
+ (await fetch(oAuthTokenEndpoint, {
164
+ method: 'POST',
165
+ headers: {
166
+ 'Content-Type': 'application/x-www-form-urlencoded',
167
+ },
168
+ body,
169
+ })) as any
170
+ ).json();
184
171
 
185
172
  if (error) {
186
173
  throw new Error(error);
@@ -305,15 +292,18 @@ export default class OAuth {
305
292
  }
306
293
 
307
294
  private _generateChallenge(code: string) {
308
- return this._base64URL(sha256(code));
295
+ const awsCryptoHash = new Sha256();
296
+ awsCryptoHash.update(code);
297
+
298
+ const resultFromAWSCrypto = awsCryptoHash.digestSync();
299
+ const b64 = Buffer.from(resultFromAWSCrypto).toString('base64');
300
+ const base64URLFromAWSCrypto = this._base64URL(b64);
301
+
302
+ return base64URLFromAWSCrypto;
309
303
  }
310
304
 
311
305
  private _base64URL(string) {
312
- return string
313
- .toString(Base64)
314
- .replace(/=/g, '')
315
- .replace(/\+/g, '-')
316
- .replace(/\//g, '_');
306
+ return string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
317
307
  }
318
308
 
319
309
  private _generateRandom(size: number) {
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  const obj: {
15
5
  oauth_state?: string;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  export const setState = (state: string) => {
15
5
  window.sessionStorage.setItem('oauth_state', state);
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { Linking } from 'react-native';
15
5
 
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  const SELF = '_self';
15
5
 
package/src/index.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { Auth } from './Auth';
15
5
  import {
package/src/types/Auth.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import {
15
5
  ICookieStorageData,
@@ -1,14 +1,4 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  export * from './Auth';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { ConsoleLogger as Logger } from '@aws-amplify/core';
14
4
  const logger = new Logger('urlListener');
15
5
 
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { browserOrNode } from '@aws-amplify/core';
14
4
 
15
5
  export default callback => {
package/build.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const build = require('../../scripts/build');
4
-
5
- build(process.argv[2], process.argv[3]);