@aws-amplify/auth 4.6.15-unstable.2 → 4.6.15
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/CHANGELOG.md +16 -0
- package/build.js +5 -0
- package/dist/aws-amplify-auth.js +14707 -0
- package/dist/aws-amplify-auth.js.map +1 -0
- package/dist/aws-amplify-auth.min.js +43 -0
- package/dist/aws-amplify-auth.min.js.map +1 -0
- package/index.js +7 -0
- package/lib/Auth.js +140 -65
- package/lib/Auth.js.map +1 -1
- package/lib/Errors.js +27 -5
- package/lib/Errors.js.map +1 -1
- package/lib/OAuth/OAuth.js +118 -36
- package/lib/OAuth/OAuth.js.map +1 -1
- package/lib/OAuth/oauthStorage.js +12 -2
- package/lib/OAuth/oauthStorage.js.map +1 -1
- package/lib/OAuth/oauthStorage.native.js +12 -2
- package/lib/OAuth/oauthStorage.native.js.map +1 -1
- package/lib/OAuth/urlOpener.js +12 -2
- package/lib/OAuth/urlOpener.js.map +1 -1
- package/lib/OAuth/urlOpener.native.js +12 -2
- package/lib/OAuth/urlOpener.native.js.map +1 -1
- package/lib/index.js +12 -2
- package/lib/index.js.map +1 -1
- package/lib/types/Auth.js +12 -2
- package/lib/types/Auth.js.map +1 -1
- package/lib/types/index.js +16 -4
- package/lib/types/index.js.map +1 -1
- package/lib/urlListener.js +12 -2
- package/lib/urlListener.js.map +1 -1
- package/lib/urlListener.native.js +76 -9
- package/lib/urlListener.native.js.map +1 -1
- package/lib-esm/Auth.js +77 -5
- package/lib-esm/Auth.js.map +1 -1
- package/lib-esm/Errors.js +25 -3
- package/lib-esm/Errors.js.map +1 -1
- package/lib-esm/OAuth/OAuth.js +85 -13
- package/lib-esm/OAuth/OAuth.js.map +1 -1
- package/lib-esm/OAuth/oauthStorage.js +12 -2
- package/lib-esm/OAuth/oauthStorage.js.map +1 -1
- package/lib-esm/OAuth/oauthStorage.native.js +12 -2
- package/lib-esm/OAuth/oauthStorage.native.js.map +1 -1
- package/lib-esm/OAuth/urlOpener.js +12 -2
- package/lib-esm/OAuth/urlOpener.js.map +1 -1
- package/lib-esm/OAuth/urlOpener.native.js +12 -2
- package/lib-esm/OAuth/urlOpener.native.js.map +1 -1
- package/lib-esm/index.js +12 -2
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/Auth.js +12 -2
- package/lib-esm/types/Auth.js.map +1 -1
- package/lib-esm/types/index.js +12 -2
- package/lib-esm/types/index.js.map +1 -1
- package/lib-esm/urlListener.js +12 -2
- package/lib-esm/urlListener.js.map +1 -1
- package/lib-esm/urlListener.native.js +70 -3
- package/lib-esm/urlListener.native.js.map +1 -1
- package/package.json +11 -13
- package/src/Auth.ts +14 -4
- package/src/Errors.ts +12 -2
- package/src/OAuth/OAuth.ts +37 -27
- package/src/OAuth/oauthStorage.native.ts +12 -2
- package/src/OAuth/oauthStorage.ts +12 -2
- package/src/OAuth/urlOpener.native.ts +12 -2
- package/src/OAuth/urlOpener.ts +12 -2
- package/src/index.ts +12 -2
- package/src/types/Auth.ts +12 -2
- package/src/types/index.ts +12 -2
- package/src/urlListener.native.ts +12 -2
- package/src/urlListener.ts +12 -2
- package/testSequencer.js +24 -0
- package/webpack.config.dev.js +6 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/Auth.d.ts +0 -301
- package/lib/Errors.d.ts +0 -9
- package/lib/OAuth/OAuth.d.ts +0 -29
- package/lib/OAuth/oauthStorage.d.ts +0 -5
- package/lib/OAuth/oauthStorage.native.d.ts +0 -5
- package/lib/OAuth/urlOpener.d.ts +0 -1
- package/lib/OAuth/urlOpener.native.d.ts +0 -1
- package/lib/common/AuthErrorStrings.d.ts +0 -17
- package/lib/index.d.ts +0 -9
- package/lib/types/Auth.d.ts +0 -170
- package/lib/types/index.d.ts +0 -1
- package/lib/urlListener.d.ts +0 -2
- package/lib/urlListener.native.d.ts +0 -2
- package/lib-esm/.tsbuildinfo +0 -3
package/lib-esm/types/Auth.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
export var CognitoHostedUIIdentityProvider;
|
|
4
14
|
(function (CognitoHostedUIIdentityProvider) {
|
|
5
15
|
CognitoHostedUIIdentityProvider["Cognito"] = "COGNITO";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/types/Auth.ts"],"names":[],"mappings":"AAAA
|
|
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,UAAU,8BAA8B,CAC7C,GAAQ;IAER,IAAM,IAAI,GAA2C,CAAC,gBAAgB,CAAC,CAAC;IACxE,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,UAAU,cAAc,CAAC,GAAQ;IACtC,IAAM,IAAI,GAGH,CAAC,aAAa,CAAC,CAAC;IACvB,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;AAyCD,MAAM,UAAU,mBAAmB,CAClC,KAAgB;IAEhB,OAA6B,KAAM,CAAC,cAAc,KAAK,SAAS,CAAC;AAClE,CAAC;AA4CD,MAAM,CAAN,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"}
|
package/lib-esm/types/index.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
export * from './Auth';
|
|
4
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,QAAQ,CAAC"}
|
package/lib-esm/urlListener.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
import { browserOrNode } from '@aws-amplify/core';
|
|
4
14
|
export default (function (callback) {
|
|
5
15
|
if (browserOrNode().isBrowser && window.location) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlListener.js","sourceRoot":"","sources":["../src/urlListener.ts"],"names":[],"mappings":"AAAA
|
|
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,6 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
*/
|
|
4
71
|
import { ConsoleLogger as Logger } from '@aws-amplify/core';
|
|
5
72
|
var logger = new Logger('urlListener');
|
|
6
73
|
var handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":"
|
|
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,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.15
|
|
3
|
+
"version": "4.6.15",
|
|
4
4
|
"description": "Auth category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
"./lib/index": "./lib-esm/index.js"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": [
|
|
12
|
+
"./src/Auth.ts",
|
|
12
13
|
"./lib/Auth.js",
|
|
13
|
-
"./lib-esm/Auth.js"
|
|
14
|
+
"./lib-esm/Auth.js",
|
|
15
|
+
"./dist/aws-amplify-auth.js",
|
|
16
|
+
"./dist/aws-amplify-auth.min.js"
|
|
14
17
|
],
|
|
15
18
|
"publishConfig": {
|
|
16
19
|
"access": "public"
|
|
@@ -25,8 +28,7 @@
|
|
|
25
28
|
"build": "npm run clean && npm run build:esm && npm run build:cjs",
|
|
26
29
|
"clean": "rimraf lib-esm lib dist",
|
|
27
30
|
"format": "echo \"Not implemented\"",
|
|
28
|
-
"lint": "tslint '{__tests__,src}/**/*.ts'
|
|
29
|
-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 77.44"
|
|
31
|
+
"lint": "tslint '{__tests__,src}/**/*.ts'"
|
|
30
32
|
},
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|
|
@@ -38,15 +40,11 @@
|
|
|
38
40
|
"url": "https://github.com/aws/aws-amplify/issues"
|
|
39
41
|
},
|
|
40
42
|
"homepage": "https://aws-amplify.github.io/",
|
|
41
|
-
"files": [
|
|
42
|
-
"lib",
|
|
43
|
-
"lib-esm",
|
|
44
|
-
"src"
|
|
45
|
-
],
|
|
46
43
|
"dependencies": {
|
|
47
|
-
"@aws-amplify/
|
|
48
|
-
"
|
|
49
|
-
"
|
|
44
|
+
"@aws-amplify/cache": "4.0.64",
|
|
45
|
+
"@aws-amplify/core": "4.7.13",
|
|
46
|
+
"amazon-cognito-identity-js": "5.2.13",
|
|
47
|
+
"crypto-js": "^4.1.1"
|
|
50
48
|
},
|
|
51
49
|
"devDependencies": {
|
|
52
50
|
"@jest/test-sequencer": "^24.9.0"
|
|
@@ -97,5 +95,5 @@
|
|
|
97
95
|
],
|
|
98
96
|
"testSequencer": "./testSequencer.js"
|
|
99
97
|
},
|
|
100
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "eaa4317115aaa23a632af7249b3d995e83af6ef3"
|
|
101
99
|
}
|
package/src/Auth.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import {
|
|
5
15
|
AuthOptions,
|
|
@@ -30,8 +40,8 @@ import {
|
|
|
30
40
|
Hub,
|
|
31
41
|
StorageHelper,
|
|
32
42
|
ICredentials,
|
|
43
|
+
Parser,
|
|
33
44
|
browserOrNode,
|
|
34
|
-
parseAWSExports,
|
|
35
45
|
UniversalStorage,
|
|
36
46
|
urlSafeDecode,
|
|
37
47
|
HubCallback,
|
|
@@ -140,7 +150,7 @@ export class AuthClass {
|
|
|
140
150
|
const conf = Object.assign(
|
|
141
151
|
{},
|
|
142
152
|
this._config,
|
|
143
|
-
|
|
153
|
+
Parser.parseMobilehubConfig(config).Auth,
|
|
144
154
|
config
|
|
145
155
|
);
|
|
146
156
|
this._config = conf;
|
package/src/Errors.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { AuthErrorMessages, AuthErrorTypes } from './types';
|
|
5
15
|
import { ConsoleLogger as Logger } from '@aws-amplify/core';
|
package/src/OAuth/OAuth.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI
|
|
5
15
|
import { launchUri } from './urlOpener';
|
|
6
16
|
import * as oAuthStorage from './oauthStorage';
|
|
7
|
-
import { Buffer } from 'buffer';
|
|
8
17
|
|
|
9
18
|
import {
|
|
10
19
|
OAuthOpts,
|
|
@@ -14,12 +23,13 @@ import {
|
|
|
14
23
|
|
|
15
24
|
import { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core';
|
|
16
25
|
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
23
33
|
|
|
24
34
|
const dispatchAuthEvent = (event: string, data: any, message: string) => {
|
|
25
35
|
Hub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL);
|
|
@@ -159,15 +169,18 @@ export default class OAuth {
|
|
|
159
169
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
160
170
|
.join('&');
|
|
161
171
|
|
|
162
|
-
const {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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();
|
|
171
184
|
|
|
172
185
|
if (error) {
|
|
173
186
|
throw new Error(error);
|
|
@@ -292,18 +305,15 @@ export default class OAuth {
|
|
|
292
305
|
}
|
|
293
306
|
|
|
294
307
|
private _generateChallenge(code: string) {
|
|
295
|
-
|
|
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;
|
|
308
|
+
return this._base64URL(sha256(code));
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
private _base64URL(string) {
|
|
306
|
-
return string
|
|
312
|
+
return string
|
|
313
|
+
.toString(Base64)
|
|
314
|
+
.replace(/=/g, '')
|
|
315
|
+
.replace(/\+/g, '-')
|
|
316
|
+
.replace(/\//g, '_');
|
|
307
317
|
}
|
|
308
318
|
|
|
309
319
|
private _generateRandom(size: number) {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
const obj: {
|
|
5
15
|
oauth_state?: string;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
export const setState = (state: string) => {
|
|
5
15
|
window.sessionStorage.setItem('oauth_state', state);
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { Linking } from 'react-native';
|
|
5
15
|
|
package/src/OAuth/urlOpener.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
const SELF = '_self';
|
|
5
15
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { Auth } from './Auth';
|
|
5
15
|
import {
|
package/src/types/Auth.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
import {
|
|
5
15
|
ICookieStorageData,
|
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
|
|
4
14
|
export * from './Auth';
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
import { ConsoleLogger as Logger } from '@aws-amplify/core';
|
|
4
14
|
const logger = new Logger('urlListener');
|
|
5
15
|
|
package/src/urlListener.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
13
|
import { browserOrNode } from '@aws-amplify/core';
|
|
4
14
|
|
|
5
15
|
export default callback => {
|
package/testSequencer.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Sequencer = require('@jest/test-sequencer').default;
|
|
2
|
+
|
|
3
|
+
class CustomSequencer extends Sequencer {
|
|
4
|
+
sort(tests) {
|
|
5
|
+
// Test structure information
|
|
6
|
+
// https://github.com/facebook/jest/blob/6b8b1404a1d9254e7d5d90a8934087a9c9899dab/packages/jest-runner/src/types.ts#L17-L21
|
|
7
|
+
const copyTests = Array.from(tests);
|
|
8
|
+
return copyTests.sort((testA, testB) => {
|
|
9
|
+
// TODO: Remove @jest/test-sequencer
|
|
10
|
+
// `auth-unit-test` currently causes intended side-effects related to `Credentials`
|
|
11
|
+
// which is causing other tests to fail. As a temporary change, we are ordering the tests
|
|
12
|
+
// alphabetically but putting `auth-unit-test` at the end to ensure no other tests
|
|
13
|
+
// are affected.
|
|
14
|
+
if (testA.path.includes('auth-unit-test.ts')) {
|
|
15
|
+
return 1;
|
|
16
|
+
} else if (testB.path.includes('auth-unit-test.ts')) {
|
|
17
|
+
return -1;
|
|
18
|
+
}
|
|
19
|
+
return testA.path > testB.path ? 1 : -1;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = CustomSequencer;
|
package/lib/.tsbuildinfo
DELETED