Showing preview only (1,449K chars total). Download the full file or copy to clipboard to get everything.
Repository: aws/amazon-cognito-identity-js
Branch: master
Commit: 6b87f1a30a99
Files: 73
Total size: 1.4 MB
Directory structure:
gitextract_qifezfr6/
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.yaml
├── .gitignore
├── .npmignore
├── LICENSE.txt
├── NOTICE.txt
├── README.md
├── RNAWSCognito.podspec
├── android/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── java/
│ └── com/
│ └── amazonaws/
│ ├── RNAWSCognitoModule.java
│ └── RNAWSCognitoPackage.java
├── dist/
│ ├── amazon-cognito-identity.js
│ └── aws-cognito-sdk.js
├── enhance-rn.js
├── enhance.js
├── examples/
│ └── babel-webpack/
│ ├── .babelrc
│ ├── .editorconfig
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── src/
│ │ ├── config.js
│ │ └── main.jsx
│ └── webpack.config.babel.js
├── index.d.ts
├── ios/
│ ├── JKBigInteger/
│ │ ├── JKBigDecimal.h
│ │ ├── JKBigDecimal.m
│ │ ├── JKBigInteger.h
│ │ ├── JKBigInteger.m
│ │ └── LibTomMath/
│ │ ├── tommath.c
│ │ ├── tommath.h
│ │ ├── tommath_class.h
│ │ └── tommath_superclass.h
│ ├── RNAWSCognito.h
│ ├── RNAWSCognito.m
│ └── RNAWSCognito.xcodeproj/
│ ├── project.pbxproj
│ └── project.xcworkspace/
│ └── contents.xcworkspacedata
├── lib/
│ ├── AuthenticationDetails.js
│ ├── AuthenticationHelper.js
│ ├── BigInteger.js
│ ├── CognitoAccessToken.js
│ ├── CognitoIdToken.js
│ ├── CognitoJwtToken.js
│ ├── CognitoRefreshToken.js
│ ├── CognitoUser.js
│ ├── CognitoUserAttribute.js
│ ├── CognitoUserPool.js
│ ├── CognitoUserSession.js
│ ├── CookieStorage.js
│ ├── DateHelper.js
│ ├── StorageHelper-rn.js
│ ├── StorageHelper.js
│ └── index.js
├── package.json
├── src/
│ ├── AuthenticationDetails.js
│ ├── AuthenticationHelper.js
│ ├── BigInteger.js
│ ├── CognitoAccessToken.js
│ ├── CognitoIdToken.js
│ ├── CognitoJwtToken.js
│ ├── CognitoRefreshToken.js
│ ├── CognitoUser.js
│ ├── CognitoUserAttribute.js
│ ├── CognitoUserPool.js
│ ├── CognitoUserSession.js
│ ├── CookieStorage.js
│ ├── DateHelper.js
│ ├── StorageHelper-rn.js
│ ├── StorageHelper.js
│ └── index.js
└── webpack.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": [
[
"es2015", {
"loose": true,
"modules": false
}
]
],
"env": {
"commonjs": {
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }]
]
}
}
}
================================================
FILE: .editorconfig
================================================
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[index.d.ts]
indent_style = space
indent_size = 4
================================================
FILE: .eslintignore
================================================
src/BigInteger.js
================================================
FILE: .eslintrc.yaml
================================================
root: true
extends:
- airbnb-base
env:
browser: true
settings:
import/resolver: webpack
rules:
# Git-controlled
linebreak-style: off
# sjcl hmac breaks new-cap
new-cap:
- error
- newIsCapExceptions:
- sjcl.misc.hmac
# Check JSDocs
valid-jsdoc: error
require-jsdoc:
- error
- require:
FunctionDeclaration: true
ClassDeclaration: true
MethodDefinition: true
# Seems this doesn't use import/resolver? import/no-unresolved catches most of these anyway.
# https://github.com/benmosher/eslint-plugin-import/issues/496
import/no-extraneous-dependencies: off
================================================
FILE: .gitignore
================================================
/node_modules/
npm-debug.log
/docs/
es
ios/RNAWSCognito.xcodeproj/xcuserdata/
ios/RNAWSCognito.project.xcworkspace/xcuserdata/
ios/RNAWSCognito.xcodeproj/project.xcworkspace/xcuserdata/
.DS_Store
================================================
FILE: .npmignore
================================================
================================================
FILE: LICENSE.txt
================================================
Amazon Software License
This Amazon Software License (“License”) governs your use, reproduction, and distribution of the accompanying software as specified below.
1. Definitions
“Licensor” means any person or entity that distributes its Work.
“Software” means the original work of authorship made available under this License.
“Work” means the Software and any additions to or derivative works of the Software that are made available under this License.
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work.
Works, including the Software, are “made available” under this License by including in or with the Work either (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License.
2. License Grants
2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form.
2.2 Patent Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free patent license to make, have made, use, sell, offer for sale, import, and otherwise transfer its Work, in whole or in part. The foregoing license applies only to the patent claims licensable by Licensor that would be infringed by Licensor’s Work (or portion thereof) individually and excluding any combinations with any other materials or technology.
3. Limitations
3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you include a complete copy of this License with your distribution, and (c) you retain without modification any copyright, patent, trademark, or attribution notices that are present in the Work.
3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution requirements in Section 3.1) will continue to apply to the Work itself.
3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use with the web services, computing platforms or applications provided by Amazon.com, Inc. or its affiliates, including Amazon Web Services, Inc.
3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then your rights under this License from such Licensor (including the grants in Sections 2.1 and 2.2) will terminate immediately.
3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos, or trademarks, except as necessary to reproduce the notices described in this License.
3.6 Termination. If you violate any term of this License, then your rights under this License (including the grants in Sections 2.1 and 2.2) will terminate immediately.
4. Disclaimer of Warranty.
THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE. SOME STATES’ CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
5. Limitation of Liability.
EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Effective Date – April 18, 2008 © 2008 Amazon.com, Inc. or its affiliates. All rights reserved.
================================================
FILE: NOTICE.txt
================================================
Amazon Cognito Identity Provider SDK for JavaScript
Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
=========================================================================
== JavaScript BN library Notice ==
=========================================================================
This product includes software developed by Tom Wu at Stanford University.
http://www-cs-students.stanford.edu/%7Etjw/jsbn/jsbn.js
=========================================================================
== JKBigInteger library Notice ==
=========================================================================
This product includes the JKBigInteger library licensed under the MIT license.
Copyright (C) 2013 Jānis Kiršteins
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Amazon Cognito Identity SDK for JavaScript
**NOTE: We have discontinued developing this library as part of this GitHub repository. We will continue to develop it as part of the [AWS Amplify](https://github.com/aws/aws-amplify/tree/master/packages/amazon-cognito-identity-js) GitHub repository. You can still reach us by creating an issue on the AWS Amplify GitHub repository or posting to the Amazon Cognito Identity forums. Versions 1.x will still be available via NPM. Future development will continue on the 2.x versions.**
================================================
FILE: RNAWSCognito.podspec
================================================
# coding: utf-8
Pod::Spec.new do |s|
s.name = "RNAWSCognito"
s.version = "1.29.0"
s.requires_arc = true
s.platforms = { :ios => "8.0" }
s.license = { :file => 'LICENSE.txt' }
s.homepage = "https://github.com/aws/amazon-cognito-identity-js"
s.author = "Amazon"
s.summary = "Amazon Cognito Identity SDK for JavaScript"
s.description = <<-DESC
The Amazon Cognito Identity SDK for JavaScript allows JavaScript enabled applications to sign-up users, authenticate users, view, delete, and update user attributes within the Amazon Cognito Identity service.
DESC
s.source = { :git => "https://github.com/aws/amazon-cognito-identity-js.git", :tag => s.version.to_s }
s.source_files = 'ios/RNAWSCognito.{h,m}'
s.dependency 'JKBigInteger2', '0.0.5'
end
================================================
FILE: android/build.gradle
================================================
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.facebook.react:react-native:+'
}
================================================
FILE: android/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws">
</manifest>
================================================
FILE: android/src/main/java/com/amazonaws/RNAWSCognitoModule.java
================================================
package com.amazonaws;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.Callback;
import java.math.BigInteger;
public class RNAWSCognitoModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
private static final String HEX_N = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"
+ "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
+ "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"
+ "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"
+ "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"
+ "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"
+ "83655D23DCA3AD961C62F356208552BB9ED529077096966D"
+ "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
+ "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9"
+ "DE2BCBF6955817183995497CEA956AE515D2261898FA0510"
+ "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64"
+ "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7"
+ "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B"
+ "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C"
+ "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31"
+ "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF";
private static final BigInteger N = new BigInteger(HEX_N, 16);
public RNAWSCognitoModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "RNAWSCognito";
}
@ReactMethod
public void computeModPow(final ReadableMap values, final Callback callback) {
try {
final BigInteger target = new BigInteger(values.getString("target"), 16);
final BigInteger value = new BigInteger(values.getString("value"), 16);
final BigInteger modifier = new BigInteger(values.getString("modifier"), 16);
final BigInteger result = target.modPow(value, modifier);
callback.invoke(null, result.toString(16));
} catch (final Exception e) {
callback.invoke(e.getMessage(), null);
}
}
@ReactMethod
public void computeS(final ReadableMap values, final Callback callback) {
try {
final BigInteger g = new BigInteger(values.getString("g"), 16);
final BigInteger x = new BigInteger(values.getString("x"), 16);
final BigInteger k = new BigInteger(values.getString("k"), 16);
final BigInteger a = new BigInteger(values.getString("a"), 16);
final BigInteger b = new BigInteger(values.getString("b"), 16);
final BigInteger u = new BigInteger(values.getString("u"), 16);
final BigInteger exp = a.add(u.multiply(x));
final BigInteger base = b.subtract(k.multiply(g.modPow(x, N)));
final BigInteger result = base.modPow(exp, N).mod(N);
callback.invoke(null, result.toString(16));
} catch (final Exception e) {
callback.invoke(e.getMessage(), null);
}
}
}
================================================
FILE: android/src/main/java/com/amazonaws/RNAWSCognitoPackage.java
================================================
package com.amazonaws;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.bridge.JavaScriptModule;
public class RNAWSCognitoPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new RNAWSCognitoModule(reactContext));
}
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
================================================
FILE: dist/amazon-cognito-identity.js
================================================
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("aws-sdk/global"), require("aws-sdk/clients/cognitoidentityserviceprovider"));
else if(typeof define === 'function' && define.amd)
define(["aws-sdk/global", "aws-sdk/clients/cognitoidentityserviceprovider"], factory);
else if(typeof exports === 'object')
exports["AmazonCognitoIdentity"] = factory(require("aws-sdk/global"), require("aws-sdk/clients/cognitoidentityserviceprovider"));
else
root["AmazonCognitoIdentity"] = factory(root["AWSCognito"], root["AWSCognito"]["CognitoIdentityServiceProvider"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_13__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _src = __webpack_require__(17);
Object.keys(_src).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _src[key];
}
});
});
var _cognitoidentityserviceprovider = __webpack_require__(13);
var _cognitoidentityserviceprovider2 = _interopRequireDefault(_cognitoidentityserviceprovider);
var enhancements = _interopRequireWildcard(_src);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
Object.keys(enhancements).forEach(function (key) {
_cognitoidentityserviceprovider2.default[key] = enhancements[key];
});
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _global = __webpack_require__(1);
var _BigInteger = __webpack_require__(3);
var _BigInteger2 = _interopRequireDefault(_BigInteger);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
var initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';
var newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';
/** @class */
var AuthenticationHelper = function () {
/**
* Constructs a new AuthenticationHelper object
* @param {string} PoolName Cognito user pool name.
*/
function AuthenticationHelper(PoolName) {
_classCallCheck(this, AuthenticationHelper);
this.N = new _BigInteger2.default(initN, 16);
this.g = new _BigInteger2.default('2', 16);
this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16);
this.smallAValue = this.generateRandomSmallA();
this.getLargeAValue(function () {});
this.infoBits = new _global.util.Buffer('Caldera Derived Key', 'utf8');
this.poolName = PoolName;
}
/**
* @returns {BigInteger} small A, a random number
*/
AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() {
return this.smallAValue;
};
/**
* @param {nodeCallback<BigInteger>} callback Called with (err, largeAValue)
* @returns {void}
*/
AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) {
var _this = this;
if (this.largeAValue) {
callback(null, this.largeAValue);
} else {
this.calculateA(this.smallAValue, function (err, largeAValue) {
if (err) {
callback(err, null);
}
_this.largeAValue = largeAValue;
callback(null, _this.largeAValue);
});
}
};
/**
* helper function to generate a random big integer
* @returns {BigInteger} a random value.
* @private
*/
AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() {
var hexRandom = _global.util.crypto.lib.randomBytes(128).toString('hex');
var randomBigInt = new _BigInteger2.default(hexRandom, 16);
var smallABigInt = randomBigInt.mod(this.N);
return smallABigInt;
};
/**
* helper function to generate a random string
* @returns {string} a random value.
* @private
*/
AuthenticationHelper.prototype.generateRandomString = function generateRandomString() {
return _global.util.crypto.lib.randomBytes(40).toString('base64');
};
/**
* @returns {string} Generated random value included in password hash.
*/
AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() {
return this.randomPassword;
};
/**
* @returns {string} Generated random value included in devices hash.
*/
AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() {
return this.SaltToHashDevices;
};
/**
* @returns {string} Value used to verify devices.
*/
AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() {
return this.verifierDevices;
};
/**
* Generate salts and compute verifier.
* @param {string} deviceGroupKey Devices to generate verifier for.
* @param {string} username User to generate verifier for.
* @param {nodeCallback<null>} callback Called with (err, null)
* @returns {void}
*/
AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {
var _this2 = this;
this.randomPassword = this.generateRandomString();
var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword;
var hashedString = this.hash(combinedString);
var hexRandom = _global.util.crypto.lib.randomBytes(16).toString('hex');
this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16));
this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {
if (err) {
callback(err, null);
}
_this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);
callback(null, null);
});
};
/**
* Calculate the client's public value A = g^a%N
* with the generated random number a
* @param {BigInteger} a Randomly generated small A.
* @param {nodeCallback<BigInteger>} callback Called with (err, largeAValue)
* @returns {void}
* @private
*/
AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) {
var _this3 = this;
this.g.modPow(a, this.N, function (err, A) {
if (err) {
callback(err, null);
}
if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) {
callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);
}
callback(null, A);
});
};
/**
* Calculate the client's value U which is the hash of A and B
* @param {BigInteger} A Large A value.
* @param {BigInteger} B Server B value.
* @returns {BigInteger} Computed U value.
* @private
*/
AuthenticationHelper.prototype.calculateU = function calculateU(A, B) {
this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));
var finalU = new _BigInteger2.default(this.UHexHash, 16);
return finalU;
};
/**
* Calculate a hash from a bitArray
* @param {Buffer} buf Value to hash.
* @returns {String} Hex-encoded hash.
* @private
*/
AuthenticationHelper.prototype.hash = function hash(buf) {
var hashHex = _global.util.crypto.sha256(buf, 'hex');
return new Array(64 - hashHex.length).join('0') + hashHex;
};
/**
* Calculate a hash from a hex string
* @param {String} hexStr Value to hash.
* @returns {String} Hex-encoded hash.
* @private
*/
AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) {
return this.hash(new _global.util.Buffer(hexStr, 'hex'));
};
/**
* Standard hkdf algorithm
* @param {Buffer} ikm Input key material.
* @param {Buffer} salt Salt value.
* @returns {Buffer} Strong key material.
* @private
*/
AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) {
var prk = _global.util.crypto.hmac(salt, ikm, 'buffer', 'sha256');
var infoBitsUpdate = _global.util.buffer.concat([this.infoBits, new _global.util.Buffer(String.fromCharCode(1), 'utf8')]);
var hmac = _global.util.crypto.hmac(prk, infoBitsUpdate, 'buffer', 'sha256');
return hmac.slice(0, 16);
};
/**
* Calculates the final hkdf based on computed S value, and computed U value and the key
* @param {String} username Username.
* @param {String} password Password.
* @param {BigInteger} serverBValue Server B value.
* @param {BigInteger} salt Generated salt.
* @param {nodeCallback<Buffer>} callback Called with (err, hkdfValue)
* @returns {void}
*/
AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {
var _this4 = this;
if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) {
throw new Error('B cannot be zero.');
}
this.UValue = this.calculateU(this.largeAValue, serverBValue);
if (this.UValue.equals(_BigInteger2.default.ZERO)) {
throw new Error('U cannot be zero.');
}
var usernamePassword = '' + this.poolName + username + ':' + password;
var usernamePasswordHash = this.hash(usernamePassword);
var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);
this.calculateS(xValue, serverBValue, function (err, sValue) {
if (err) {
callback(err, null);
}
var hkdf = _this4.computehkdf(new _global.util.Buffer(_this4.padHex(sValue), 'hex'), new _global.util.Buffer(_this4.padHex(_this4.UValue.toString(16)), 'hex'));
callback(null, hkdf);
});
};
/**
* Calculates the S value used in getPasswordAuthenticationKey
* @param {BigInteger} xValue Salted password hash value.
* @param {BigInteger} serverBValue Server B value.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) {
var _this5 = this;
this.g.modPow(xValue, this.N, function (err, gModPowXN) {
if (err) {
callback(err, null);
}
var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));
intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {
if (err2) {
callback(err2, null);
}
callback(null, result.mod(_this5.N));
});
});
};
/**
* Return constant newPasswordRequiredChallengeUserAttributePrefix
* @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value
*/
AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {
return newPasswordRequiredChallengeUserAttributePrefix;
};
/**
* Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing
* @param {BigInteger|String} bigInt Number or string to pad.
* @returns {String} Padded hex string.
*/
AuthenticationHelper.prototype.padHex = function padHex(bigInt) {
var hashStr = bigInt.toString(16);
if (hashStr.length % 2 === 1) {
hashStr = '0' + hashStr;
} else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {
hashStr = '00' + hashStr;
}
return hashStr;
};
return AuthenticationHelper;
}();
exports.default = AuthenticationHelper;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/
//
// All public methods have been removed except the following:
// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)
// toString (only radix 2, 4, 8, 16 and 32 supported)
// negate
// abs
// compareTo
// bitLength
// mod
// equals
// add
// subtract
// multiply
// divide
// modPow
exports.default = BigInteger;
/*
* Copyright (c) 2003-2005 Tom Wu
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* In addition, the following condition applies:
*
* All redistributions must retain an intact copy of this copyright notice
* and disclaimer.
*/
// (public) Constructor
function BigInteger(a, b) {
if (a != null) this.fromString(a, b);
}
// return new, unset BigInteger
function nbi() {
return new BigInteger(null);
}
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = (canary & 0xffffff) == 0xefcafe;
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i, x, w, j, c, n) {
while (--n >= 0) {
var v = x * this[i++] + w[j] + c;
c = Math.floor(v / 0x4000000);
w[j++] = v & 0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i, x, w, j, c, n) {
var xl = x & 0x7fff,
xh = x >> 15;
while (--n >= 0) {
var l = this[i] & 0x7fff;
var h = this[i++] >> 15;
var m = xh * l + h * xl;
l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);
c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);
w[j++] = l & 0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i, x, w, j, c, n) {
var xl = x & 0x3fff,
xh = x >> 14;
while (--n >= 0) {
var l = this[i] & 0x3fff;
var h = this[i++] >> 14;
var m = xh * l + h * xl;
l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;
c = (l >> 28) + (m >> 14) + xh * h;
w[j++] = l & 0xfffffff;
}
return c;
}
var inBrowser = typeof navigator !== "undefined";
if (inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer") {
BigInteger.prototype.am = am2;
dbits = 30;
} else if (inBrowser && j_lm && navigator.appName != "Netscape") {
BigInteger.prototype.am = am1;
dbits = 26;
} else {
// Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = (1 << dbits) - 1;
BigInteger.prototype.DV = 1 << dbits;
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2, BI_FP);
BigInteger.prototype.F1 = BI_FP - dbits;
BigInteger.prototype.F2 = 2 * dbits - BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr, vv;
rr = "0".charCodeAt(0);
for (vv = 0; vv <= 9; ++vv) {
BI_RC[rr++] = vv;
}rr = "a".charCodeAt(0);
for (vv = 10; vv < 36; ++vv) {
BI_RC[rr++] = vv;
}rr = "A".charCodeAt(0);
for (vv = 10; vv < 36; ++vv) {
BI_RC[rr++] = vv;
}function int2char(n) {
return BI_RM.charAt(n);
}
function intAt(s, i) {
var c = BI_RC[s.charCodeAt(i)];
return c == null ? -1 : c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for (var i = this.t - 1; i >= 0; --i) {
r[i] = this[i];
}r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = x < 0 ? -1 : 0;
if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;
}
// return bigint initialized to value
function nbv(i) {
var r = nbi();
r.fromInt(i);
return r;
}
// (protected) set from string and radix
function bnpFromString(s, b) {
var k;
if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");
this.t = 0;
this.s = 0;
var i = s.length,
mi = false,
sh = 0;
while (--i >= 0) {
var x = intAt(s, i);
if (x < 0) {
if (s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {
this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;
this[this.t++] = x >> this.DB - sh;
} else this[this.t - 1] |= x << sh;
sh += k;
if (sh >= this.DB) sh -= this.DB;
}
this.clamp();
if (mi) BigInteger.ZERO.subTo(this, this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s & this.DM;
while (this.t > 0 && this[this.t - 1] == c) {
--this.t;
}
}
// (public) return string representation in given radix
function bnToString(b) {
if (this.s < 0) return "-" + this.negate().toString();
var k;
if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");
var km = (1 << k) - 1,
d,
m = false,
r = "",
i = this.t;
var p = this.DB - i * this.DB % k;
if (i-- > 0) {
if (p < this.DB && (d = this[i] >> p) > 0) {
m = true;
r = int2char(d);
}
while (i >= 0) {
if (p < k) {
d = (this[i] & (1 << p) - 1) << k - p;
d |= this[--i] >> (p += this.DB - k);
} else {
d = this[i] >> (p -= k) & km;
if (p <= 0) {
p += this.DB;
--i;
}
}
if (d > 0) m = true;
if (m) r += int2char(d);
}
}
return m ? r : "0";
}
// (public) -this
function bnNegate() {
var r = nbi();
BigInteger.ZERO.subTo(this, r);
return r;
}
// (public) |this|
function bnAbs() {
return this.s < 0 ? this.negate() : this;
}
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s - a.s;
if (r != 0) return r;
var i = this.t;
r = i - a.t;
if (r != 0) return this.s < 0 ? -r : r;
while (--i >= 0) {
if ((r = this[i] - a[i]) != 0) return r;
}return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1,
t;
if ((t = x >>> 16) != 0) {
x = t;
r += 16;
}
if ((t = x >> 8) != 0) {
x = t;
r += 8;
}
if ((t = x >> 4) != 0) {
x = t;
r += 4;
}
if ((t = x >> 2) != 0) {
x = t;
r += 2;
}
if ((t = x >> 1) != 0) {
x = t;
r += 1;
}
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if (this.t <= 0) return 0;
return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n, r) {
var i;
for (i = this.t - 1; i >= 0; --i) {
r[i + n] = this[i];
}for (i = n - 1; i >= 0; --i) {
r[i] = 0;
}r.t = this.t + n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n, r) {
for (var i = n; i < this.t; ++i) {
r[i - n] = this[i];
}r.t = Math.max(this.t - n, 0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n, r) {
var bs = n % this.DB;
var cbs = this.DB - bs;
var bm = (1 << cbs) - 1;
var ds = Math.floor(n / this.DB),
c = this.s << bs & this.DM,
i;
for (i = this.t - 1; i >= 0; --i) {
r[i + ds + 1] = this[i] >> cbs | c;
c = (this[i] & bm) << bs;
}
for (i = ds - 1; i >= 0; --i) {
r[i] = 0;
}r[ds] = c;
r.t = this.t + ds + 1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n, r) {
r.s = this.s;
var ds = Math.floor(n / this.DB);
if (ds >= this.t) {
r.t = 0;
return;
}
var bs = n % this.DB;
var cbs = this.DB - bs;
var bm = (1 << bs) - 1;
r[0] = this[ds] >> bs;
for (var i = ds + 1; i < this.t; ++i) {
r[i - ds - 1] |= (this[i] & bm) << cbs;
r[i - ds] = this[i] >> bs;
}
if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;
r.t = this.t - ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a, r) {
var i = 0,
c = 0,
m = Math.min(a.t, this.t);
while (i < m) {
c += this[i] - a[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
if (a.t < this.t) {
c -= a.s;
while (i < this.t) {
c += this[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
c += this.s;
} else {
c += this.s;
while (i < a.t) {
c -= a[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = c < 0 ? -1 : 0;
if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a, r) {
var x = this.abs(),
y = a.abs();
var i = x.t;
r.t = i + y.t;
while (--i >= 0) {
r[i] = 0;
}for (i = 0; i < y.t; ++i) {
r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);
}r.s = 0;
r.clamp();
if (this.s != a.s) BigInteger.ZERO.subTo(r, r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2 * x.t;
while (--i >= 0) {
r[i] = 0;
}for (i = 0; i < x.t - 1; ++i) {
var c = x.am(i, x[i], r, 2 * i, 0, 1);
if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
r[i + x.t] -= x.DV;
r[i + x.t + 1] = 1;
}
}
if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m, q, r) {
var pm = m.abs();
if (pm.t <= 0) return;
var pt = this.abs();
if (pt.t < pm.t) {
if (q != null) q.fromInt(0);
if (r != null) this.copyTo(r);
return;
}
if (r == null) r = nbi();
var y = nbi(),
ts = this.s,
ms = m.s;
var nsh = this.DB - nbits(pm[pm.t - 1]);
// normalize modulus
if (nsh > 0) {
pm.lShiftTo(nsh, y);
pt.lShiftTo(nsh, r);
} else {
pm.copyTo(y);
pt.copyTo(r);
}
var ys = y.t;
var y0 = y[ys - 1];
if (y0 == 0) return;
var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);
var d1 = this.FV / yt,
d2 = (1 << this.F1) / yt,
e = 1 << this.F2;
var i = r.t,
j = i - ys,
t = q == null ? nbi() : q;
y.dlShiftTo(j, t);
if (r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t, r);
}
BigInteger.ONE.dlShiftTo(ys, t);
t.subTo(y, y);
// "negative" y so we can replace sub with am later
while (y.t < ys) {
y[y.t++] = 0;
}while (--j >= 0) {
// Estimate quotient digit
var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);
if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {
// Try it out
y.dlShiftTo(j, t);
r.subTo(t, r);
while (r[i] < --qd) {
r.subTo(t, r);
}
}
}
if (q != null) {
r.drShiftTo(ys, q);
if (ts != ms) BigInteger.ZERO.subTo(q, q);
}
r.t = ys;
r.clamp();
if (nsh > 0) r.rShiftTo(nsh, r);
// Denormalize remainder
if (ts < 0) BigInteger.ZERO.subTo(r, r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a, null, r);
if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);
return r;
}
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if (this.t < 1) return 0;
var x = this[0];
if ((x & 1) == 0) return 0;
var y = x & 3;
// y == 1/x mod 2^2
y = y * (2 - (x & 0xf) * y) & 0xf;
// y == 1/x mod 2^4
y = y * (2 - (x & 0xff) * y) & 0xff;
// y == 1/x mod 2^8
y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;
// y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = y * (2 - x * y % this.DV) % this.DV;
// y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return y > 0 ? this.DV - y : -y;
}
function bnEquals(a) {
return this.compareTo(a) == 0;
}
// (protected) r = this + a
function bnpAddTo(a, r) {
var i = 0,
c = 0,
m = Math.min(a.t, this.t);
while (i < m) {
c += this[i] + a[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
if (a.t < this.t) {
c += a.s;
while (i < this.t) {
c += this[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
c += this.s;
} else {
c += this.s;
while (i < a.t) {
c += a[i];
r[i++] = c & this.DM;
c >>= this.DB;
}
c += a.s;
}
r.s = c < 0 ? -1 : 0;
if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;
r.t = i;
r.clamp();
}
// (public) this + a
function bnAdd(a) {
var r = nbi();
this.addTo(a, r);
return r;
}
// (public) this - a
function bnSubtract(a) {
var r = nbi();
this.subTo(a, r);
return r;
}
// (public) this * a
function bnMultiply(a) {
var r = nbi();
this.multiplyTo(a, r);
return r;
}
// (public) this / a
function bnDivide(a) {
var r = nbi();
this.divRemTo(a, r, null);
return r;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp & 0x7fff;
this.mph = this.mp >> 15;
this.um = (1 << m.DB - 15) - 1;
this.mt2 = 2 * m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t, r);
r.divRemTo(this.m, null, r);
if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while (x.t <= this.mt2) {
// pad x so am has enough room later
x[x.t++] = 0;
}for (var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i] & 0x7fff;
var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;
// use am to combine the multiply-shift-add into one call
j = i + this.m.t;
x[j] += this.m.am(0, u0, x, i, 0, this.m.t);
// propagate carry
while (x[j] >= x.DV) {
x[j] -= x.DV;
x[++j]++;
}
}
x.clamp();
x.drShiftTo(this.m.t, x);
if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x, r) {
x.squareTo(r);
this.reduce(r);
}
// r = "xy/R mod m"; x,y != r
function montMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
}
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (public) this^e % m (HAC 14.85)
function bnModPow(e, m, callback) {
var i = e.bitLength(),
k,
r = nbv(1),
z = new Montgomery(m);
if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;
// precomputation
var g = new Array(),
n = 3,
k1 = k - 1,
km = (1 << k) - 1;
g[1] = z.convert(this);
if (k > 1) {
var g2 = nbi();
z.sqrTo(g[1], g2);
while (n <= km) {
g[n] = nbi();
z.mulTo(g2, g[n - 2], g[n]);
n += 2;
}
}
var j = e.t - 1,
w,
is1 = true,
r2 = nbi(),
t;
i = nbits(e[j]) - 1;
while (j >= 0) {
if (i >= k1) w = e[j] >> i - k1 & km;else {
w = (e[j] & (1 << i + 1) - 1) << k1 - i;
if (j > 0) w |= e[j - 1] >> this.DB + i - k1;
}
n = k;
while ((w & 1) == 0) {
w >>= 1;
--n;
}
if ((i -= n) < 0) {
i += this.DB;
--j;
}
if (is1) {
// ret == 1, don't bother squaring or multiplying it
g[w].copyTo(r);
is1 = false;
} else {
while (n > 1) {
z.sqrTo(r, r2);
z.sqrTo(r2, r);
n -= 2;
}
if (n > 0) z.sqrTo(r, r2);else {
t = r;
r = r2;
r2 = t;
}
z.mulTo(r2, g[w], r);
}
while (j >= 0 && (e[j] & 1 << i) == 0) {
z.sqrTo(r, r2);
t = r;
r = r2;
r2 = t;
if (--i < 0) {
i = this.DB - 1;
--j;
}
}
}
var result = z.revert(r);
callback(null, result);
return result;
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.addTo = bnpAddTo;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.equals = bnEquals;
BigInteger.prototype.add = bnAdd;
BigInteger.prototype.subtract = bnSubtract;
BigInteger.prototype.multiply = bnMultiply;
BigInteger.prototype.divide = bnDivide;
BigInteger.prototype.modPow = bnModPow;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _CognitoJwtToken2 = __webpack_require__(6);
var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoAccessToken = function (_CognitoJwtToken) {
_inherits(CognitoAccessToken, _CognitoJwtToken);
/**
* Constructs a new CognitoAccessToken object
* @param {string=} AccessToken The JWT access token.
*/
function CognitoAccessToken() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
AccessToken = _ref.AccessToken;
_classCallCheck(this, CognitoAccessToken);
return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || ''));
}
return CognitoAccessToken;
}(_CognitoJwtToken3.default);
exports.default = CognitoAccessToken;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _CognitoJwtToken2 = __webpack_require__(6);
var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoIdToken = function (_CognitoJwtToken) {
_inherits(CognitoIdToken, _CognitoJwtToken);
/**
* Constructs a new CognitoIdToken object
* @param {string=} IdToken The JWT Id token
*/
function CognitoIdToken() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
IdToken = _ref.IdToken;
_classCallCheck(this, CognitoIdToken);
return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || ''));
}
return CognitoIdToken;
}(_CognitoJwtToken3.default);
exports.default = CognitoIdToken;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _global = __webpack_require__(1);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoJwtToken = function () {
/**
* Constructs a new CognitoJwtToken object
* @param {string=} token The JWT token.
*/
function CognitoJwtToken(token) {
_classCallCheck(this, CognitoJwtToken);
// Assign object
this.jwtToken = token || '';
this.payload = this.decodePayload();
}
/**
* @returns {string} the record's token.
*/
CognitoJwtToken.prototype.getJwtToken = function getJwtToken() {
return this.jwtToken;
};
/**
* @returns {int} the token's expiration (exp member).
*/
CognitoJwtToken.prototype.getExpiration = function getExpiration() {
return this.payload.exp;
};
/**
* @returns {int} the token's "issued at" (iat member).
*/
CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() {
return this.payload.iat;
};
/**
* @returns {object} the token's payload.
*/
CognitoJwtToken.prototype.decodePayload = function decodePayload() {
var payload = this.jwtToken.split('.')[1];
try {
return JSON.parse(_global.util.base64.decode(payload).toString('utf8'));
} catch (err) {
return {};
}
};
return CognitoJwtToken;
}();
exports.default = CognitoJwtToken;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoRefreshToken = function () {
/**
* Constructs a new CognitoRefreshToken object
* @param {string=} RefreshToken The JWT refresh token.
*/
function CognitoRefreshToken() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
RefreshToken = _ref.RefreshToken;
_classCallCheck(this, CognitoRefreshToken);
// Assign object
this.token = RefreshToken || '';
}
/**
* @returns {string} the record's token.
*/
CognitoRefreshToken.prototype.getToken = function getToken() {
return this.token;
};
return CognitoRefreshToken;
}();
exports.default = CognitoRefreshToken;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _global = __webpack_require__(1);
var _BigInteger = __webpack_require__(3);
var _BigInteger2 = _interopRequireDefault(_BigInteger);
var _AuthenticationHelper = __webpack_require__(2);
var _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper);
var _CognitoAccessToken = __webpack_require__(4);
var _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken);
var _CognitoIdToken = __webpack_require__(5);
var _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken);
var _CognitoRefreshToken = __webpack_require__(7);
var _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken);
var _CognitoUserSession = __webpack_require__(10);
var _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession);
var _DateHelper = __webpack_require__(11);
var _DateHelper2 = _interopRequireDefault(_DateHelper);
var _CognitoUserAttribute = __webpack_require__(9);
var _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute);
var _StorageHelper = __webpack_require__(12);
var _StorageHelper2 = _interopRequireDefault(_StorageHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/**
* @callback nodeCallback
* @template T result
* @param {*} err The operation failure reason, or null.
* @param {T} result The operation result.
*/
/**
* @callback onFailure
* @param {*} err Failure reason.
*/
/**
* @callback onSuccess
* @template T result
* @param {T} result The operation result.
*/
/**
* @callback mfaRequired
* @param {*} details MFA challenge details.
*/
/**
* @callback customChallenge
* @param {*} details Custom challenge details.
*/
/**
* @callback inputVerificationCode
* @param {*} data Server response.
*/
/**
* @callback authSuccess
* @param {CognitoUserSession} session The new session.
* @param {bool=} userConfirmationNecessary User must be confirmed.
*/
/** @class */
var CognitoUser = function () {
/**
* Constructs a new CognitoUser object
* @param {object} data Creation options
* @param {string} data.Username The user's username.
* @param {CognitoUserPool} data.Pool Pool containing the user.
* @param {object} data.Storage Optional storage object.
*/
function CognitoUser(data) {
_classCallCheck(this, CognitoUser);
if (data == null || data.Username == null || data.Pool == null) {
throw new Error('Username and pool information are required.');
}
this.username = data.Username || '';
this.pool = data.Pool;
this.Session = null;
this.client = data.Pool.client;
this.signInUserSession = null;
this.authenticationFlowType = 'USER_SRP_AUTH';
this.storage = data.Storage || new _StorageHelper2.default().getStorage();
}
/**
* Sets the session for this user
* @param {CognitoUserSession} signInUserSession the session
* @returns {void}
*/
CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) {
this.clearCachedTokens();
this.signInUserSession = signInUserSession;
this.cacheTokens();
};
/**
* @returns {CognitoUserSession} the current session for this user
*/
CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() {
return this.signInUserSession;
};
/**
* @returns {string} the user's username
*/
CognitoUser.prototype.getUsername = function getUsername() {
return this.username;
};
/**
* @returns {String} the authentication flow type
*/
CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() {
return this.authenticationFlowType;
};
/**
* sets authentication flow type
* @param {string} authenticationFlowType New value.
* @returns {void}
*/
CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {
this.authenticationFlowType = authenticationFlowType;
};
/**
* This is used for authenticating the user through the custom authentication flow.
* @param {AuthenticationDetails} authDetails Contains the authentication data
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {customChallenge} callback.customChallenge Custom challenge
* response required to continue.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
*/
CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) {
var _this = this;
var authParameters = authDetails.getAuthParameters();
authParameters.USERNAME = this.username;
var jsonReq = {
AuthFlow: 'CUSTOM_AUTH',
ClientId: this.pool.getClientId(),
AuthParameters: authParameters,
ClientMetadata: authDetails.getValidationData()
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
var challengeName = data.ChallengeName;
var challengeParameters = data.ChallengeParameters;
if (challengeName === 'CUSTOM_CHALLENGE') {
_this.Session = data.Session;
return callback.customChallenge(challengeParameters);
}
_this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);
_this.cacheTokens();
return callback.onSuccess(_this.signInUserSession);
});
};
/**
* This is used for authenticating the user. it calls the AuthenticationHelper for SRP related
* stuff
* @param {AuthenticationDetails} authDetails Contains the authentication data
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {newPasswordRequired} callback.newPasswordRequired new
* password and any required attributes are required to continue
* @param {mfaRequired} callback.mfaRequired MFA code
* required to continue.
* @param {customChallenge} callback.customChallenge Custom challenge
* response required to continue.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
*/
CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) {
var _this2 = this;
var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);
var dateHelper = new _DateHelper2.default();
var serverBValue = void 0;
var salt = void 0;
var authParameters = {};
if (this.deviceKey != null) {
authParameters.DEVICE_KEY = this.deviceKey;
}
authParameters.USERNAME = this.username;
authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {
// getLargeAValue callback start
if (errOnAValue) {
callback.onFailure(errOnAValue);
}
authParameters.SRP_A = aValue.toString(16);
if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {
authParameters.CHALLENGE_NAME = 'SRP_A';
}
var jsonReq = {
AuthFlow: _this2.authenticationFlowType,
ClientId: _this2.pool.getClientId(),
AuthParameters: authParameters,
ClientMetadata: authDetails.getValidationData()
};
if (_this2.getUserContextData(_this2.username)) {
jsonReq.UserContextData = _this2.getUserContextData(_this2.username);
}
_this2.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
var challengeParameters = data.ChallengeParameters;
_this2.username = challengeParameters.USER_ID_FOR_SRP;
serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);
salt = new _BigInteger2.default(challengeParameters.SALT, 16);
_this2.getCachedDeviceKeyAndPassword();
authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {
// getPasswordAuthenticationKey callback start
if (errOnHkdf) {
callback.onFailure(errOnHkdf);
}
var dateNow = dateHelper.getNowString();
var signatureString = _global.util.crypto.hmac(hkdf, _global.util.buffer.concat([new _global.util.Buffer(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), new _global.util.Buffer(_this2.username, 'utf8'), new _global.util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'), new _global.util.Buffer(dateNow, 'utf8')]), 'base64', 'sha256');
var challengeResponses = {};
challengeResponses.USERNAME = _this2.username;
challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;
challengeResponses.TIMESTAMP = dateNow;
challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;
if (_this2.deviceKey != null) {
challengeResponses.DEVICE_KEY = _this2.deviceKey;
}
var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {
return _this2.client.makeUnauthenticatedRequest('respondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {
if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {
challengeResponses.DEVICE_KEY = null;
_this2.deviceKey = null;
_this2.randomPassword = null;
_this2.deviceGroupKey = null;
_this2.clearCachedDeviceKeyAndPassword();
return respondToAuthChallenge(challenge, challengeCallback);
}
return challengeCallback(errChallenge, dataChallenge);
});
};
var jsonReqResp = {
ChallengeName: 'PASSWORD_VERIFIER',
ClientId: _this2.pool.getClientId(),
ChallengeResponses: challengeResponses,
Session: data.Session
};
if (_this2.getUserContextData()) {
jsonReqResp.UserContextData = _this2.getUserContextData();
}
respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {
if (errAuthenticate) {
return callback.onFailure(errAuthenticate);
}
var challengeName = dataAuthenticate.ChallengeName;
if (challengeName === 'NEW_PASSWORD_REQUIRED') {
_this2.Session = dataAuthenticate.Session;
var userAttributes = null;
var rawRequiredAttributes = null;
var requiredAttributes = [];
var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();
if (dataAuthenticate.ChallengeParameters) {
userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);
rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);
}
if (rawRequiredAttributes) {
for (var i = 0; i < rawRequiredAttributes.length; i++) {
requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);
}
}
return callback.newPasswordRequired(userAttributes, requiredAttributes);
}
return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);
});
return undefined;
// getPasswordAuthenticationKey callback end
});
return undefined;
});
// getLargeAValue callback end
});
};
/**
* PRIVATE ONLY: This is an internal only method and should not
* be directly called by the consumers.
* @param {object} dataAuthenticate authentication data
* @param {object} authenticationHelper helper created
* @param {callback} callback passed on from caller
* @returns {void}
*/
CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {
var _this3 = this;
var challengeName = dataAuthenticate.ChallengeName;
var challengeParameters = dataAuthenticate.ChallengeParameters;
if (challengeName === 'SMS_MFA') {
this.Session = dataAuthenticate.Session;
return callback.mfaRequired(challengeName, challengeParameters);
}
if (challengeName === 'SELECT_MFA_TYPE') {
this.Session = dataAuthenticate.Session;
return callback.selectMFAType(challengeName, challengeParameters);
}
if (challengeName === 'MFA_SETUP') {
this.Session = dataAuthenticate.Session;
return callback.mfaSetup(challengeName, challengeParameters);
}
if (challengeName === 'SOFTWARE_TOKEN_MFA') {
this.Session = dataAuthenticate.Session;
return callback.totpRequired(challengeName, challengeParameters);
}
if (challengeName === 'CUSTOM_CHALLENGE') {
this.Session = dataAuthenticate.Session;
return callback.customChallenge(challengeParameters);
}
if (challengeName === 'DEVICE_SRP_AUTH') {
this.getDeviceResponse(callback);
return undefined;
}
this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);
this.cacheTokens();
var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;
if (newDeviceMetadata == null) {
return callback.onSuccess(this.signInUserSession);
}
authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {
if (errGenHash) {
return callback.onFailure(errGenHash);
}
var deviceSecretVerifierConfig = {
Salt: new _global.util.Buffer(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),
PasswordVerifier: new _global.util.Buffer(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')
};
_this3.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;
_this3.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;
_this3.randomPassword = authenticationHelper.getRandomPassword();
_this3.client.makeUnauthenticatedRequest('confirmDevice', {
DeviceKey: newDeviceMetadata.DeviceKey,
AccessToken: _this3.signInUserSession.getAccessToken().getJwtToken(),
DeviceSecretVerifierConfig: deviceSecretVerifierConfig,
DeviceName: navigator.userAgent
}, function (errConfirm, dataConfirm) {
if (errConfirm) {
return callback.onFailure(errConfirm);
}
_this3.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;
_this3.cacheDeviceKeyAndPassword();
if (dataConfirm.UserConfirmationNecessary === true) {
return callback.onSuccess(_this3.signInUserSession, dataConfirm.UserConfirmationNecessary);
}
return callback.onSuccess(_this3.signInUserSession);
});
return undefined;
});
return undefined;
};
/**
* This method is user to complete the NEW_PASSWORD_REQUIRED challenge.
* Pass the new password with any new user attributes to be updated.
* User attribute keys must be of format userAttributes.<attribute_name>.
* @param {string} newPassword new password for this user
* @param {object} requiredAttributeData map with values for all required attributes
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {mfaRequired} callback.mfaRequired MFA code required to continue.
* @param {customChallenge} callback.customChallenge Custom challenge
* response required to continue.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
*/
CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {
var _this4 = this;
if (!newPassword) {
return callback.onFailure(new Error('New password is required.'));
}
var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);
var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();
var finalUserAttributes = {};
if (requiredAttributeData) {
Object.keys(requiredAttributeData).forEach(function (key) {
finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];
});
}
finalUserAttributes.NEW_PASSWORD = newPassword;
finalUserAttributes.USERNAME = this.username;
var jsonReq = {
ChallengeName: 'NEW_PASSWORD_REQUIRED',
ClientId: this.pool.getClientId(),
ChallengeResponses: finalUserAttributes,
Session: this.Session
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {
if (errAuthenticate) {
return callback.onFailure(errAuthenticate);
}
return _this4.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);
});
return undefined;
};
/**
* This is used to get a session using device authentication. It is called at the end of user
* authentication
*
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
* @private
*/
CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) {
var _this5 = this;
var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey);
var dateHelper = new _DateHelper2.default();
var authParameters = {};
authParameters.USERNAME = this.username;
authParameters.DEVICE_KEY = this.deviceKey;
authenticationHelper.getLargeAValue(function (errAValue, aValue) {
// getLargeAValue callback start
if (errAValue) {
callback.onFailure(errAValue);
}
authParameters.SRP_A = aValue.toString(16);
var jsonReq = {
ChallengeName: 'DEVICE_SRP_AUTH',
ClientId: _this5.pool.getClientId(),
ChallengeResponses: authParameters
};
if (_this5.getUserContextData()) {
jsonReq.UserContextData = _this5.getUserContextData();
}
_this5.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
var challengeParameters = data.ChallengeParameters;
var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);
var salt = new _BigInteger2.default(challengeParameters.SALT, 16);
authenticationHelper.getPasswordAuthenticationKey(_this5.deviceKey, _this5.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {
// getPasswordAuthenticationKey callback start
if (errHkdf) {
return callback.onFailure(errHkdf);
}
var dateNow = dateHelper.getNowString();
var signatureString = _global.util.crypto.hmac(hkdf, _global.util.buffer.concat([new _global.util.Buffer(_this5.deviceGroupKey, 'utf8'), new _global.util.Buffer(_this5.deviceKey, 'utf8'), new _global.util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'), new _global.util.Buffer(dateNow, 'utf8')]), 'base64', 'sha256');
var challengeResponses = {};
challengeResponses.USERNAME = _this5.username;
challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;
challengeResponses.TIMESTAMP = dateNow;
challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;
challengeResponses.DEVICE_KEY = _this5.deviceKey;
var jsonReqResp = {
ChallengeName: 'DEVICE_PASSWORD_VERIFIER',
ClientId: _this5.pool.getClientId(),
ChallengeResponses: challengeResponses,
Session: data.Session
};
if (_this5.getUserContextData()) {
jsonReqResp.UserContextData = _this5.getUserContextData();
}
_this5.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {
if (errAuthenticate) {
return callback.onFailure(errAuthenticate);
}
_this5.signInUserSession = _this5.getCognitoUserSession(dataAuthenticate.AuthenticationResult);
_this5.cacheTokens();
return callback.onSuccess(_this5.signInUserSession);
});
return undefined;
// getPasswordAuthenticationKey callback end
});
return undefined;
});
// getLargeAValue callback end
});
};
/**
* This is used for a certain user to confirm the registration by using a confirmation code
* @param {string} confirmationCode Code entered by user.
* @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) {
var jsonReq = {
ClientId: this.pool.getClientId(),
ConfirmationCode: confirmationCode,
Username: this.username,
ForceAliasCreation: forceAliasCreation
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('confirmSignUp', jsonReq, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
};
/**
* This is used by the user once he has the responses to a custom challenge
* @param {string} answerChallenge The custom challange answer.
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {customChallenge} callback.customChallenge
* Custom challenge response required to continue.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
*/
CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) {
var _this6 = this;
var challengeResponses = {};
challengeResponses.USERNAME = this.username;
challengeResponses.ANSWER = answerChallenge;
var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);
this.getCachedDeviceKeyAndPassword();
if (this.deviceKey != null) {
challengeResponses.DEVICE_KEY = this.deviceKey;
}
var jsonReq = {
ChallengeName: 'CUSTOM_CHALLENGE',
ChallengeResponses: challengeResponses,
ClientId: this.pool.getClientId(),
Session: this.Session
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
return _this6.authenticateUserInternal(data, authenticationHelper, callback);
});
};
/**
* This is used by the user once he has an MFA code
* @param {string} confirmationCode The MFA code entered by the user.
* @param {object} callback Result callback map.
* @param {string} mfaType The mfa we are replying to.
* @param {onFailure} callback.onFailure Called on any error.
* @param {authSuccess} callback.onSuccess Called on success with the new session.
* @returns {void}
*/
CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) {
var _this7 = this;
var challengeResponses = {};
challengeResponses.USERNAME = this.username;
challengeResponses.SMS_MFA_CODE = confirmationCode;
var mfaTypeSelection = mfaType || 'SMS_MFA';
if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {
challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;
}
if (this.deviceKey != null) {
challengeResponses.DEVICE_KEY = this.deviceKey;
}
var jsonReq = {
ChallengeName: mfaTypeSelection,
ChallengeResponses: challengeResponses,
ClientId: this.pool.getClientId(),
Session: this.Session
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {
if (err) {
return callback.onFailure(err);
}
var challengeName = dataAuthenticate.ChallengeName;
if (challengeName === 'DEVICE_SRP_AUTH') {
_this7.getDeviceResponse(callback);
return undefined;
}
_this7.signInUserSession = _this7.getCognitoUserSession(dataAuthenticate.AuthenticationResult);
_this7.cacheTokens();
if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {
return callback.onSuccess(_this7.signInUserSession);
}
var authenticationHelper = new _AuthenticationHelper2.default(_this7.pool.getUserPoolId().split('_')[1]);
authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {
if (errGenHash) {
return callback.onFailure(errGenHash);
}
var deviceSecretVerifierConfig = {
Salt: new _global.util.Buffer(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),
PasswordVerifier: new _global.util.Buffer(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')
};
_this7.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;
_this7.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;
_this7.randomPassword = authenticationHelper.getRandomPassword();
_this7.client.makeUnauthenticatedRequest('confirmDevice', {
DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,
AccessToken: _this7.signInUserSession.getAccessToken().getJwtToken(),
DeviceSecretVerifierConfig: deviceSecretVerifierConfig,
DeviceName: navigator.userAgent
}, function (errConfirm, dataConfirm) {
if (errConfirm) {
return callback.onFailure(errConfirm);
}
_this7.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;
_this7.cacheDeviceKeyAndPassword();
if (dataConfirm.UserConfirmationNecessary === true) {
return callback.onSuccess(_this7.signInUserSession, dataConfirm.UserConfirmationNecessary);
}
return callback.onSuccess(_this7.signInUserSession);
});
return undefined;
});
return undefined;
});
};
/**
* This is used by an authenticated user to change the current password
* @param {string} oldUserPassword The current password.
* @param {string} newUserPassword The requested new password.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) {
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('changePassword', {
PreviousPassword: oldUserPassword,
ProposedPassword: newUserPassword,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by an authenticated user to enable MFA for himself
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.enableMFA = function enableMFA(callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback(new Error('User is not authenticated'), null);
}
var mfaOptions = [];
var mfaEnabled = {
DeliveryMedium: 'SMS',
AttributeName: 'phone_number'
};
mfaOptions.push(mfaEnabled);
this.client.makeUnauthenticatedRequest('setUserSettings', {
MFAOptions: mfaOptions,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by an authenticated user to enable MFA for himself
* @param {string[]} smsMfaSettings the sms mfa settings
* @param {string[]} softwareTokenMfaSettings the software token mfa settings
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('setUserMFAPreference', {
SMSMfaSettings: smsMfaSettings,
SoftwareTokenMfaSettings: softwareTokenMfaSettings,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by an authenticated user to disable MFA for himself
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.disableMFA = function disableMFA(callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback(new Error('User is not authenticated'), null);
}
var mfaOptions = [];
this.client.makeUnauthenticatedRequest('setUserSettings', {
MFAOptions: mfaOptions,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by an authenticated user to delete himself
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.deleteUser = function deleteUser(callback) {
var _this8 = this;
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('deleteUser', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
_this8.clearCachedTokens();
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg
*/
/**
* This is used by an authenticated user to change a list of attributes
* @param {AttributeArg[]} attributes A list of the new user attributes.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('updateUserAttributes', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
UserAttributes: attributes
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by an authenticated user to get a list of attributes
* @param {nodeCallback<CognitoUserAttribute[]>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) {
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('getUser', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err, userData) {
if (err) {
return callback(err, null);
}
var attributeList = [];
for (var i = 0; i < userData.UserAttributes.length; i++) {
var attribute = {
Name: userData.UserAttributes[i].Name,
Value: userData.UserAttributes[i].Value
};
var userAttribute = new _CognitoUserAttribute2.default(attribute);
attributeList.push(userAttribute);
}
return callback(null, attributeList);
});
return undefined;
};
/**
* This is used by an authenticated user to get the MFAOptions
* @param {nodeCallback<MFAOptions>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) {
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('getUser', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err, userData) {
if (err) {
return callback(err, null);
}
return callback(null, userData.MFAOptions);
});
return undefined;
};
/**
* This is used by an authenticated user to delete a list of attributes
* @param {string[]} attributeList Names of the attributes to delete.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) {
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
return callback(new Error('User is not authenticated'), null);
}
this.client.makeUnauthenticatedRequest('deleteUserAttributes', {
UserAttributeNames: attributeList,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback(err, null);
}
return callback(null, 'SUCCESS');
});
return undefined;
};
/**
* This is used by a user to resend a confirmation code
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) {
var jsonReq = {
ClientId: this.pool.getClientId(),
Username: this.username
};
this.client.makeUnauthenticatedRequest('resendConfirmationCode', jsonReq, function (err, result) {
if (err) {
return callback(err, null);
}
return callback(null, result);
});
};
/**
* This is used to get a session, either from the session object
* or from the local storage, or by using a refresh token
*
* @param {nodeCallback<CognitoUserSession>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.getSession = function getSession(callback) {
if (this.username == null) {
return callback(new Error('Username is null. Cannot retrieve a new session'), null);
}
if (this.signInUserSession != null && this.signInUserSession.isValid()) {
return callback(null, this.signInUserSession);
}
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;
var idTokenKey = keyPrefix + '.idToken';
var accessTokenKey = keyPrefix + '.accessToken';
var refreshTokenKey = keyPrefix + '.refreshToken';
var clockDriftKey = keyPrefix + '.clockDrift';
if (this.storage.getItem(idTokenKey)) {
var idToken = new _CognitoIdToken2.default({
IdToken: this.storage.getItem(idTokenKey)
});
var accessToken = new _CognitoAccessToken2.default({
AccessToken: this.storage.getItem(accessTokenKey)
});
var refreshToken = new _CognitoRefreshToken2.default({
RefreshToken: this.storage.getItem(refreshTokenKey)
});
var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;
var sessionData = {
IdToken: idToken,
AccessToken: accessToken,
RefreshToken: refreshToken,
ClockDrift: clockDrift
};
var cachedSession = new _CognitoUserSession2.default(sessionData);
if (cachedSession.isValid()) {
this.signInUserSession = cachedSession;
return callback(null, this.signInUserSession);
}
if (refreshToken.getToken() == null) {
return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);
}
this.refreshSession(refreshToken, callback);
} else {
callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);
}
return undefined;
};
/**
* This uses the refreshToken to retrieve a new session
* @param {CognitoRefreshToken} refreshToken A previous session's refresh token.
* @param {nodeCallback<CognitoUserSession>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) {
var _this9 = this;
var authParameters = {};
authParameters.REFRESH_TOKEN = refreshToken.getToken();
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();
var lastUserKey = keyPrefix + '.LastAuthUser';
if (this.storage.getItem(lastUserKey)) {
this.username = this.storage.getItem(lastUserKey);
var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey';
this.deviceKey = this.storage.getItem(deviceKeyKey);
authParameters.DEVICE_KEY = this.deviceKey;
}
var jsonReq = {
ClientId: this.pool.getClientId(),
AuthFlow: 'REFRESH_TOKEN_AUTH',
AuthParameters: authParameters
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, authResult) {
if (err) {
if (err.code === 'NotAuthorizedException') {
_this9.clearCachedTokens();
}
return callback(err, null);
}
if (authResult) {
var authenticationResult = authResult.AuthenticationResult;
if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {
authenticationResult.RefreshToken = refreshToken.getToken();
}
_this9.signInUserSession = _this9.getCognitoUserSession(authenticationResult);
_this9.cacheTokens();
return callback(null, _this9.signInUserSession);
}
return undefined;
});
};
/**
* This is used to save the session tokens to local storage
* @returns {void}
*/
CognitoUser.prototype.cacheTokens = function cacheTokens() {
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();
var idTokenKey = keyPrefix + '.' + this.username + '.idToken';
var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';
var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';
var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift';
var lastUserKey = keyPrefix + '.LastAuthUser';
this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());
this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());
this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());
this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift());
this.storage.setItem(lastUserKey, this.username);
};
/**
* This is used to cache the device key and device group and device password
* @returns {void}
*/
CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;
var deviceKeyKey = keyPrefix + '.deviceKey';
var randomPasswordKey = keyPrefix + '.randomPasswordKey';
var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';
this.storage.setItem(deviceKeyKey, this.deviceKey);
this.storage.setItem(randomPasswordKey, this.randomPassword);
this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);
};
/**
* This is used to get current device key and device group and device password
* @returns {void}
*/
CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;
var deviceKeyKey = keyPrefix + '.deviceKey';
var randomPasswordKey = keyPrefix + '.randomPasswordKey';
var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';
if (this.storage.getItem(deviceKeyKey)) {
this.deviceKey = this.storage.getItem(deviceKeyKey);
this.randomPassword = this.storage.getItem(randomPasswordKey);
this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);
}
};
/**
* This is used to clear the device key info from local storage
* @returns {void}
*/
CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;
var deviceKeyKey = keyPrefix + '.deviceKey';
var randomPasswordKey = keyPrefix + '.randomPasswordKey';
var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';
this.storage.removeItem(deviceKeyKey);
this.storage.removeItem(randomPasswordKey);
this.storage.removeItem(deviceGroupKeyKey);
};
/**
* This is used to clear the session tokens from local storage
* @returns {void}
*/
CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() {
var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();
var idTokenKey = keyPrefix + '.' + this.username + '.idToken';
var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';
var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';
var lastUserKey = keyPrefix + '.LastAuthUser';
this.storage.removeItem(idTokenKey);
this.storage.removeItem(accessTokenKey);
this.storage.removeItem(refreshTokenKey);
this.storage.removeItem(lastUserKey);
};
/**
* This is used to build a user session from tokens retrieved in the authentication result
* @param {object} authResult Successful auth response from server.
* @returns {CognitoUserSession} The new user session.
* @private
*/
CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) {
var idToken = new _CognitoIdToken2.default(authResult);
var accessToken = new _CognitoAccessToken2.default(authResult);
var refreshToken = new _CognitoRefreshToken2.default(authResult);
var sessionData = {
IdToken: idToken,
AccessToken: accessToken,
RefreshToken: refreshToken
};
return new _CognitoUserSession2.default(sessionData);
};
/**
* This is used to initiate a forgot password request
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {inputVerificationCode?} callback.inputVerificationCode
* Optional callback raised instead of onSuccess with response data.
* @param {onSuccess} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.forgotPassword = function forgotPassword(callback) {
var jsonReq = {
ClientId: this.pool.getClientId(),
Username: this.username
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('forgotPassword', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
if (typeof callback.inputVerificationCode === 'function') {
return callback.inputVerificationCode(data);
}
return callback.onSuccess(data);
});
};
/**
* This is used to confirm a new password using a confirmationCode
* @param {string} confirmationCode Code entered by user.
* @param {string} newPassword Confirm new password.
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<void>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) {
var jsonReq = {
ClientId: this.pool.getClientId(),
Username: this.username,
ConfirmationCode: confirmationCode,
Password: newPassword
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('confirmForgotPassword', jsonReq, function (err) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess();
});
};
/**
* This is used to initiate an attribute confirmation request
* @param {string} attributeName User attribute that needs confirmation.
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {inputVerificationCode} callback.inputVerificationCode Called on success.
* @returns {void}
*/
CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('getUserAttributeVerificationCode', {
AttributeName: attributeName,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
if (typeof callback.inputVerificationCode === 'function') {
return callback.inputVerificationCode(data);
}
return callback.onSuccess();
});
return undefined;
};
/**
* This is used to confirm an attribute using a confirmation code
* @param {string} attributeName Attribute being confirmed.
* @param {string} confirmationCode Code entered by user.
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('verifyUserAttribute', {
AttributeName: attributeName,
Code: confirmationCode,
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess('SUCCESS');
});
return undefined;
};
/**
* This is used to get the device information using the current device key
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<*>} callback.onSuccess Called on success with device data.
* @returns {void}
*/
CognitoUser.prototype.getDevice = function getDevice(callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('getDevice', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
DeviceKey: this.deviceKey
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess(data);
});
return undefined;
};
/**
* This is used to forget a specific device
* @param {string} deviceKey Device key.
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('forgetDevice', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
DeviceKey: deviceKey
}, function (err) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess('SUCCESS');
});
return undefined;
};
/**
* This is used to forget the current device
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.forgetDevice = function forgetDevice(callback) {
var _this10 = this;
this.forgetSpecificDevice(this.deviceKey, {
onFailure: callback.onFailure,
onSuccess: function onSuccess(result) {
_this10.deviceKey = null;
_this10.deviceGroupKey = null;
_this10.randomPassword = null;
_this10.clearCachedDeviceKeyAndPassword();
return callback.onSuccess(result);
}
});
};
/**
* This is used to set the device status as remembered
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('updateDeviceStatus', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
DeviceKey: this.deviceKey,
DeviceRememberedStatus: 'remembered'
}, function (err) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess('SUCCESS');
});
return undefined;
};
/**
* This is used to set the device status as not remembered
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('updateDeviceStatus', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
DeviceKey: this.deviceKey,
DeviceRememberedStatus: 'not_remembered'
}, function (err) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess('SUCCESS');
});
return undefined;
};
/**
* This is used to list all devices for a user
*
* @param {int} limit the number of devices returned in a call
* @param {string} paginationToken the pagination token in case any was returned before
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<*>} callback.onSuccess Called on success with device list.
* @returns {void}
*/
CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) {
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('listDevices', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
Limit: limit,
PaginationToken: paginationToken
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
return callback.onSuccess(data);
});
return undefined;
};
/**
* This is used to globally revoke all tokens issued to a user
* @param {object} callback Result callback map.
* @param {onFailure} callback.onFailure Called on any error.
* @param {onSuccess<string>} callback.onSuccess Called on success.
* @returns {void}
*/
CognitoUser.prototype.globalSignOut = function globalSignOut(callback) {
var _this11 = this;
if (this.signInUserSession == null || !this.signInUserSession.isValid()) {
return callback.onFailure(new Error('User is not authenticated'));
}
this.client.makeUnauthenticatedRequest('globalSignOut', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err) {
if (err) {
return callback.onFailure(err);
}
_this11.clearCachedTokens();
return callback.onSuccess('SUCCESS');
});
return undefined;
};
/**
* This is used for the user to signOut of the application and clear the cached tokens.
* @returns {void}
*/
CognitoUser.prototype.signOut = function signOut() {
this.signInUserSession = null;
this.clearCachedTokens();
};
/**
* This is used by a user trying to select a given MFA
* @param {string} answerChallenge the mfa the user wants
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {
var _this12 = this;
var challengeResponses = {};
challengeResponses.USERNAME = this.username;
challengeResponses.ANSWER = answerChallenge;
var jsonReq = {
ChallengeName: 'SELECT_MFA_TYPE',
ChallengeResponses: challengeResponses,
ClientId: this.pool.getClientId(),
Session: this.Session
};
if (this.getUserContextData()) {
jsonReq.UserContextData = this.getUserContextData();
}
this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {
if (err) {
return callback.onFailure(err);
}
_this12.Session = data.Session;
if (answerChallenge === 'SMS_MFA') {
return callback.mfaRequired(data.challengeName, data.challengeParameters);
}
if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {
return callback.totpRequired(data.challengeName, data.challengeParameters);
}
return undefined;
});
};
/**
* This returns the user context data for advanced security feature.
* @returns {void}
*/
CognitoUser.prototype.getUserContextData = function getUserContextData() {
var pool = this.pool;
return pool.getUserContextData(this.username);
};
/**
* This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) {
var _this13 = this;
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
this.client.makeUnauthenticatedRequest('associateSoftwareToken', {
Session: this.Session
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
_this13.Session = data.Session;
return callback.associateSecretCode(data.SecretCode);
});
} else {
this.client.makeUnauthenticatedRequest('associateSoftwareToken', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken()
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
return callback.associateSecretCode(data.SecretCode);
});
}
};
/**
* This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA
* @param {string} totpCode The MFA code entered by the user.
* @param {string} friendlyDeviceName The device name we are assigning to the device.
* @param {nodeCallback<string>} callback Called on success or error.
* @returns {void}
*/
CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {
var _this14 = this;
if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {
this.client.makeUnauthenticatedRequest('verifySoftwareToken', {
Session: this.Session,
UserCode: totpCode,
FriendlyDeviceName: friendlyDeviceName
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
_this14.Session = data.Session;
var challengeResponses = {};
challengeResponses.USERNAME = _this14.username;
var jsonReq = {
ChallengeName: 'MFA_SETUP',
ClientId: _this14.pool.getClientId(),
ChallengeResponses: challengeResponses,
Session: _this14.Session
};
if (_this14.getUserContextData()) {
jsonReq.UserContextData = _this14.getUserContextData();
}
_this14.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {
if (errRespond) {
return callback.onFailure(errRespond);
}
_this14.signInUserSession = _this14.getCognitoUserSession(dataRespond.AuthenticationResult);
_this14.cacheTokens();
return callback.onSuccess(_this14.signInUserSession);
});
return undefined;
});
} else {
this.client.makeUnauthenticatedRequest('verifySoftwareToken', {
AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),
UserCode: totpCode,
FriendlyDeviceName: friendlyDeviceName
}, function (err, data) {
if (err) {
return callback.onFailure(err);
}
return callback(null, data);
});
}
};
return CognitoUser;
}();
exports.default = CognitoUser;
/***/ }),
/* 9 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoUserAttribute = function () {
/**
* Constructs a new CognitoUserAttribute object
* @param {string=} Name The record's name
* @param {string=} Value The record's value
*/
function CognitoUserAttribute() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
Name = _ref.Name,
Value = _ref.Value;
_classCallCheck(this, CognitoUserAttribute);
this.Name = Name || '';
this.Value = Value || '';
}
/**
* @returns {string} the record's value.
*/
CognitoUserAttribute.prototype.getValue = function getValue() {
return this.Value;
};
/**
* Sets the record's value.
* @param {string} value The new value.
* @returns {CognitoUserAttribute} The record for method chaining.
*/
CognitoUserAttribute.prototype.setValue = function setValue(value) {
this.Value = value;
return this;
};
/**
* @returns {string} the record's name.
*/
CognitoUserAttribute.prototype.getName = function getName() {
return this.Name;
};
/**
* Sets the record's name
* @param {string} name The new name.
* @returns {CognitoUserAttribute} The record for method chaining.
*/
CognitoUserAttribute.prototype.setName = function setName(name) {
this.Name = name;
return this;
};
/**
* @returns {string} a string representation of the record.
*/
CognitoUserAttribute.prototype.toString = function toString() {
return JSON.stringify(this);
};
/**
* @returns {object} a flat object representing the record.
*/
CognitoUserAttribute.prototype.toJSON = function toJSON() {
return {
Name: this.Name,
Value: this.Value
};
};
return CognitoUserAttribute;
}();
exports.default = CognitoUserAttribute;
/***/ }),
/* 10 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoUserSession = function () {
/**
* Constructs a new CognitoUserSession object
* @param {CognitoIdToken} IdToken The session's Id token.
* @param {CognitoRefreshToken=} RefreshToken The session's refresh token.
* @param {CognitoAccessToken} AccessToken The session's access token.
* @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.
*/
function CognitoUserSession() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
IdToken = _ref.IdToken,
RefreshToken = _ref.RefreshToken,
AccessToken = _ref.AccessToken,
ClockDrift = _ref.ClockDrift;
_classCallCheck(this, CognitoUserSession);
if (AccessToken == null || IdToken == null) {
throw new Error('Id token and Access Token must be present.');
}
this.idToken = IdToken;
this.refreshToken = RefreshToken;
this.accessToken = AccessToken;
this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;
}
/**
* @returns {CognitoIdToken} the session's Id token
*/
CognitoUserSession.prototype.getIdToken = function getIdToken() {
return this.idToken;
};
/**
* @returns {CognitoRefreshToken} the session's refresh token
*/
CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() {
return this.refreshToken;
};
/**
* @returns {CognitoAccessToken} the session's access token
*/
CognitoUserSession.prototype.getAccessToken = function getAccessToken() {
return this.accessToken;
};
/**
* @returns {int} the session's clock drift
*/
CognitoUserSession.prototype.getClockDrift = function getClockDrift() {
return this.clockDrift;
};
/**
* @returns {int} the computer's clock drift
*/
CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() {
var now = Math.floor(new Date() / 1000);
var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());
return now - iat;
};
/**
* Checks to see if the session is still valid based on session expiry information found
* in tokens and the current time (adjusted with clock drift)
* @returns {boolean} if the session is still valid
*/
CognitoUserSession.prototype.isValid = function isValid() {
var now = Math.floor(new Date() / 1000);
var adjusted = now - this.clockDrift;
return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();
};
return CognitoUserSession;
}();
exports.default = CognitoUserSession;
/***/ }),
/* 11 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
/** @class */
var DateHelper = function () {
function DateHelper() {
_classCallCheck(this, DateHelper);
}
/**
* @returns {string} The current time in "ddd MMM D HH:mm:ss UTC YYYY" format.
*/
DateHelper.prototype.getNowString = function getNowString() {
var now = new Date();
var weekDay = weekNames[now.getUTCDay()];
var month = monthNames[now.getUTCMonth()];
var day = now.getUTCDate();
var hours = now.getUTCHours();
if (hours < 10) {
hours = '0' + hours;
}
var minutes = now.getUTCMinutes();
if (minutes < 10) {
minutes = '0' + minutes;
}
var seconds = now.getUTCSeconds();
if (seconds < 10) {
seconds = '0' + seconds;
}
var year = now.getUTCFullYear();
// ddd MMM D HH:mm:ss UTC YYYY
var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year;
return dateNow;
};
return DateHelper;
}();
exports.default = DateHelper;
/***/ }),
/* 12 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
var dataMemory = {};
/** @class */
var MemoryStorage = function () {
function MemoryStorage() {
_classCallCheck(this, MemoryStorage);
}
/**
* This is used to set a specific item in storage
* @param {string} key - the key for the item
* @param {object} value - the value
* @returns {string} value that was set
*/
MemoryStorage.setItem = function setItem(key, value) {
dataMemory[key] = value;
return dataMemory[key];
};
/**
* This is used to get a specific key from storage
* @param {string} key - the key for the item
* This is used to clear the storage
* @returns {string} the data item
*/
MemoryStorage.getItem = function getItem(key) {
return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;
};
/**
* This is used to remove an item from storage
* @param {string} key - the key being set
* @returns {string} value - value that was deleted
*/
MemoryStorage.removeItem = function removeItem(key) {
return delete dataMemory[key];
};
/**
* This is used to clear the storage
* @returns {string} nothing
*/
MemoryStorage.clear = function clear() {
dataMemory = {};
return dataMemory;
};
return MemoryStorage;
}();
/** @class */
var StorageHelper = function () {
/**
* This is used to get a storage object
* @returns {object} the storage
*/
function StorageHelper() {
_classCallCheck(this, StorageHelper);
try {
this.storageWindow = window.localStorage;
this.storageWindow.setItem('aws.cognito.test-ls', 1);
this.storageWindow.removeItem('aws.cognito.test-ls');
} catch (exception) {
this.storageWindow = MemoryStorage;
}
}
/**
* This is used to return the storage
* @returns {object} the storage
*/
StorageHelper.prototype.getStorage = function getStorage() {
return this.storageWindow;
};
return StorageHelper;
}();
exports.default = StorageHelper;
/***/ }),
/* 13 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_13__;
/***/ }),
/* 14 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var AuthenticationDetails = function () {
/**
* Constructs a new AuthenticationDetails object
* @param {object=} data Creation options.
* @param {string} data.Username User being authenticated.
* @param {string} data.Password Plain-text password to authenticate with.
* @param {(AttributeArg[])?} data.ValidationData Application extra metadata.
* @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.
*/
function AuthenticationDetails(data) {
_classCallCheck(this, AuthenticationDetails);
var _ref = data || {},
ValidationData = _ref.ValidationData,
Username = _ref.Username,
Password = _ref.Password,
AuthParameters = _ref.AuthParameters;
this.validationData = ValidationData || [];
this.authParameters = AuthParameters || [];
this.username = Username;
this.password = Password;
}
/**
* @returns {string} the record's username
*/
AuthenticationDetails.prototype.getUsername = function getUsername() {
return this.username;
};
/**
* @returns {string} the record's password
*/
AuthenticationDetails.prototype.getPassword = function getPassword() {
return this.password;
};
/**
* @returns {Array} the record's validationData
*/
AuthenticationDetails.prototype.getValidationData = function getValidationData() {
return this.validationData;
};
/**
* @returns {Array} the record's authParameters
*/
AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() {
return this.authParameters;
};
return AuthenticationDetails;
}();
exports.default = AuthenticationDetails;
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _cognitoidentityserviceprovider = __webpack_require__(13);
var _cognitoidentityserviceprovider2 = _interopRequireDefault(_cognitoidentityserviceprovider);
var _CognitoUser = __webpack_require__(8);
var _CognitoUser2 = _interopRequireDefault(_CognitoUser);
var _StorageHelper = __webpack_require__(12);
var _StorageHelper2 = _interopRequireDefault(_StorageHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
/** @class */
var CognitoUserPool = function () {
/**
* Constructs a new CognitoUserPool object
* @param {object} data Creation options.
* @param {string} data.UserPoolId Cognito user pool id.
* @param {string} data.ClientId User pool application client id.
* @param {object} data.Storage Optional storage object.
* @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:
* boolean flag indicating if the data collection is enabled
* to support cognito advanced security features. By default, this
* flag is set to true.
*/
function CognitoUserPool(data) {
_classCallCheck(this, CognitoUserPool);
var _ref = data || {},
UserPoolId = _ref.UserPoolId,
ClientId = _ref.ClientId,
endpoint = _ref.endpoint,
AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;
if (!UserPoolId || !ClientId) {
throw new Error('Both UserPoolId and ClientId are required.');
}
if (!/^[\w-]+_.+$/.test(UserPoolId)) {
throw new Error('Invalid UserPoolId format.');
}
var region = UserPoolId.split('_')[0];
this.userPoolId = UserPoolId;
this.clientId = ClientId;
this.client = new _cognitoidentityserviceprovider2.default({
apiVersion: '2016-04-19',
region: region,
endpoint: endpoint
});
/**
* By default, AdvancedSecurityDataCollectionFlag is set to true,
* if no input value is provided.
*/
this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;
this.storage = data.Storage || new _StorageHelper2.default().getStorage();
}
/**
* @returns {string} the user pool id
*/
CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() {
return this.userPoolId;
};
/**
* @returns {string} the client id
*/
CognitoUserPool.prototype.getClientId = function getClientId() {
return this.clientId;
};
/**
* @typedef {object} SignUpResult
* @property {CognitoUser} user New user.
* @property {bool} userConfirmed If the user is already confirmed.
*/
/**
* method for signing up a user
* @param {string} username User's username.
* @param {string} password Plain-text initial password entered by user.
* @param {(AttributeArg[])=} userAttributes New user attributes.
* @param {(AttributeArg[])=} validationData Application metadata.
* @param {nodeCallback<SignUpResult>} callback Called on error or with the new user.
* @returns {void}
*/
CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) {
var _this = this;
var jsonReq = {
ClientId: this.clientId,
Username: username,
Password: password,
UserAttributes: userAttributes,
ValidationData: validationData
};
if (this.getUserContextData(username)) {
jsonReq.UserContextData = this.getUserContextData(username);
}
this.client.makeUnauthenticatedRequest('signUp', jsonReq, function (err, data) {
if (err) {
return callback(err, null);
}
var cognitoUser = {
Username: username,
Pool: _this,
Storage: _this.storage
};
var returnData = {
user: new _CognitoUser2.default(cognitoUser),
userConfirmed: data.UserConfirmed,
userSub: data.UserSub
};
return callback(null, returnData);
});
};
/**
* method for getting the current user of the application from the local storage
*
* @returns {CognitoUser} the user retrieved from storage
*/
CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() {
var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser';
var lastAuthUser = this.storage.getItem(lastUserKey);
if (lastAuthUser) {
var cognitoUser = {
Username: lastAuthUser,
Pool: this,
Storage: this.storage
};
return new _CognitoUser2.default(cognitoUser);
}
return null;
};
/**
* This method returns the encoded data string used for cognito advanced security feature.
* This would be generated only when developer has included the JS used for collecting the
* data on their client. Please refer to documentation to know more about using AdvancedSecurity
* features
* @param {string} username the username for the context data
* @returns {string} the user context data
**/
CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) {
if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {
return undefined;
}
/* eslint-disable */
var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;
/* eslint-enable */
if (this.advancedSecurityDataCollectionFlag) {
var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId);
if (advancedSecurityData) {
var userContextData = {
EncodedData: advancedSecurityData
};
return userContextData;
}
}
return {};
};
return CognitoUserPool;
}();
exports.default = CognitoUserPool;
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _jsCookie = __webpack_require__(18);
var Cookies = _interopRequireWildcard(_jsCookie);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/** @class */
var CookieStorage = function () {
/**
* Constructs a new CookieStorage object
* @param {object} data Creation options.
* @param {string} data.domain Cookies domain (mandatory).
* @param {string} data.path Cookies path (default: '/')
* @param {integer} data.expires Cookie expiration (in days, default: 365)
* @param {boolean} data.secure Cookie secure flag (default: true)
*/
function CookieStorage(data) {
_classCallCheck(this, CookieStorage);
this.domain = data.domain;
if (data.path) {
this.path = data.path;
} else {
this.path = '/';
}
if (Object.prototype.hasOwnProperty.call(data, 'expires')) {
this.expires = data.expires;
} else {
this.expires = 365;
}
if (Object.prototype.hasOwnProperty.call(data, 'secure')) {
this.secure = data.secure;
} else {
this.secure = true;
}
}
/**
* This is used to set a specific item in storage
* @param {string} key - the key for the item
* @param {object} value - the value
* @returns {string} value that was set
*/
CookieStorage.prototype.setItem = function setItem(key, value) {
Cookies.set(key, value, {
path: this.path,
expires: this.expires,
domain: this.domain,
secure: this.secure
});
return Cookies.get(key);
};
/**
* This is used to get a specific key from storage
* @param {string} key - the key for the item
* This is used to clear the storage
* @returns {string} the data item
*/
CookieStorage.prototype.getItem = function getItem(key) {
return Cookies.get(key);
};
/**
* This is used to remove an item from storage
* @param {string} key - the key being set
* @returns {string} value - value that was deleted
*/
CookieStorage.prototype.removeItem = function removeItem(key) {
return Cookies.remove(key, {
path: this.path,
domain: this.domain,
secure: this.secure
});
};
/**
* This is used to clear the storage
* @returns {string} nothing
*/
CookieStorage.prototype.clear = function clear() {
var cookies = Cookies.get();
var index = void 0;
for (index = 0; index < cookies.length; ++index) {
Cookies.remove(cookies[index]);
}
return {};
};
return CookieStorage;
}();
exports.default = CookieStorage;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _AuthenticationDetails = __webpack_require__(14);
Object.defineProperty(exports, 'AuthenticationDetails', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_AuthenticationDetails).default;
}
});
var _AuthenticationHelper = __webpack_require__(2);
Object.defineProperty(exports, 'AuthenticationHelper', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_AuthenticationHelper).default;
}
});
var _CognitoAccessToken = __webpack_require__(4);
Object.defineProperty(exports, 'CognitoAccessToken', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoAccessToken).default;
}
});
var _CognitoIdToken = __webpack_require__(5);
Object.defineProperty(exports, 'CognitoIdToken', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoIdToken).default;
}
});
var _CognitoRefreshToken = __webpack_require__(7);
Object.defineProperty(exports, 'CognitoRefreshToken', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoRefreshToken).default;
}
});
var _CognitoUser = __webpack_require__(8);
Object.defineProperty(exports, 'CognitoUser', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoUser).default;
}
});
var _CognitoUserAttribute = __webpack_require__(9);
Object.defineProperty(exports, 'CognitoUserAttribute', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoUserAttribute).default;
}
});
var _CognitoUserPool = __webpack_require__(15);
Object.defineProperty(exports, 'CognitoUserPool', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoUserPool).default;
}
});
var _CognitoUserSession = __webpack_require__(10);
Object.defineProperty(exports, 'CognitoUserSession', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CognitoUserSession).default;
}
});
var _CookieStorage = __webpack_require__(16);
Object.defineProperty(exports, 'CookieStorage', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CookieStorage).default;
}
});
var _DateHelper = __webpack_require__(11);
Object.defineProperty(exports, 'DateHelper', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DateHelper).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// The version of crypto-browserify included by aws-sdk only
// checks for window.crypto, not window.msCrypto as used by
// IE 11 – so we set it explicitly here
if (typeof window !== 'undefined' && !window.crypto && window.msCrypto) {
window.crypto = window.msCrypto;
}
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
* JavaScript Cookie v2.2.0
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
;(function (factory) {
var registeredInModuleLoader = false;
if (true) {
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
registeredInModuleLoader = true;
}
if (true) {
module.exports = factory();
registeredInModuleLoader = true;
}
if (!registeredInModuleLoader) {
var OldCookies = window.Cookies;
var api = window.Cookies = factory();
api.noConflict = function () {
window.Cookies = OldCookies;
return api;
};
}
}(function () {
function extend () {
var i = 0;
var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {
result[key] = attributes[key];
}
}
return result;
}
function init (converter) {
function api (key, value, attributes) {
var result;
if (typeof document === 'undefined') {
return;
}
// Write
if (arguments.length > 1) {
attributes = extend({
path: '/'
}, api.defaults, attributes);
if (typeof attributes.expires === 'number') {
var expires = new Date();
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
attributes.expires = expires;
}
// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
try {
result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
if (!converter.write) {
value = encodeURIComponent(String(value))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
} else {
value = converter.write(value, key);
}
key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
stringifiedAttributes += '=' + attributes[attributeName];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
}
// Read
if (!key) {
result = {};
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()"
var cookies = document.cookie ? document.cookie.split('; ') : [];
var rdecode = /(%[0-9A-Z]{2})+/g;
var i = 0;
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var cookie = parts.slice(1).join('=');
if (!this.json && cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1);
}
try {
var name = parts[0].replace(rdecode, decodeURIComponent);
cookie = converter.read ?
converter.read(cookie, name) : converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent);
if (this.json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
}
if (key === name) {
result = cookie;
break;
}
if (!key) {
result[name] = cookie;
}
} catch (e) {}
}
return result;
}
api.set = api;
api.get = function (key) {
return api.call(api, key);
};
api.getJSON = function () {
return api.apply({
json: true
}, [].slice.call(arguments));
};
api.defaults = {};
api.remove = function (key, attributes) {
api(key, '', extend(attributes, {
expires: -1
}));
};
api.withConverter = init;
return api;
}
return init(function () {});
}));
/***/ })
/******/ ])
});
;
================================================
FILE: dist/aws-cognito-sdk.js
================================================
// AWS SDK for JavaScript v2.6.4
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports={
"version": "2.0",
"metadata": {
"apiVersion": "2014-06-30",
"endpointPrefix": "cognito-identity",
"jsonVersion": "1.1",
"protocol": "json",
"serviceFullName": "Amazon Cognito Identity",
"signatureVersion": "v4",
"targetPrefix": "AWSCognitoIdentityService"
},
"operations": {
"CreateIdentityPool": {
"input": {
"type": "structure",
"required": [
"IdentityPoolName",
"AllowUnauthenticatedIdentities"
],
"members": {
"IdentityPoolName": {},
"AllowUnauthenticatedIdentities": {
"type": "boolean"
},
"SupportedLoginProviders": {
"shape": "S4"
},
"DeveloperProviderName": {},
"OpenIdConnectProviderARNs": {
"shape": "S8"
},
"CognitoIdentityProviders": {
"shape": "Sa"
},
"SamlProviderARNs": {
"shape": "Se"
}
}
},
"output": {
"shape": "Sf"
}
},
"DeleteIdentities": {
"input": {
"type": "structure",
"required": [
"IdentityIdsToDelete"
],
"members": {
"IdentityIdsToDelete": {
"type": "list",
"member": {}
}
}
},
"output": {
"type": "structure",
"members": {
"UnprocessedIdentityIds": {
"type": "list",
"member": {
"type": "structure",
"members": {
"IdentityId": {},
"ErrorCode": {}
}
}
}
}
}
},
"DeleteIdentityPool": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId"
],
"members": {
"IdentityPoolId": {}
}
}
},
"DescribeIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityId"
],
"members": {
"IdentityId": {}
}
},
"output": {
"shape": "Sq"
}
},
"DescribeIdentityPool": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId"
],
"members": {
"IdentityPoolId": {}
}
},
"output": {
"shape": "Sf"
}
},
"GetCredentialsForIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityId"
],
"members": {
"IdentityId": {},
"Logins": {
"shape": "Sv"
},
"CustomRoleArn": {}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {},
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
}
}
}
},
"GetId": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId"
],
"members": {
"AccountId": {},
"IdentityPoolId": {},
"Logins": {
"shape": "Sv"
}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {}
}
}
},
"GetIdentityPoolRoles": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId"
],
"members": {
"IdentityPoolId": {}
}
},
"output": {
"type": "structure",
"members": {
"IdentityPoolId": {},
"Roles": {
"shape": "S17"
}
}
}
},
"GetOpenIdToken": {
"input": {
"type": "structure",
"required": [
"IdentityId"
],
"members": {
"IdentityId": {},
"Logins": {
"shape": "Sv"
}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {},
"Token": {}
}
}
},
"GetOpenIdTokenForDeveloperIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId",
"Logins"
],
"members": {
"IdentityPoolId": {},
"IdentityId": {},
"Logins": {
"shape": "Sv"
},
"TokenDuration": {
"type": "long"
}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {},
"Token": {}
}
}
},
"ListIdentities": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId",
"MaxResults"
],
"members": {
"IdentityPoolId": {},
"MaxResults": {
"type": "integer"
},
"NextToken": {},
"HideDisabled": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {
"IdentityPoolId": {},
"Identities": {
"type": "list",
"member": {
"shape": "Sq"
}
},
"NextToken": {}
}
}
},
"ListIdentityPools": {
"input": {
"type": "structure",
"required": [
"MaxResults"
],
"members": {
"MaxResults": {
"type": "integer"
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"IdentityPools": {
"type": "list",
"member": {
"type": "structure",
"members": {
"IdentityPoolId": {},
"IdentityPoolName": {}
}
}
},
"NextToken": {}
}
}
},
"LookupDeveloperIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId"
],
"members": {
"IdentityPoolId": {},
"IdentityId": {},
"DeveloperUserIdentifier": {},
"MaxResults": {
"type": "integer"
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {},
"DeveloperUserIdentifierList": {
"type": "list",
"member": {}
},
"NextToken": {}
}
}
},
"MergeDeveloperIdentities": {
"input": {
"type": "structure",
"required": [
"SourceUserIdentifier",
"DestinationUserIdentifier",
"DeveloperProviderName",
"IdentityPoolId"
],
"members": {
"SourceUserIdentifier": {},
"DestinationUserIdentifier": {},
"DeveloperProviderName": {},
"IdentityPoolId": {}
}
},
"output": {
"type": "structure",
"members": {
"IdentityId": {}
}
}
},
"SetIdentityPoolRoles": {
"input": {
"type": "structure",
"required": [
"IdentityPoolId",
"Roles"
],
"members": {
"IdentityPoolId": {},
"Roles": {
"shape": "S17"
}
}
}
},
"UnlinkDeveloperIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityId",
"IdentityPoolId",
"DeveloperProviderName",
"DeveloperUserIdentifier"
],
"members": {
"IdentityId": {},
"IdentityPoolId": {},
"DeveloperProviderName": {},
"DeveloperUserIdentifier": {}
}
}
},
"UnlinkIdentity": {
"input": {
"type": "structure",
"required": [
"IdentityId",
"Logins",
"LoginsToRemove"
],
"members": {
"IdentityId": {},
"Logins": {
"shape": "Sv"
},
"LoginsToRemove": {
"shape": "Sr"
}
}
}
},
"UpdateIdentityPool": {
"input": {
"shape": "Sf"
},
"output": {
"shape": "Sf"
}
}
},
"shapes": {
"S4": {
"type": "map",
"key": {},
"value": {}
},
"S8": {
"type": "list",
"member": {}
},
"Sa": {
"type": "list",
"member": {
"type": "structure",
"members": {
"ProviderName": {},
"ClientId": {}
}
}
},
"Se": {
"type": "list",
"member": {}
},
"Sf": {
"type": "structure",
"required": [
"IdentityPoolId",
"IdentityPoolName",
"AllowUnauthenticatedIdentities"
],
"members": {
"IdentityPoolId": {},
"IdentityPoolName": {},
"AllowUnauthenticatedIdentities": {
"type": "boolean"
},
"SupportedLoginProviders": {
"shape": "S4"
},
"DeveloperProviderName": {},
"OpenIdConnectProviderARNs": {
"shape": "S8"
},
"CognitoIdentityProviders": {
"shape": "Sa"
},
"SamlProviderARNs": {
"shape": "Se"
}
}
},
"Sq": {
"type": "structure",
"members": {
"IdentityId": {},
"Logins": {
"shape": "Sr"
},
"CreationDate": {
"type": "timestamp"
},
"LastModifiedDate": {
"type": "timestamp"
}
}
},
"Sr": {
"type": "list",
"member": {}
},
"Sv": {
"type": "map",
"key": {},
"value": {}
},
"S17": {
"type": "map",
"key": {},
"value": {}
}
}
}
},{}],2:[function(require,module,exports){
module.exports={
"version":"2.0",
"metadata":{
"apiVersion":"2016-04-18",
"endpointPrefix":"cognito-idp",
"jsonVersion":"1.1",
"protocol":"json",
"serviceFullName":"Amazon Cognito Identity Provider",
"signatureVersion":"v4",
"targetPrefix":"AWSCognitoIdentityProviderService"
},
"operations":{
"AddCustomAttributes":{
"name":"AddCustomAttributes",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AddCustomAttributesRequest"},
"output":{"shape":"AddCustomAttributesResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserImportInProgressException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Adds additional user attributes to the user pool schema.</p>"
},
"AdminAddUserToGroup":{
"name":"AdminAddUserToGroup",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminAddUserToGroupRequest"},
"errors":[
{"shape":"InvalidParameterException"},
{"shape":"ResourceNotFoundException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Adds the specified user to the specified group.</p> <p>Requires developer credentials.</p>"
},
"AdminConfirmSignUp":{
"name":"AdminConfirmSignUp",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminConfirmSignUpRequest"},
"output":{"shape":"AdminConfirmSignUpResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"UnexpectedLambdaException"},
{"shape":"UserLambdaValidationException"},
{"shape":"NotAuthorizedException"},
{"shape":"TooManyFailedAttemptsException"},
{"shape":"InvalidLambdaResponseException"},
{"shape":"TooManyRequestsException"},
{"shape":"LimitExceededException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Confirms user registration as an admin without using a confirmation code. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminCreateUser":{
"name":"AdminCreateUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminCreateUserRequest"},
"output":{"shape":"AdminCreateUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"UserNotFoundException"},
{"shape":"UsernameExistsException"},
{"shape":"InvalidPasswordException"},
{"shape":"CodeDeliveryFailureException"},
{"shape":"UnexpectedLambdaException"},
{"shape":"UserLambdaValidationException"},
{"shape":"InvalidLambdaResponseException"},
{"shape":"PreconditionNotMetException"},
{"shape":"InvalidSmsRoleAccessPolicyException"},
{"shape":"InvalidSmsRoleTrustRelationshipException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UnsupportedUserStateException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Creates a new user in the specified user pool and sends a welcome message via email or phone (SMS). This message is based on a template that you configured in your call to CreateUserPool or UpdateUserPool. This template includes your custom sign-up instructions and placeholders for user name and temporary password.</p> <p>Requires developer credentials.</p>"
},
"AdminDeleteUser":{
"name":"AdminDeleteUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminDeleteUserRequest"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Deletes a user as an administrator. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminDeleteUserAttributes":{
"name":"AdminDeleteUserAttributes",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminDeleteUserAttributesRequest"},
"output":{"shape":"AdminDeleteUserAttributesResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Deletes the user attributes in a user pool as an administrator. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminDisableProviderForUser":{
"name":"AdminDisableProviderForUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminDisableProviderForUserRequest"},
"output":{"shape":"AdminDisableProviderForUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"AliasExistsException"},
{"shape":"InternalErrorException"}
]
},
"AdminDisableUser":{
"name":"AdminDisableUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminDisableUserRequest"},
"output":{"shape":"AdminDisableUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Disables the specified user as an administrator. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminEnableUser":{
"name":"AdminEnableUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminEnableUserRequest"},
"output":{"shape":"AdminEnableUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Enables the specified user as an administrator. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminForgetDevice":{
"name":"AdminForgetDevice",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminForgetDeviceRequest"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"InvalidUserPoolConfigurationException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Forgets the device, as an administrator.</p> <p>Requires developer credentials.</p>"
},
"AdminGetDevice":{
"name":"AdminGetDevice",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminGetDeviceRequest"},
"output":{"shape":"AdminGetDeviceResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"InvalidUserPoolConfigurationException"},
{"shape":"TooManyRequestsException"},
{"shape":"InternalErrorException"},
{"shape":"NotAuthorizedException"}
],
"documentation":"<p>Gets the device, as an administrator.</p> <p>Requires developer credentials.</p>"
},
"AdminGetUser":{
"name":"AdminGetUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminGetUserRequest"},
"output":{"shape":"AdminGetUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"InternalErrorException"}
],
"documentation":"<p>Gets the specified user by user name in a user pool as an administrator. Works on any user.</p> <p>Requires developer credentials.</p>"
},
"AdminInitiateAuth":{
"name":"AdminInitiateAuth",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminInitiateAuthRequest"},
"output":{"shape":"AdminInitiateAuthResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"NotAuthorizedException"},
{"shape":"TooManyRequestsException"},
{"shape":"InternalErrorException"},
{"shape":"UnexpectedLambdaException"},
{"shape":"InvalidUserPoolConfigurationException"},
{"shape":"UserLambdaValidationException"},
{"shape":"InvalidLambdaResponseException"},
{"shape":"MFAMethodNotFoundException"},
{"shape":"InvalidSmsRoleAccessPolicyException"},
{"shape":"InvalidSmsRoleTrustRelationshipException"},
{"shape":"PasswordResetRequiredException"},
{"shape":"UserNotFoundException"},
{"shape":"UserNotConfirmedException"}
],
"documentation":"<p>Initiates the authentication flow, as an administrator.</p> <p>Requires developer credentials.</p>"
},
"AdminLinkProviderForUser":{
"name":"AdminLinkProviderForUser",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"AdminLinkProviderForUserRequest"},
"output":{"shape":"AdminLinkProviderForUserResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"InvalidParameterException"},
{"shape":"TooManyRequestsException"},
{"shape":"NotAuthorizedException"},
{"shape":"UserNotFoundException"},
{"shape":"AliasExistsException"},
{"shape":"InternalErrorException"}
]
},
"AdminListDevices":{
"name":"AdminListDe
gitextract_qifezfr6/ ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.yaml ├── .gitignore ├── .npmignore ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── RNAWSCognito.podspec ├── android/ │ ├── build.gradle │ └── src/ │ └── main/ │ ├── AndroidManifest.xml │ └── java/ │ └── com/ │ └── amazonaws/ │ ├── RNAWSCognitoModule.java │ └── RNAWSCognitoPackage.java ├── dist/ │ ├── amazon-cognito-identity.js │ └── aws-cognito-sdk.js ├── enhance-rn.js ├── enhance.js ├── examples/ │ └── babel-webpack/ │ ├── .babelrc │ ├── .editorconfig │ ├── README.md │ ├── index.html │ ├── package.json │ ├── src/ │ │ ├── config.js │ │ └── main.jsx │ └── webpack.config.babel.js ├── index.d.ts ├── ios/ │ ├── JKBigInteger/ │ │ ├── JKBigDecimal.h │ │ ├── JKBigDecimal.m │ │ ├── JKBigInteger.h │ │ ├── JKBigInteger.m │ │ └── LibTomMath/ │ │ ├── tommath.c │ │ ├── tommath.h │ │ ├── tommath_class.h │ │ └── tommath_superclass.h │ ├── RNAWSCognito.h │ ├── RNAWSCognito.m │ └── RNAWSCognito.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata ├── lib/ │ ├── AuthenticationDetails.js │ ├── AuthenticationHelper.js │ ├── BigInteger.js │ ├── CognitoAccessToken.js │ ├── CognitoIdToken.js │ ├── CognitoJwtToken.js │ ├── CognitoRefreshToken.js │ ├── CognitoUser.js │ ├── CognitoUserAttribute.js │ ├── CognitoUserPool.js │ ├── CognitoUserSession.js │ ├── CookieStorage.js │ ├── DateHelper.js │ ├── StorageHelper-rn.js │ ├── StorageHelper.js │ └── index.js ├── package.json ├── src/ │ ├── AuthenticationDetails.js │ ├── AuthenticationHelper.js │ ├── BigInteger.js │ ├── CognitoAccessToken.js │ ├── CognitoIdToken.js │ ├── CognitoJwtToken.js │ ├── CognitoRefreshToken.js │ ├── CognitoUser.js │ ├── CognitoUserAttribute.js │ ├── CognitoUserPool.js │ ├── CognitoUserSession.js │ ├── CookieStorage.js │ ├── DateHelper.js │ ├── StorageHelper-rn.js │ ├── StorageHelper.js │ └── index.js └── webpack.config.js
SYMBOL INDEX (863 symbols across 39 files)
FILE: android/src/main/java/com/amazonaws/RNAWSCognitoModule.java
class RNAWSCognitoModule (line 10) | public class RNAWSCognitoModule extends ReactContextBaseJavaModule {
method RNAWSCognitoModule (line 33) | public RNAWSCognitoModule(ReactApplicationContext reactContext) {
method getName (line 38) | @Override
method computeModPow (line 43) | @ReactMethod
method computeS (line 56) | @ReactMethod
FILE: android/src/main/java/com/amazonaws/RNAWSCognitoPackage.java
class RNAWSCognitoPackage (line 13) | public class RNAWSCognitoPackage implements ReactPackage {
method createNativeModules (line 14) | @Override
method createJSModules (line 19) | public List<Class<? extends JavaScriptModule>> createJSModules() {
method createViewManagers (line 23) | @Override
FILE: dist/amazon-cognito-identity.js
function __webpack_require__ (line 34) | function __webpack_require__(moduleId) {
function _interopRequireWildcard (line 97) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function _interopRequireDefault (line 99) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _interopRequireDefault (line 125) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 127) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function AuthenticationHelper (line 155) | function AuthenticationHelper(PoolName) {
function BigInteger (line 526) | function BigInteger(a, b) {
function nbi (line 531) | function nbi() {
function am1 (line 550) | function am1(i, x, w, j, c, n) {
function am2 (line 561) | function am2(i, x, w, j, c, n) {
function am3 (line 576) | function am3(i, x, w, j, c, n) {
function int2char (line 624) | function int2char(n) {
function intAt (line 627) | function intAt(s, i) {
function bnpCopyTo (line 633) | function bnpCopyTo(r) {
function bnpFromInt (line 641) | function bnpFromInt(x) {
function nbv (line 648) | function nbv(i) {
function bnpFromString (line 657) | function bnpFromString(s, b) {
function bnpClamp (line 684) | function bnpClamp() {
function bnToString (line 692) | function bnToString(b) {
function bnNegate (line 726) | function bnNegate() {
function bnAbs (line 735) | function bnAbs() {
function bnCompareTo (line 740) | function bnCompareTo(a) {
function nbits (line 752) | function nbits(x) {
function bnBitLength (line 779) | function bnBitLength() {
function bnpDLShiftTo (line 785) | function bnpDLShiftTo(n, r) {
function bnpDRShiftTo (line 796) | function bnpDRShiftTo(n, r) {
function bnpLShiftTo (line 804) | function bnpLShiftTo(n, r) {
function bnpRShiftTo (line 824) | function bnpRShiftTo(n, r) {
function bnpSubTo (line 845) | function bnpSubTo(a, r) {
function bnpMultiplyTo (line 879) | function bnpMultiplyTo(a, r) {
function bnpSquareTo (line 894) | function bnpSquareTo(r) {
function bnpDivRemTo (line 913) | function bnpDivRemTo(m, q, r) {
function bnMod (line 979) | function bnMod(a) {
function bnpInvDigit (line 996) | function bnpInvDigit() {
function bnEquals (line 1016) | function bnEquals(a) {
function bnpAddTo (line 1021) | function bnpAddTo(a, r) {
function bnAdd (line 1054) | function bnAdd(a) {
function bnSubtract (line 1063) | function bnSubtract(a) {
function bnMultiply (line 1072) | function bnMultiply(a) {
function bnDivide (line 1081) | function bnDivide(a) {
function Montgomery (line 1090) | function Montgomery(m) {
function montConvert (line 1100) | function montConvert(x) {
function montRevert (line 1109) | function montRevert(x) {
function montReduce (line 1117) | function montReduce(x) {
function montSqrTo (line 1140) | function montSqrTo(x, r) {
function montMulTo (line 1147) | function montMulTo(x, y, r) {
function bnModPow (line 1160) | function bnModPow(e, m, callback) {
function _interopRequireDefault (line 1284) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 1286) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function _possibleConstructorReturn (line 1288) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
function _inherits (line 1290) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
function CognitoAccessToken (line 1315) | function CognitoAccessToken() {
function _interopRequireDefault (line 1341) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 1343) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function _possibleConstructorReturn (line 1345) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
function _inherits (line 1347) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
function CognitoIdToken (line 1372) | function CognitoIdToken() {
function _classCallCheck (line 1396) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoJwtToken (line 1419) | function CognitoJwtToken(token) {
function _classCallCheck (line 1481) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoRefreshToken (line 1506) | function CognitoRefreshToken() {
function _interopRequireDefault (line 1576) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 1578) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUser (line 1643) | function CognitoUser(data) {
function _classCallCheck (line 3271) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserAttribute (line 3297) | function CognitoUserAttribute() {
function _classCallCheck (line 3384) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserSession (line 3412) | function CognitoUserSession() {
function _classCallCheck (line 3506) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function DateHelper (line 3531) | function DateHelper() {
function _classCallCheck (line 3581) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function MemoryStorage (line 3605) | function MemoryStorage() {
function StorageHelper (line 3666) | function StorageHelper() {
function _classCallCheck (line 3707) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function AuthenticationDetails (line 3736) | function AuthenticationDetails(data) {
function _interopRequireDefault (line 3812) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 3814) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserPool (line 3844) | function CognitoUserPool(data) {
function _interopRequireWildcard (line 4018) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function _classCallCheck (line 4020) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CookieStorage (line 4033) | function CookieStorage(data) {
function _interopRequireDefault (line 4226) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function extend (line 4265) | function extend () {
function init (line 4277) | function init (converter) {
FILE: dist/aws-cognito-sdk.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function finish (line 8432) | function finish(err) {
function credError (line 8436) | function credError(msg, err) {
function getAsyncCredentials (line 8442) | function getAsyncCredentials() {
function getStaticCredentials (line 8453) | function getStaticCredentials() {
function resolveNext (line 8947) | function resolveNext(err, creds) {
function callback (line 9231) | function callback(httpResp) {
function progress (line 9259) | function progress(httpResp) {
function error (line 9269) | function error(err) {
function executeSend (line 9281) | function executeSend() {
function buildMessage (line 9453) | function buildMessage() {
function JsonBuilder (line 9743) | function JsonBuilder() { }
function translate (line 9749) | function translate(value, shape) {
function translateStructure (line 9760) | function translateStructure(structure, shape) {
function translateList (line 9774) | function translateList(list, shape) {
function translateMap (line 9783) | function translateMap(map, shape) {
function translateScalar (line 9792) | function translateScalar(value, shape) {
function JsonParser (line 9801) | function JsonParser() { }
function translate (line 9807) | function translate(value, shape) {
function translateStructure (line 9818) | function translateStructure(structure, shape) {
function translateList (line 9834) | function translateList(list, shape) {
function translateMap (line 9846) | function translateMap(map, shape) {
function translateScalar (line 9858) | function translateScalar(value, shape) {
function Api (line 9875) | function Api(api, options) {
function memoize (line 9932) | function memoize(name, value, fn, nameTr) {
function Collection (line 9938) | function Collection(iterable, options, fn, nameTr) {
function Operation (line 9958) | function Operation(name, operation, options) {
function Paginator (line 10009) | function Paginator(name, paginator) {
function ResourceWaiter (line 10023) | function ResourceWaiter(name, waiter, options) {
function property (line 10056) | function property(obj, name, value) {
function memoizedProperty (line 10062) | function memoizedProperty(obj, name) {
function Shape (line 10068) | function Shape(shape, options, memberName) {
function CompositeShape (line 10183) | function CompositeShape(shape) {
function StructureShape (line 10192) | function StructureShape(shape, options) {
function ListShape (line 10242) | function ListShape(shape, options) {
function MapShape (line 10264) | function MapShape(shape, options) {
function TimestampShape (line 10286) | function TimestampShape(shape) {
function StringShape (line 10324) | function StringShape() {
function FloatShape (line 10337) | function FloatShape() {
function IntegerShape (line 10347) | function IntegerShape() {
function BinaryShape (line 10357) | function BinaryShape() {
function Base64Shape (line 10363) | function Base64Shape() {
function BooleanShape (line 10367) | function BooleanShape() {
function buildRequest (line 10624) | function buildRequest(req) {
function extractError (line 10638) | function extractError(resp) {
function extractData (line 10665) | function extractData(resp) {
function buildRequest (line 10689) | function buildRequest(req) {
function extractError (line 10706) | function extractError(resp) {
function extractData (line 10733) | function extractData(resp) {
function populateMethod (line 10782) | function populateMethod(req) {
function populateURI (line 10786) | function populateURI(req) {
function populateHeaders (line 10842) | function populateHeaders(req) {
function buildRequest (line 10859) | function buildRequest(req) {
function extractError (line 10865) | function extractError() {
function extractData (line 10868) | function extractData(resp) {
function populateBody (line 10917) | function populateBody(req) {
function buildRequest (line 10937) | function buildRequest(req) {
function extractError (line 10945) | function extractError(resp) {
function extractData (line 10949) | function extractData(resp) {
function populateBody (line 10983) | function populateBody(req) {
function buildRequest (line 11006) | function buildRequest(req) {
function extractError (line 11014) | function extractError(resp) {
function extractData (line 11033) | function extractData(resp) {
function QueryParamSerializer (line 11069) | function QueryParamSerializer() {
function ucfirst (line 11076) | function ucfirst(shape) {
function serializeStructure (line 11084) | function serializeStructure(prefix, struct, rules, fn) {
function serializeMap (line 11095) | function serializeMap(name, map, rules, fn) {
function serializeList (line 11107) | function serializeList(name, list, rules, fn) {
function serializeMember (line 11133) | function serializeMember(name, value, rules, fn) {
function generateRegionPrefix (line 11152) | function generateRegionPrefix(region) {
function derivedKeys (line 11160) | function derivedKeys(service) {
function applyConfig (line 11177) | function applyConfig(service, config) {
function configureEndpoint (line 11186) | function configureEndpoint(service) {
function isTerminalState (line 11290) | function isTerminalState(machine) {
function wrappedCallback (line 11418) | function wrappedCallback(response) {
function wrappedCallback (line 11436) | function wrappedCallback(err, data) {
function CHECK_ACCEPTORS (line 11655) | function CHECK_ACCEPTORS(resp) {
function callNextListener (line 11953) | function callNextListener(err) {
function setApi (line 12402) | function setApi(api) {
function signedUrlBuilder (line 12495) | function signedUrlBuilder(request) {
function signedUrlSigner (line 12523) | function signedUrlSigner(request) {
function AcceptorStateMachine (line 13159) | function AcceptorStateMachine(states, state) {
function DomXmlParser (line 13971) | function DomXmlParser() { }
function parseXml (line 14043) | function parseXml(xml, shape) {
function parseStructure (line 14054) | function parseStructure(xml, shape) {
function parseMap (line 14078) | function parseMap(xml, shape) {
function parseList (line 14096) | function parseList(xml, shape) {
function parseScalar (line 14110) | function parseScalar(xml, shape) {
function parseUnknown (line 14127) | function parseUnknown(xml) {
function XmlBuilder (line 14156) | function XmlBuilder() { }
function serialize (line 14165) | function serialize(xml, value, shape) {
function serializeStructure (line 14174) | function serializeStructure(xml, params, shape) {
function serializeMap (line 14195) | function serializeMap(xml, map, shape) {
function serializeList (line 14206) | function serializeList(xml, list, shape) {
function serializeScalar (line 14222) | function serializeScalar(xml, value, shape) {
function applyNamespaces (line 14226) | function applyNamespaces(xml, shape) {
function Buffer (line 14267) | function Buffer (subject, encoding, noZero) {
function _hexWrite (line 14404) | function _hexWrite (buf, string, offset, length) {
function _utf8Write (line 14431) | function _utf8Write (buf, string, offset, length) {
function _asciiWrite (line 14437) | function _asciiWrite (buf, string, offset, length) {
function _binaryWrite (line 14443) | function _binaryWrite (buf, string, offset, length) {
function _base64Write (line 14447) | function _base64Write (buf, string, offset, length) {
function _utf16leWrite (line 14453) | function _utf16leWrite (buf, string, offset, length) {
function _base64Slice (line 14594) | function _base64Slice (buf, start, end) {
function _utf8Slice (line 14602) | function _utf8Slice (buf, start, end) {
function _asciiSlice (line 14619) | function _asciiSlice (buf, start, end) {
function _binarySlice (line 14628) | function _binarySlice (buf, start, end) {
function _hexSlice (line 14632) | function _hexSlice (buf, start, end) {
function _utf16leSlice (line 14645) | function _utf16leSlice (buf, start, end) {
function _readUInt16 (line 14693) | function _readUInt16 (buf, offset, littleEndian, noAssert) {
function _readUInt32 (line 14725) | function _readUInt32 (buf, offset, littleEndian, noAssert) {
function _readInt16 (line 14782) | function _readInt16 (buf, offset, littleEndian, noAssert) {
function _readInt32 (line 14809) | function _readInt32 (buf, offset, littleEndian, noAssert) {
function _readFloat (line 14836) | function _readFloat (buf, offset, littleEndian, noAssert) {
function _readDouble (line 14853) | function _readDouble (buf, offset, littleEndian, noAssert) {
function _writeUInt16 (line 14883) | function _writeUInt16 (buf, value, offset, littleEndian, noAssert) {
function _writeUInt32 (line 14911) | function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
function _writeInt16 (line 14955) | function _writeInt16 (buf, value, offset, littleEndian, noAssert) {
function _writeInt32 (line 14982) | function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
function _writeFloat (line 15009) | function _writeFloat (buf, value, offset, littleEndian, noAssert) {
function _writeDouble (line 15033) | function _writeDouble (buf, value, offset, littleEndian, noAssert) {
function stringtrim (line 15111) | function stringtrim (str) {
function clamp (line 15169) | function clamp (index, len, defaultValue) {
function coerce (line 15179) | function coerce (length) {
function isArray (line 15184) | function isArray (subject) {
function isArrayish (line 15190) | function isArrayish (subject) {
function toHex (line 15196) | function toHex (n) {
function utf8ToBytes (line 15201) | function utf8ToBytes (str) {
function asciiToBytes (line 15218) | function asciiToBytes (str) {
function utf16leToBytes (line 15226) | function utf16leToBytes (str) {
function base64ToBytes (line 15240) | function base64ToBytes (str) {
function blitBuffer (line 15244) | function blitBuffer (src, dst, offset, length) {
function decodeUtf8Char (line 15254) | function decodeUtf8Char (str) {
function verifuint (line 15263) | function verifuint (value, max) {
function verifsint (line 15270) | function verifsint (value, max, min) {
function verifIEEE754 (line 15277) | function verifIEEE754 (value, max, min) {
function assert (line 15283) | function assert (test, message) {
function decode (line 15305) | function decode (elt) {
function b64ToByteArray (line 15323) | function b64ToByteArray (b64) {
function uint8ToBase64 (line 15362) | function uint8ToBase64 (uint8) {
function EventEmitter (line 15492) | function EventEmitter() {
function g (line 15619) | function g() {
function isFunction (line 15738) | function isFunction(arg) {
function isNumber (line 15742) | function isNumber(arg) {
function isObject (line 15746) | function isObject(arg) {
function isUndefined (line 15750) | function isUndefined(arg) {
function noop (line 15821) | function noop() {}
function error (line 15893) | function error(type) {
function map (line 15898) | function map(array, fn) {
function mapDomain (line 15907) | function mapDomain(string, fn) {
function ucs2decode (line 15912) | function ucs2decode(string) {
function ucs2encode (line 15936) | function ucs2encode(array) {
function basicToDigit (line 15950) | function basicToDigit(codePoint) {
function digitToBasic (line 15964) | function digitToBasic(digit, flag) {
function adapt (line 15969) | function adapt(delta, numPoints, firstTime) {
function decode (line 15980) | function decode(input) {
function encode (line 16060) | function encode(input) {
function toUnicode (line 16155) | function toUnicode(domain) {
function toASCII (line 16164) | function toASCII(domain) {
function hasOwnProperty (line 16217) | function hasOwnProperty(obj, prop) {
function map (line 16325) | function map (xs, f) {
function deprecated (line 16410) | function deprecated() {
function inspect (line 16451) | function inspect(obj, opts) {
function stylizeWithColor (line 16501) | function stylizeWithColor(str, styleType) {
function stylizeNoColor (line 16513) | function stylizeNoColor(str, styleType) {
function arrayToHash (line 16518) | function arrayToHash(array) {
function formatValue (line 16529) | function formatValue(ctx, value, recurseTimes) {
function formatPrimitive (line 16628) | function formatPrimitive(ctx, value) {
function formatError (line 16646) | function formatError(value) {
function formatArray (line 16651) | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
function formatProperty (line 16671) | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, arra...
function reduceToSingleString (line 16730) | function reduceToSingleString(output, base, braces) {
function isArray (line 16751) | function isArray(ar) {
function isBoolean (line 16756) | function isBoolean(arg) {
function isNull (line 16761) | function isNull(arg) {
function isNullOrUndefined (line 16766) | function isNullOrUndefined(arg) {
function isNumber (line 16771) | function isNumber(arg) {
function isString (line 16776) | function isString(arg) {
function isSymbol (line 16781) | function isSymbol(arg) {
function isUndefined (line 16786) | function isUndefined(arg) {
function isRegExp (line 16791) | function isRegExp(re) {
function isObject (line 16796) | function isObject(arg) {
function isDate (line 16801) | function isDate(d) {
function isError (line 16806) | function isError(e) {
function isFunction (line 16812) | function isFunction(arg) {
function isPrimitive (line 16817) | function isPrimitive(arg) {
function objectToString (line 16829) | function objectToString(o) {
function pad (line 16834) | function pad(n) {
function timestamp (line 16842) | function timestamp() {
function hasOwnProperty (line 16870) | function hasOwnProperty(obj, prop) {
function typedArraySupport (line 16898) | function typedArraySupport () {
function kMaxLength (line 16910) | function kMaxLength () {
function createBuffer (line 16916) | function createBuffer (that, length) {
function Buffer (line 16935) | function Buffer (arg, encodingOrOffset, length) {
function from (line 16958) | function from (that, value, encodingOrOffset, length) {
function assertSize (line 16991) | function assertSize (size) {
function alloc (line 16999) | function alloc (that, size, fill, encoding) {
function allocUnsafe (line 17017) | function allocUnsafe (that, size) {
function fromString (line 17037) | function fromString (that, string, encoding) {
function fromArrayLike (line 17058) | function fromArrayLike (that, array) {
function fromArrayBuffer (line 17067) | function fromArrayBuffer (that, array, byteOffset, length) {
function fromObject (line 17095) | function fromObject (that, obj) {
function checked (line 17125) | function checked (length) {
function SlowBuffer (line 17133) | function SlowBuffer (length) {
function byteLength (line 17216) | function byteLength (string, encoding) {
function slowToString (line 17260) | function slowToString (encoding, start, end) {
function swap (line 17323) | function swap (b, n, m) {
function bidirectionalIndexOf (line 17448) | function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 17498) | function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
function hexWrite (line 17566) | function hexWrite (buf, string, offset, length) {
function utf8Write (line 17592) | function utf8Write (buf, string, offset, length) {
function asciiWrite (line 17596) | function asciiWrite (buf, string, offset, length) {
function latin1Write (line 17600) | function latin1Write (buf, string, offset, length) {
function base64Write (line 17604) | function base64Write (buf, string, offset, length) {
function ucs2Write (line 17608) | function ucs2Write (buf, string, offset, length) {
function base64Slice (line 17686) | function base64Slice (buf, start, end) {
function utf8Slice (line 17694) | function utf8Slice (buf, start, end) {
function decodeCodePointsArray (line 17766) | function decodeCodePointsArray (codePoints) {
function asciiSlice (line 17783) | function asciiSlice (buf, start, end) {
function latin1Slice (line 17793) | function latin1Slice (buf, start, end) {
function hexSlice (line 17803) | function hexSlice (buf, start, end) {
function utf16leSlice (line 17816) | function utf16leSlice (buf, start, end) {
function checkOffset (line 17862) | function checkOffset (offset, ext, length) {
function checkInt (line 18023) | function checkInt (buf, value, offset, ext, max, min) {
function objectWriteUInt16 (line 18076) | function objectWriteUInt16 (buf, value, offset, littleEndian) {
function objectWriteUInt32 (line 18110) | function objectWriteUInt32 (buf, value, offset, littleEndian) {
function checkIEEE754 (line 18260) | function checkIEEE754 (buf, value, offset, ext, max, min) {
function writeFloat (line 18265) | function writeFloat (buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 18281) | function writeDouble (buf, value, offset, littleEndian, noAssert) {
function base64clean (line 18400) | function base64clean (str) {
function stringtrim (line 18409) | function stringtrim (str) {
function toHex (line 18414) | function toHex (n) {
function utf8ToBytes (line 18419) | function utf8ToBytes (string, units) {
function asciiToBytes (line 18489) | function asciiToBytes (str) {
function utf16leToBytes (line 18497) | function utf16leToBytes (str, units) {
function base64ToBytes (line 18513) | function base64ToBytes (str) {
function blitBuffer (line 18517) | function blitBuffer (src, dst, offset, length) {
function isnan (line 18525) | function isnan (val) {
function init (line 18540) | function init () {
function toByteArray (line 18553) | function toByteArray (b64) {
function tripletToBase64 (line 18588) | function tripletToBase64 (num) {
function encodeChunk (line 18592) | function encodeChunk (uint8, start, end) {
function fromByteArray (line 18602) | function fromByteArray (uint8) {
function toArray (line 18647) | function toArray(buf, bigEndian) {
function toBuffer (line 18661) | function toBuffer(arr, size, bigEndian) {
function hash (line 18670) | function hash(buf, fn, hashSize, bigEndian) {
function hmac (line 18693) | function hmac(fn, key, data) {
function hash (line 18713) | function hash(alg, key) {
function error (line 18736) | function error () {
function each (line 18757) | function each(a, f) {
function md5_vm_test (line 18782) | function md5_vm_test()
function core_md5 (line 18788) | function core_md5(x, len)
function md5_cmn (line 18884) | function md5_cmn(q, a, b, x, s, t)
function md5_ff (line 18888) | function md5_ff(a, b, c, d, x, s, t)
function md5_gg (line 18892) | function md5_gg(a, b, c, d, x, s, t)
function md5_hh (line 18896) | function md5_hh(a, b, c, d, x, s, t)
function md5_ii (line 18900) | function md5_ii(a, b, c, d, x, s, t)
function safe_add (line 18906) | function safe_add(x, y)
function bit_rol (line 18914) | function bit_rol(num, cnt)
function core_sha1 (line 18959) | function core_sha1(x, len)
function sha1_ft (line 19004) | function sha1_ft(t, b, c, d)
function sha1_kt (line 19013) | function sha1_kt(t)
function safe_add (line 19020) | function safe_add(x, y)
function rol (line 19028) | function rol(num, cnt)
function isArray (line 19116) | function isArray(obj) {
function isObject (line 19124) | function isObject(obj) {
function strictDeepEqual (line 19132) | function strictDeepEqual(first, second) {
function isFalse (line 19174) | function isFalse(obj) {
function objValues (line 19192) | function objValues(obj) {
function merge (line 19201) | function merge(a, b) {
function isAlpha (line 19292) | function isAlpha(ch) {
function isNum (line 19298) | function isNum(ch) {
function isAlphaNum (line 19302) | function isAlphaNum(ch) {
function Lexer (line 19309) | function Lexer() {
function Parser (line 19568) | function Parser() {
function TreeInterpreter (line 19928) | function TreeInterpreter(runtime) {
function Runtime (line 20193) | function Runtime(interpreter) {
function compile (line 20669) | function compile(stream) {
function tokenize (line 20675) | function tokenize(stream) {
function search (line 20680) | function search(data, expression) {
function hasOwnProperty (line 20699) | function hasOwnProperty(obj, prop) {
function Url (line 20812) | function Url() {
function urlParse (line 20863) | function urlParse(url, parseQueryString, slashesDenoteHost) {
function urlFormat (line 21048) | function urlFormat(obj) {
function urlResolve (line 21108) | function urlResolve(source, relative) {
function urlResolveObject (line 21116) | function urlResolveObject(source, relative) {
function isString (line 21353) | function isString(arg) {
function isObject (line 21357) | function isObject(arg) {
function isNull (line 21361) | function isNull(arg) {
function isNullOrUndefined (line 21364) | function isNullOrUndefined(arg) {
function XMLAttribute (line 21375) | function XMLAttribute(parent, name, value) {
function XMLBuilder (line 21414) | function XMLBuilder(name, options) {
function ctor (line 21474) | function ctor() { this.constructor = child; }
function XMLCData (line 21484) | function XMLCData(parent, text) {
function ctor (line 21524) | function ctor() { this.constructor = child; }
function XMLComment (line 21534) | function XMLComment(parent, text) {
function XMLDTDAttList (line 21578) | function XMLDTDAttList(parent, elementName, attributeName, attributeType...
function XMLDTDElement (line 21653) | function XMLDTDElement(parent, name, value) {
function XMLDTDEntity (line 21706) | function XMLDTDEntity(parent, pe, name, value) {
function XMLDTDNotation (line 21793) | function XMLDTDNotation(parent, name, value) {
function ctor (line 21850) | function ctor() { this.constructor = child; }
function XMLDeclaration (line 21862) | function XMLDeclaration(parent, version, encoding, standalone) {
function XMLDocType (line 21944) | function XMLDocType(parent, pubID, sysID) {
function ctor (line 22117) | function ctor() { this.constructor = child; }
function XMLElement (line 22139) | function XMLElement(parent, name, attributes) {
function XMLNode (line 22357) | function XMLNode(parent) {
function XMLProcessingInstruction (line 22671) | function XMLProcessingInstruction(parent, target, value) {
function ctor (line 22719) | function ctor() { this.constructor = child; }
function XMLRaw (line 22729) | function XMLRaw(parent, text) {
function XMLStringifier (line 22773) | function XMLStringifier(options) {
function ctor (line 22937) | function ctor() { this.constructor = child; }
function XMLText (line 22947) | function XMLText(parent, text) {
function every (line 23006) | function every(collection, predicate, thisArg) {
function arrayEvery (line 23018) | function arrayEvery(array, predicate) {
function baseAssign (line 23037) | function baseAssign(object, source, customizer) {
function baseCallback (line 23069) | function baseCallback(func, thisArg, argCount) {
function baseCopy (line 23091) | function baseCopy(source, object, props) {
function Object (line 23114) | function Object() {}
function baseEach (line 23134) | function baseEach(collection, iteratee) {
function baseEvery (line 23156) | function baseEvery(collection, predicate) {
function baseFor (line 23171) | function baseFor(object, iteratee, keysFunc) {
function baseForOwn (line 23193) | function baseForOwn(object, iteratee) {
function baseIsEqual (line 23203) | function baseIsEqual(value, other, customizer, isWhere, stackA, stackB) {
function baseIsEqualDeep (line 23241) | function baseIsEqualDeep(object, other, equalFunc, customizer, isWhere, ...
function baseIsFunction (line 23303) | function baseIsFunction(value) {
function baseIsMatch (line 23319) | function baseIsMatch(object, props, values, strictCompareFlags, customiz...
function baseMatches (line 23370) | function baseMatches(source) {
function baseMatchesProperty (line 23404) | function baseMatchesProperty(key, value) {
function baseProperty (line 23419) | function baseProperty(key) {
function baseToString (line 23441) | function baseToString(value) {
function bindCallback (line 23454) | function bindCallback(func, thisArg, argCount) {
function createAssigner (line 23487) | function createAssigner(assigner) {
function equalArrays (line 23526) | function equalArrays(array, other, equalFunc, customizer, isWhere, stack...
function equalByTag (line 23575) | function equalByTag(object, other, tag) {
function equalObjects (line 23608) | function equalObjects(object, other, equalFunc, customizer, isWhere, sta...
function isBindable (line 23674) | function isBindable(func) {
function isIndex (line 23697) | function isIndex(value, length) {
function isIterateeCall (line 23711) | function isIterateeCall(value, index, object) {
function isLength (line 23736) | function isLength(value) {
function isObjectLike (line 23744) | function isObjectLike(value) {
function isStrictComparable (line 23754) | function isStrictComparable(value) {
function shimKeys (line 23788) | function shimKeys(object) {
function toObject (line 23814) | function toObject(value) {
function isArguments (line 23834) | function isArguments(value) {
function isEmpty (line 23875) | function isEmpty(value) {
function isNative (line 23940) | function isNative(value) {
function isObject (line 23954) | function isObject(value) {
function isString (line 23974) | function isString(value) {
function isTypedArray (line 24032) | function isTypedArray(value) {
function create (line 24054) | function create(prototype, properties, guard) {
function keysIn (line 24103) | function keysIn(object) {
function escapeRegExp (line 24142) | function escapeRegExp(string) {
function identity (line 24198) | function identity(value) {
FILE: examples/babel-webpack/src/main.jsx
class SignUpForm (line 20) | class SignUpForm extends React.Component {
method constructor (line 21) | constructor(props) {
method handleEmailChange (line 29) | handleEmailChange(e) {
method handlePasswordChange (line 33) | handlePasswordChange(e) {
method handleSubmit (line 37) | handleSubmit(e) {
method render (line 57) | render() {
FILE: index.d.ts
type NodeCallback (line 5) | type NodeCallback<E,T> = (err?: E, result?: T) => void;
type IAuthenticationDetailsData (line 7) | interface IAuthenticationDetailsData {
class AuthenticationDetails (line 12) | class AuthenticationDetails {
type ICognitoStorage (line 20) | interface ICognitoStorage {
type ICognitoUserData (line 27) | interface ICognitoUserData {
class CognitoUser (line 33) | class CognitoUser {
type MFAOption (line 84) | interface MFAOption {
type ICognitoUserAttributeData (line 89) | interface ICognitoUserAttributeData {
class CognitoUserAttribute (line 94) | class CognitoUserAttribute {
type ISignUpResult (line 105) | interface ISignUpResult {
type ICognitoUserPoolData (line 111) | interface ICognitoUserPoolData {
class CognitoUserPool (line 118) | class CognitoUserPool {
type ICognitoUserSessionData (line 129) | interface ICognitoUserSessionData {
class CognitoUserSession (line 135) | class CognitoUserSession {
class CognitoIdentityServiceProvider (line 144) | class CognitoIdentityServiceProvider {
class CognitoAccessToken (line 148) | class CognitoAccessToken {
class CognitoIdToken (line 155) | class CognitoIdToken {
class CognitoRefreshToken (line 162) | class CognitoRefreshToken {
type ICookieStorageData (line 168) | interface ICookieStorageData {
class CookieStorage (line 174) | class CookieStorage implements ICognitoStorage {
FILE: ios/JKBigInteger/LibTomMath/tommath.c
function s_mp_mul_digs (line 23) | int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
function mp_to_unsigned_bin_n (line 92) | int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *o...
function mp_expt_d (line 105) | int mp_expt_d (mp_int * a, mp_digit b, mp_int * c)
function mp_set_int (line 144) | int mp_set_int (mp_int * a, unsigned long b)
function mp_add (line 174) | int mp_add (mp_int * a, mp_int * b, mp_int * c)
function mp_init (line 209) | int mp_init (mp_int * a)
function mp_cnt_lsb (line 241) | int mp_cnt_lsb(mp_int *a)
function mp_toom_sqr (line 272) | int
function mp_fread (line 480) | int mp_fread(mp_int *a, int radix, FILE *stream)
function mp_div_3 (line 529) | int
function mp_lcm (line 590) | int mp_lcm (mp_int * a, mp_int * b, mp_int * c)
function mp_reduce_is_2k (line 632) | int mp_reduce_is_2k(mp_int *a)
function mp_mod_2d (line 684) | int
function mp_n_root (line 730) | int mp_n_root (mp_int * a, mp_digit b, mp_int * c)
function mp_mulmod (line 835) | int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
function mp_reduce (line 889) | int mp_reduce (mp_int * x, mp_int * m, mp_int * mu)
function mp_karatsuba_sqr (line 974) | int mp_karatsuba_sqr (mp_int * a, mp_int * b)
function mp_prime_is_divisible (line 1075) | int mp_prime_is_divisible (mp_int * a, int *result)
function mp_zero (line 1103) | void mp_zero (mp_int * a)
function mp_toradix (line 1121) | int mp_toradix (mp_int * a, char *str, int radix)
function s_is_power_of_two (line 1177) | static int s_is_power_of_two(mp_digit b, int *p)
function mp_div_d (line 1196) | int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d)
function mp_sub (line 1275) | int
function mp_init_size (line 1316) | int mp_init_size (mp_int * a, int size)
function mp_prime_next_prime (line 1350) | int mp_prime_next_prime(mp_int *a, int t, int bbs_style)
function mp_invmod (line 1498) | int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
function mp_div_2 (line 1523) | int mp_div_2(mp_int * a, mp_int * b)
function mp_init_multi (line 1574) | int mp_init_multi(mp_int *mp, ...)
function mp_read_unsigned_bin (line 1615) | int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c)
function mp_karatsuba_mul (line 1680) | int mp_karatsuba_mul (mp_int * a, mp_int * b, mp_int * c)
function mp_mul_2 (line 1801) | int mp_mul_2(mp_int * a, mp_int * b)
function mp_and (line 1865) | int
function bn_reverse (line 1904) | void
function mp_prime_rabin_miller_trials (line 1938) | int mp_prime_rabin_miller_trials(int size)
function mp_init_copy (line 1958) | int mp_init_copy (mp_int * a, mp_int * b)
function fast_mp_montgomery_reduce (line 1979) | int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
function mp_lshd (line 2126) | int mp_lshd (mp_int * a, int b)
function mp_cmp (line 2175) | int
function mp_count_bits (line 2200) | int
function mp_or (line 2227) | int mp_or (mp_int * a, mp_int * b, mp_int * c)
function mp_exteuclid (line 2261) | int mp_exteuclid(mp_int *a, mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3)
function mp_prime_random_ex (line 2338) | int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_...
function mp_jacobi (line 2432) | int mp_jacobi (mp_int * a, mp_int * p, int *c)
function mp_radix_size (line 2517) | int mp_radix_size (mp_int * a, int radix, int *size)
function mp_rshd (line 2577) | void mp_rshd (mp_int * a, int b)
function mp_mul_d (line 2631) | int
function mp_montgomery_reduce (line 2692) | int
function s_mp_exptmod (line 2797) | int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int re...
function mp_sub_d (line 3027) | int
function mp_div_2d (line 3102) | int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
function mp_add_d (line 3181) | int
function mp_sqr (line 3275) | int
function mp_grow (line 3315) | int mp_grow (mp_int * a, int size)
function mp_mul_2d (line 3354) | int mp_mul_2d (mp_int * a, int b, mp_int * c)
function mp_cmp_d (line 3421) | int mp_cmp_d(mp_int * a, mp_digit b)
function mp_cmp_mag (line 3447) | int mp_cmp_mag (mp_int * a, mp_int * b)
function mp_clear (line 3484) | void
function mp_invmod_slow (line 3510) | int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c)
function mp_div (line 3669) | int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d)
function mp_div (line 3751) | int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
function mp_reduce_2k_setup_l (line 3941) | int mp_reduce_2k_setup_l(mp_int *a, mp_int *d)
function mp_montgomery_calc_normalization (line 3972) | int mp_montgomery_calc_normalization (mp_int * a, mp_int * b)
function mp_read_signed_bin (line 4009) | int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c)
function mp_xor (line 4032) | int
function mp_prime_is_prime (line 4164) | int mp_prime_is_prime (mp_int * a, int t, int *result)
function mp_reduce_2k_l (line 4226) | int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d)
function mp_exptmod_fast (line 4280) | int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int...
function s_mp_add (line 4569) | int
function mp_prime_fermat (line 4667) | int mp_prime_fermat (mp_int * a, mp_int * b, int *result)
function mp_abs (line 4707) | int
function mp_clamp (line 4735) | void
function mp_signed_bin_size (line 4759) | int mp_signed_bin_size (mp_int * a)
function mp_sqrt (line 4768) | int mp_sqrt(mp_int *arg, mp_int *ret)
function mp_montgomery_setup (line 4831) | int
function mp_fwrite (line 4871) | int mp_fwrite(mp_int *a, int radix, FILE *stream)
function mp_exch (line 4908) | void
function mp_init_set (line 4966) | int mp_init_set (mp_int * a, mp_digit b)
function mp_get_int (line 4980) | unsigned long mp_get_int(mp_int * a)
function mp_mul (line 5007) | int mp_mul (mp_int * a, mp_int * b, mp_int * c)
function mp_sqrmod (line 5055) | int
function mp_to_unsigned_bin (line 5078) | int mp_to_unsigned_bin (mp_int * a, unsigned char *b)
function s_mp_sqr (line 5108) | int s_mp_sqr (mp_int * a, mp_int * b)
function mp_neg (line 5174) | int mp_neg (mp_int * a, mp_int * b)
function fast_s_mp_mul_digs (line 5217) | int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
function fast_s_mp_mul_high_digs (line 5299) | int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
function mp_reduce_2k (line 5371) | int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d)
function mp_set (line 5414) | void mp_set (mp_int * a, mp_digit b)
function mp_mod_d (line 5424) | int
function mp_copy (line 5434) | int
function mp_to_signed_bin_n (line 5484) | int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *out...
function fast_s_mp_sqr (line 5506) | int fast_s_mp_sqr (mp_int * a, mp_int * b)
function mp_shrink (line 5593) | int mp_shrink (mp_int * a)
function mp_2expt (line 5619) | int
function mp_dr_reduce (line 5658) | int
function mp_toradix_n (line 5724) | int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen)
function mp_prime_miller_rabin (line 5797) | int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result)
function mp_reduce_is_2k_l (line 5876) | int mp_reduce_is_2k_l(mp_int *a)
function mp_dr_setup (line 5902) | void mp_dr_setup(mp_int *a, mp_digit *d)
function mp_reduce_2k_setup (line 5916) | int mp_reduce_2k_setup(mp_int *a, mp_digit *d)
function mp_reduce_setup (line 5947) | int mp_reduce_setup (mp_int * a, mp_int * b)
function mp_gcd (line 5961) | int mp_gcd (mp_int * a, mp_int * b, mp_int * c)
function s_mp_sub (line 6048) | int
function mp_toom_mul (line 6125) | int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c)
function mp_init_set_int (line 6385) | int mp_init_set_int (mp_int * a, unsigned long b)
function fast_mp_invmod (line 6403) | int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c)
function mp_to_signed_bin (line 6528) | int mp_to_signed_bin (mp_int * a, unsigned char *b)
function mp_mod (line 6543) | int
function mp_dr_is_modulus (line 6573) | int mp_dr_is_modulus(mp_int *a)
function mp_is_square (line 6620) | int mp_is_square(mp_int *arg,int *ret)
function mp_submod (line 6689) | int
function mp_rand (line 6713) | int
function mp_read_radix (line 6750) | int mp_read_radix (mp_int * a, const char *str, int radix)
function mp_clear_multi (line 6818) | void mp_clear_multi(mp_int *mp, ...)
function mp_addmod (line 6834) | int
function s_mp_mul_high_digs (line 6859) | int
function mp_unsigned_bin_size (line 6920) | int mp_unsigned_bin_size (mp_int * a)
FILE: ios/JKBigInteger/LibTomMath/tommath.h
type mp_digit (line 64) | typedef unsigned char mp_digit;
type mp_word (line 65) | typedef unsigned short mp_word;
type mp_digit (line 67) | typedef unsigned short mp_digit;
type mp_word (line 68) | typedef unsigned long mp_word;
type ulong64 (line 72) | typedef unsigned long long ulong64;
type long64 (line 73) | typedef signed long long long64;
type mp_digit (line 76) | typedef unsigned long mp_digit;
type mp_word (line 77) | typedef unsigned long mp_word __attribute__ ((mode(TI)));
type ulong64 (line 86) | typedef unsigned __int64 ulong64;
type long64 (line 87) | typedef signed __int64 long64;
type ulong64 (line 89) | typedef unsigned long long ulong64;
type long64 (line 90) | typedef signed long long long64;
type mp_digit (line 94) | typedef unsigned long mp_digit;
type ulong64 (line 95) | typedef ulong64 mp_word;
type mp_err (line 155) | typedef int mp_err;
type mp_int (line 179) | typedef struct {
FILE: lib/AuthenticationDetails.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function AuthenticationDetails (line 34) | function AuthenticationDetails(data) {
FILE: lib/AuthenticationHelper.js
function _interopRequireDefault (line 11) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 13) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function AuthenticationHelper (line 41) | function AuthenticationHelper(PoolName) {
FILE: lib/BigInteger.js
function BigInteger (line 56) | function BigInteger(a, b) {
function nbi (line 61) | function nbi() {
function am1 (line 80) | function am1(i, x, w, j, c, n) {
function am2 (line 91) | function am2(i, x, w, j, c, n) {
function am3 (line 106) | function am3(i, x, w, j, c, n) {
function int2char (line 154) | function int2char(n) {
function intAt (line 157) | function intAt(s, i) {
function bnpCopyTo (line 163) | function bnpCopyTo(r) {
function bnpFromInt (line 171) | function bnpFromInt(x) {
function nbv (line 178) | function nbv(i) {
function bnpFromString (line 187) | function bnpFromString(s, b) {
function bnpClamp (line 214) | function bnpClamp() {
function bnToString (line 222) | function bnToString(b) {
function bnNegate (line 256) | function bnNegate() {
function bnAbs (line 265) | function bnAbs() {
function bnCompareTo (line 270) | function bnCompareTo(a) {
function nbits (line 282) | function nbits(x) {
function bnBitLength (line 309) | function bnBitLength() {
function bnpDLShiftTo (line 315) | function bnpDLShiftTo(n, r) {
function bnpDRShiftTo (line 326) | function bnpDRShiftTo(n, r) {
function bnpLShiftTo (line 334) | function bnpLShiftTo(n, r) {
function bnpRShiftTo (line 354) | function bnpRShiftTo(n, r) {
function bnpSubTo (line 375) | function bnpSubTo(a, r) {
function bnpMultiplyTo (line 409) | function bnpMultiplyTo(a, r) {
function bnpSquareTo (line 424) | function bnpSquareTo(r) {
function bnpDivRemTo (line 443) | function bnpDivRemTo(m, q, r) {
function bnMod (line 509) | function bnMod(a) {
function bnpInvDigit (line 526) | function bnpInvDigit() {
function bnEquals (line 546) | function bnEquals(a) {
function bnpAddTo (line 551) | function bnpAddTo(a, r) {
function bnAdd (line 584) | function bnAdd(a) {
function bnSubtract (line 593) | function bnSubtract(a) {
function bnMultiply (line 602) | function bnMultiply(a) {
function bnDivide (line 611) | function bnDivide(a) {
function Montgomery (line 620) | function Montgomery(m) {
function montConvert (line 630) | function montConvert(x) {
function montRevert (line 639) | function montRevert(x) {
function montReduce (line 647) | function montReduce(x) {
function montSqrTo (line 670) | function montSqrTo(x, r) {
function montMulTo (line 677) | function montMulTo(x, y, r) {
function bnModPow (line 690) | function bnModPow(e, m, callback) {
FILE: lib/CognitoAccessToken.js
function _interopRequireDefault (line 9) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 11) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function _possibleConstructorReturn (line 13) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
function _inherits (line 15) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
function CognitoAccessToken (line 40) | function CognitoAccessToken() {
FILE: lib/CognitoIdToken.js
function _interopRequireDefault (line 9) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 11) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function _possibleConstructorReturn (line 13) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
function _inherits (line 15) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
function CognitoIdToken (line 40) | function CognitoIdToken() {
FILE: lib/CognitoJwtToken.js
function _classCallCheck (line 7) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoJwtToken (line 30) | function CognitoJwtToken(token) {
FILE: lib/CognitoRefreshToken.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoRefreshToken (line 30) | function CognitoRefreshToken() {
FILE: lib/CognitoUser.js
function _interopRequireDefault (line 43) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 45) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUser (line 110) | function CognitoUser(data) {
FILE: lib/CognitoUserAttribute.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserAttribute (line 31) | function CognitoUserAttribute() {
FILE: lib/CognitoUserPool.js
function _interopRequireDefault (line 17) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 19) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserPool (line 49) | function CognitoUserPool(data) {
FILE: lib/CognitoUserSession.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CognitoUserSession (line 33) | function CognitoUserSession() {
FILE: lib/CookieStorage.js
function _interopRequireWildcard (line 9) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function _classCallCheck (line 11) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function CookieStorage (line 24) | function CookieStorage(data) {
FILE: lib/DateHelper.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function DateHelper (line 30) | function DateHelper() {
FILE: lib/StorageHelper-rn.js
function _classCallCheck (line 7) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function MemoryStorage (line 30) | function MemoryStorage() {
function StorageHelper (line 122) | function StorageHelper() {
FILE: lib/StorageHelper.js
function _classCallCheck (line 5) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function MemoryStorage (line 29) | function MemoryStorage() {
function StorageHelper (line 90) | function StorageHelper() {
FILE: lib/index.js
function _interopRequireDefault (line 104) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
FILE: src/AuthenticationDetails.js
class AuthenticationDetails (line 19) | class AuthenticationDetails {
method constructor (line 28) | constructor(data) {
method getUsername (line 39) | getUsername() {
method getPassword (line 46) | getPassword() {
method getValidationData (line 53) | getValidationData() {
method getAuthParameters (line 60) | getAuthParameters() {
FILE: src/AuthenticationHelper.js
class AuthenticationHelper (line 42) | class AuthenticationHelper {
method constructor (line 47) | constructor(PoolName) {
method getSmallAValue (line 63) | getSmallAValue() {
method getLargeAValue (line 71) | getLargeAValue(callback) {
method generateRandomSmallA (line 91) | generateRandomSmallA() {
method generateRandomString (line 105) | generateRandomString() {
method getRandomPassword (line 112) | getRandomPassword() {
method getSaltDevices (line 119) | getSaltDevices() {
method getVerifierDevices (line 126) | getVerifierDevices() {
method generateHashDevice (line 137) | generateHashDevice(deviceGroupKey, username, callback) {
method calculateA (line 166) | calculateA(a, callback) {
method calculateU (line 187) | calculateU(A, B) {
method hash (line 200) | hash(buf) {
method hexHash (line 211) | hexHash(hexStr) {
method computehkdf (line 222) | computehkdf(ikm, salt) {
method getPasswordAuthenticationKey (line 241) | getPasswordAuthenticationKey(username, password, serverBValue, salt, c...
method calculateS (line 276) | calculateS(xValue, serverBValue, callback) {
method getNewPasswordRequiredChallengeUserAttributePrefix (line 301) | getNewPasswordRequiredChallengeUserAttributePrefix() {
method padHex (line 310) | padHex(bigInt) {
FILE: src/BigInteger.js
function BigInteger (line 52) | function BigInteger(a, b) {
function nbi (line 57) | function nbi() {
function am1 (line 76) | function am1(i,x,w,j,c,n) {
function am2 (line 87) | function am2(i,x,w,j,c,n) {
function am3 (line 101) | function am3(i,x,w,j,c,n) {
function int2char (line 150) | function int2char(n) {
function intAt (line 153) | function intAt(s, i) {
function bnpCopyTo (line 159) | function bnpCopyTo(r) {
function bnpFromInt (line 167) | function bnpFromInt(x) {
function nbv (line 176) | function nbv(i) {
function bnpFromString (line 185) | function bnpFromString(s, b) {
function bnpClamp (line 216) | function bnpClamp() {
function bnToString (line 223) | function bnToString(b) {
function bnNegate (line 258) | function bnNegate() {
function bnAbs (line 267) | function bnAbs() {
function bnCompareTo (line 272) | function bnCompareTo(a) {
function nbits (line 284) | function nbits(x) {
function bnBitLength (line 310) | function bnBitLength() {
function bnpDLShiftTo (line 316) | function bnpDLShiftTo(n, r) {
function bnpDRShiftTo (line 327) | function bnpDRShiftTo(n, r) {
function bnpLShiftTo (line 335) | function bnpLShiftTo(n, r) {
function bnpRShiftTo (line 353) | function bnpRShiftTo(n, r) {
function bnpSubTo (line 374) | function bnpSubTo(a, r) {
function bnpMultiplyTo (line 407) | function bnpMultiplyTo(a, r) {
function bnpSquareTo (line 421) | function bnpSquareTo(r) {
function bnpDivRemTo (line 443) | function bnpDivRemTo(m, q, r) {
function bnMod (line 503) | function bnMod(a) {
function bnpInvDigit (line 520) | function bnpInvDigit() {
function bnEquals (line 540) | function bnEquals(a) {
function bnpAddTo (line 545) | function bnpAddTo(a, r) {
function bnAdd (line 577) | function bnAdd(a) {
function bnSubtract (line 586) | function bnSubtract(a) {
function bnMultiply (line 595) | function bnMultiply(a) {
function bnDivide (line 604) | function bnDivide(a) {
function Montgomery (line 613) | function Montgomery(m) {
function montConvert (line 623) | function montConvert(x) {
function montRevert (line 632) | function montRevert(x) {
function montReduce (line 640) | function montReduce(x) {
function montSqrTo (line 665) | function montSqrTo(x, r) {
function montMulTo (line 672) | function montMulTo(x, y, r) {
function bnModPow (line 685) | function bnModPow(e, m, callback) {
FILE: src/CognitoAccessToken.js
class CognitoAccessToken (line 21) | class CognitoAccessToken extends CognitoJwtToken {
method constructor (line 26) | constructor({ AccessToken } = {}) {
FILE: src/CognitoIdToken.js
class CognitoIdToken (line 21) | class CognitoIdToken extends CognitoJwtToken {
method constructor (line 26) | constructor({ IdToken } = {}) {
FILE: src/CognitoJwtToken.js
class CognitoJwtToken (line 21) | class CognitoJwtToken {
method constructor (line 26) | constructor(token) {
method getJwtToken (line 35) | getJwtToken() {
method getExpiration (line 42) | getExpiration() {
method getIssuedAt (line 49) | getIssuedAt() {
method decodePayload (line 56) | decodePayload() {
FILE: src/CognitoRefreshToken.js
class CognitoRefreshToken (line 19) | class CognitoRefreshToken {
method constructor (line 24) | constructor({ RefreshToken } = {}) {
method getToken (line 32) | getToken() {
FILE: src/CognitoUser.js
class CognitoUser (line 71) | class CognitoUser {
method constructor (line 79) | constructor(data) {
method setSignInUserSession (line 101) | setSignInUserSession(signInUserSession) {
method getSignInUserSession (line 110) | getSignInUserSession() {
method getUsername (line 117) | getUsername() {
method getAuthenticationFlowType (line 124) | getAuthenticationFlowType() {
method setAuthenticationFlowType (line 133) | setAuthenticationFlowType(authenticationFlowType) {
method initiateAuth (line 148) | initiateAuth(authDetails, callback) {
method authenticateUser (line 194) | authenticateUser(authDetails, callback) {
method authenticateUserInternal (line 350) | authenticateUserInternal(dataAuthenticate, authenticationHelper, callb...
method completeNewPasswordChallenge (line 450) | completeNewPasswordChallenge(newPassword, requiredAttributeData, callb...
method getDeviceResponse (line 498) | getDeviceResponse(callback) {
method confirmRegistration (line 600) | confirmRegistration(confirmationCode, forceAliasCreation, callback) {
method sendCustomChallengeAnswer (line 628) | sendCustomChallengeAnswer(answerChallenge, callback) {
method sendMFACode (line 667) | sendMFACode(confirmationCode, callback, mfaType) {
method changePassword (line 767) | changePassword(oldUserPassword, newUserPassword, callback) {
method enableMFA (line 790) | enableMFA(callback) {
method setUserMfaPreference (line 821) | setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callbac...
method disableMFA (line 844) | disableMFA(callback) {
method deleteUser (line 869) | deleteUser(callback) {
method updateAttributes (line 895) | updateAttributes(attributes, callback) {
method getUserAttributes (line 917) | getUserAttributes(callback) {
method getMFAOptions (line 950) | getMFAOptions(callback) {
method deleteAttributes (line 973) | deleteAttributes(attributeList, callback) {
method resendConfirmationCode (line 995) | resendConfirmationCode(callback) {
method getSession (line 1016) | getSession(callback) {
method refreshSession (line 1074) | refreshSession(refreshToken, callback) {
method cacheTokens (line 1119) | cacheTokens() {
method cacheDeviceKeyAndPassword (line 1138) | cacheDeviceKeyAndPassword() {
method getCachedDeviceKeyAndPassword (line 1153) | getCachedDeviceKeyAndPassword() {
method clearCachedDeviceKeyAndPassword (line 1170) | clearCachedDeviceKeyAndPassword() {
method clearCachedTokens (line 1185) | clearCachedTokens() {
method getCognitoUserSession (line 1204) | getCognitoUserSession(authResult) {
method forgotPassword (line 1227) | forgotPassword(callback) {
method confirmPassword (line 1255) | confirmPassword(confirmationCode, newPassword, callback) {
method getAttributeVerificationCode (line 1281) | getAttributeVerificationCode(attributeName, callback) {
method verifyAttribute (line 1310) | verifyAttribute(attributeName, confirmationCode, callback) {
method getDevice (line 1335) | getDevice(callback) {
method forgetSpecificDevice (line 1360) | forgetSpecificDevice(deviceKey, callback) {
method forgetDevice (line 1384) | forgetDevice(callback) {
method setDeviceStatusRemembered (line 1404) | setDeviceStatusRemembered(callback) {
method setDeviceStatusNotRemembered (line 1429) | setDeviceStatusNotRemembered(callback) {
method listDevices (line 1457) | listDevices(limit, paginationToken, callback) {
method globalSignOut (line 1482) | globalSignOut(callback) {
method signOut (line 1503) | signOut() {
method sendMFASelectionAnswer (line 1514) | sendMFASelectionAnswer(answerChallenge, callback) {
method getUserContextData (line 1547) | getUserContextData() {
method associateSoftwareToken (line 1557) | associateSoftwareToken(callback) {
method verifySoftwareToken (line 1587) | verifySoftwareToken(totpCode, friendlyDeviceName, callback) {
FILE: src/CognitoUserAttribute.js
class CognitoUserAttribute (line 19) | class CognitoUserAttribute {
method constructor (line 25) | constructor({ Name, Value } = {}) {
method getValue (line 33) | getValue() {
method setValue (line 42) | setValue(value) {
method getName (line 50) | getName() {
method setName (line 59) | setName(name) {
method toString (line 67) | toString() {
method toJSON (line 74) | toJSON() {
FILE: src/CognitoUserPool.js
class CognitoUserPool (line 24) | class CognitoUserPool {
method constructor (line 36) | constructor(data) {
method getUserPoolId (line 67) | getUserPoolId() {
method getClientId (line 74) | getClientId() {
method signUp (line 92) | signUp(username, password, userAttributes, validationData, callback) {
method getCurrentUser (line 130) | getCurrentUser() {
method getUserContextData (line 155) | getUserContextData(username) {
FILE: src/CognitoUserSession.js
class CognitoUserSession (line 19) | class CognitoUserSession {
method constructor (line 27) | constructor({ IdToken, RefreshToken, AccessToken, ClockDrift } = {}) {
method getIdToken (line 41) | getIdToken() {
method getRefreshToken (line 48) | getRefreshToken() {
method getAccessToken (line 55) | getAccessToken() {
method getClockDrift (line 62) | getClockDrift() {
method calculateClockDrift (line 69) | calculateClockDrift() {
method isValid (line 81) | isValid() {
FILE: src/CookieStorage.js
class CookieStorage (line 5) | class CookieStorage {
method constructor (line 15) | constructor(data) {
method setItem (line 40) | setItem(key, value) {
method getItem (line 57) | getItem(key) {
method removeItem (line 66) | removeItem(key) {
method clear (line 79) | clear() {
FILE: src/DateHelper.js
class DateHelper (line 23) | class DateHelper {
method getNowString (line 27) | getNowString() {
FILE: src/StorageHelper-rn.js
constant MEMORY_KEY_PREFIX (line 20) | const MEMORY_KEY_PREFIX = '@MemoryStorage:';
class MemoryStorage (line 24) | class MemoryStorage {
method setItem (line 32) | static setItem(key, value) {
method getItem (line 44) | static getItem(key) {
method removeItem (line 53) | static removeItem(key) {
method clear (line 62) | static clear() {
method sync (line 72) | static sync(callback) {
class StorageHelper (line 94) | class StorageHelper {
method constructor (line 100) | constructor() {
method getStorage (line 108) | getStorage() {
FILE: src/StorageHelper.js
class MemoryStorage (line 21) | class MemoryStorage {
method setItem (line 29) | static setItem(key, value) {
method getItem (line 40) | static getItem(key) {
method removeItem (line 49) | static removeItem(key) {
method clear (line 57) | static clear() {
class StorageHelper (line 64) | class StorageHelper {
method constructor (line 70) | constructor() {
method getStorage (line 84) | getStorage() {
Condensed preview — 73 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,518K chars).
[
{
"path": ".babelrc",
"chars": 241,
"preview": "{\n \"presets\": [\n [\n \"es2015\", {\n \"loose\": true,\n \"modules\": false\n }\n ]\n ],\n \"env\": {\n "
},
{
"path": ".editorconfig",
"chars": 233,
"preview": "# Editor configuration, see http://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = "
},
{
"path": ".eslintignore",
"chars": 18,
"preview": "src/BigInteger.js\n"
},
{
"path": ".eslintrc.yaml",
"chars": 605,
"preview": "root: true\nextends:\n- airbnb-base\nenv:\n browser: true\nsettings:\n import/resolver: webpack\nrules:\n # Git-controlled\n "
},
{
"path": ".gitignore",
"chars": 200,
"preview": "/node_modules/\nnpm-debug.log\n\n/docs/\n\nes\n\nios/RNAWSCognito.xcodeproj/xcuserdata/\nios/RNAWSCognito.project.xcworkspace/xc"
},
{
"path": ".npmignore",
"chars": 0,
"preview": ""
},
{
"path": "LICENSE.txt",
"chars": 4787,
"preview": "Amazon Software License\nThis Amazon Software License (“License”) governs your use, reproduction, and distribution of the"
},
{
"path": "NOTICE.txt",
"chars": 1841,
"preview": "Amazon Cognito Identity Provider SDK for JavaScript\nCopyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserv"
},
{
"path": "README.md",
"chars": 530,
"preview": "# Amazon Cognito Identity SDK for JavaScript\n\n**NOTE: We have discontinued developing this library as part of this GitHu"
},
{
"path": "RNAWSCognito.podspec",
"chars": 815,
"preview": "# coding: utf-8\nPod::Spec.new do |s|\n s.name = \"RNAWSCognito\"\n s.version = \"1.29.0\"\n s.requires_arc = true\n s.pla"
},
{
"path": "android/build.gradle",
"chars": 530,
"preview": "buildscript {\n repositories {\n jcenter()\n }\n\n dependencies {\n classpath 'com.android.tools.build:"
},
{
"path": "android/src/main/AndroidManifest.xml",
"chars": 117,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.amazonaws\">\n\n</manifest>\n"
},
{
"path": "android/src/main/java/com/amazonaws/RNAWSCognitoModule.java",
"chars": 3137,
"preview": "package com.amazonaws;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.React"
},
{
"path": "android/src/main/java/com/amazonaws/RNAWSCognitoPackage.java",
"chars": 862,
"preview": "package com.amazonaws;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.facebo"
},
{
"path": "dist/amazon-cognito-identity.js",
"chars": 162119,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n * \n * Licensed under the Amazon Softw"
},
{
"path": "dist/aws-cognito-sdk.js",
"chars": 745770,
"preview": "// AWS SDK for JavaScript v2.6.4\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// License at htt"
},
{
"path": "enhance-rn.js",
"chars": 1700,
"preview": "import AWS from 'aws-sdk/global';\nimport { NativeModules } from 'react-native';\nimport * as enhancements from './src';\n\n"
},
{
"path": "enhance.js",
"chars": 263,
"preview": "import CognitoIdentityServiceProvider from 'aws-sdk/clients/cognitoidentityserviceprovider';\nimport * as enhancements fr"
},
{
"path": "examples/babel-webpack/.babelrc",
"chars": 64,
"preview": "{\n \"presets\": [\n \"es2015\",\n \"stage-0\",\n \"react\"\n ]\n}\n"
},
{
"path": "examples/babel-webpack/.editorconfig",
"chars": 131,
"preview": "root = true\n\n[*]\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\ncharset = utf-8\n\nindent_style = space\ninde"
},
{
"path": "examples/babel-webpack/README.md",
"chars": 335,
"preview": "# Babel webpack example\n\nTo run the example first setup your AWS configuration.\n\n```js\n// src/config.js\nexport default {"
},
{
"path": "examples/babel-webpack/index.html",
"chars": 128,
"preview": "<html>\n <body>\n <h1>Sign up</h1>\n <div id=\"app\"></div>\n <script src=\"dist/main.bundle.js\"></script>\n </body>\n"
},
{
"path": "examples/babel-webpack/package.json",
"chars": 546,
"preview": "{\n \"name\": \"babel-webpack\",\n \"version\": \"1.0.0\",\n \"description\": \"Babel webpack example \",\n \"scripts\": {\n \"build\""
},
{
"path": "examples/babel-webpack/src/config.js",
"chars": 89,
"preview": "export default {\n region: '',\n IdentityPoolId: '',\n UserPoolId: '',\n ClientId: '',\n}\n"
},
{
"path": "examples/babel-webpack/src/main.jsx",
"chars": 1867,
"preview": "import {Config, CognitoIdentityCredentials} from \"aws-sdk\";\nimport {\n CognitoUserPool,\n CognitoUserAttribute\n} from \"a"
},
{
"path": "examples/babel-webpack/webpack.config.babel.js",
"chars": 465,
"preview": "export default {\n resolve: {\n extensions: ['', '.js', 'jsx'],\n },\n devtool: \"cheap-eval-source-map\",\n entry: ['./"
},
{
"path": "index.d.ts",
"chars": 7905,
"preview": "declare module \"amazon-cognito-identity-js\" {\n\n import * as AWS from \"aws-sdk\";\n\n export type NodeCallback<E,T> = "
},
{
"path": "ios/JKBigInteger/JKBigDecimal.h",
"chars": 924,
"preview": "//\n// JKBigDecimal.h\n// JKBigInteger\n//\n// Created by Midfar Sun on 5/4/15.\n// Copyright (c) 2015 Midfar Sun. All ri"
},
{
"path": "ios/JKBigInteger/JKBigDecimal.m",
"chars": 7045,
"preview": "//\n// JKBigDecimal.m\n// JKBigInteger\n//\n// Created by Midfar Sun on 5/4/15.\n// Copyright (c) 2015 Midfar Sun. All ri"
},
{
"path": "ios/JKBigInteger/JKBigInteger.h",
"chars": 1573,
"preview": "//\n// JKBigInteger.h\n// JKBigInteger\n//\n// Created by Jānis Kiršteins on 5/21/13.\n// Copyright (c) 2013 Jānis Kiršte"
},
{
"path": "ios/JKBigInteger/JKBigInteger.m",
"chars": 9309,
"preview": "//\n// JKBigInteger.m\n// JKBigInteger\n//\n// Created by Jānis Kiršteins on 5/21/13.\n// Copyright (c) 2013 Jānis Kiršte"
},
{
"path": "ios/JKBigInteger/LibTomMath/tommath.c",
"chars": 153967,
"preview": "#include \"tommath.h\"\n\n#ifdef BN_S_MP_MUL_DIGS_C\n/* LibTomMath, multiple-precision integer library -- Tom St Denis\n *\n * "
},
{
"path": "ios/JKBigInteger/LibTomMath/tommath.h",
"chars": 17213,
"preview": "/* LibTomMath, multiple-precision integer library -- Tom St Denis\n *\n * LibTomMath is a library that provides multiple-p"
},
{
"path": "ios/JKBigInteger/LibTomMath/tommath_class.h",
"chars": 20991,
"preview": "#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))\n#if defined(LTM2)\n#define LTM3\n#endif\n#if defined(LTM1)\n#define L"
},
{
"path": "ios/JKBigInteger/LibTomMath/tommath_superclass.h",
"chars": 2269,
"preview": "/* super class file for PK algos */\n\n/* default ... include all MPI */\n#define LTM_ALL\n\n/* RSA only (does not support DH"
},
{
"path": "ios/RNAWSCognito.h",
"chars": 382,
"preview": "#if __has_include(\"RCTBridgeModule.h\")\n#import \"RCTBridgeModule.h\"\n#else\n#import <React/RCTBridgeModule.h>\n#endif\n\n#if _"
},
{
"path": "ios/RNAWSCognito.m",
"chars": 2938,
"preview": "#import \"RNAWSCognito.h\"\n\nstatic NSString* N_IN_HEX = @\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74"
},
{
"path": "ios/RNAWSCognito.xcodeproj/project.pbxproj",
"chars": 11183,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "ios/RNAWSCognito.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 135,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:\">\n </FileRef"
},
{
"path": "lib/AuthenticationDetails.js",
"chars": 2471,
"preview": "\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/AuthenticationHelper.js",
"chars": 13649,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _global = require('aws-sdk/global');\n\nvar _BigInteger = require('./BigInt"
},
{
"path": "lib/BigInteger.js",
"chars": 19311,
"preview": "\"use strict\";\n\nexports.__esModule = true;\n// A small implementation of BigInteger based on http://www-cs-students.stanfo"
},
{
"path": "lib/CognitoAccessToken.js",
"chars": 9796,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _CognitoJwtToken2 = require('./CognitoJwtToken');\n\nvar _CognitoJwtToken3 "
},
{
"path": "lib/CognitoIdToken.js",
"chars": 9748,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _CognitoJwtToken2 = require('./CognitoJwtToken');\n\nvar _CognitoJwtToken3 "
},
{
"path": "lib/CognitoJwtToken.js",
"chars": 4342,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _global = require('aws-sdk/global');\n\nfunction _classCallCheck(instance, "
},
{
"path": "lib/CognitoRefreshToken.js",
"chars": 1448,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/CognitoUser.js",
"chars": 63431,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _global = require('aws-sdk/global');\n\nvar _BigInteger = require('./BigInt"
},
{
"path": "lib/CognitoUserAttribute.js",
"chars": 2578,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/CognitoUserPool.js",
"chars": 8848,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _cognitoidentityserviceprovider = require('aws-sdk/clients/cognitoidentit"
},
{
"path": "lib/CognitoUserSession.js",
"chars": 3408,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/CookieStorage.js",
"chars": 2917,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _jsCookie = require('js-cookie');\n\nvar Cookies = _interopRequireWildcard("
},
{
"path": "lib/DateHelper.js",
"chars": 1935,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/StorageHelper-rn.js",
"chars": 6062,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _reactNative = require('react-native');\n\nfunction _classCallCheck(instanc"
},
{
"path": "lib/StorageHelper.js",
"chars": 2762,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof C"
},
{
"path": "lib/index.js",
"chars": 2887,
"preview": "'use strict';\n\nexports.__esModule = true;\n\nvar _AuthenticationDetails = require('./AuthenticationDetails');\n\nObject.defi"
},
{
"path": "package.json",
"chars": 2584,
"preview": "{\n \"name\": \"amazon-cognito-identity-js\",\n \"description\": \"Amazon Cognito Identity Provider JavaScript SDK\",\n \"version"
},
{
"path": "src/AuthenticationDetails.js",
"chars": 1776,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/AuthenticationHelper.js",
"chars": 9557,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/BigInteger.js",
"chars": 19016,
"preview": "// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods"
},
{
"path": "src/CognitoAccessToken.js",
"chars": 894,
"preview": "/*\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwar"
},
{
"path": "src/CognitoIdToken.js",
"chars": 870,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoJwtToken.js",
"chars": 1495,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoRefreshToken.js",
"chars": 952,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoUser.js",
"chars": 57777,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoUserAttribute.js",
"chars": 1799,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoUserPool.js",
"chars": 5443,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CognitoUserSession.js",
"chars": 2559,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/CookieStorage.js",
"chars": 2106,
"preview": "\nimport * as Cookies from 'js-cookie';\n\n/** @class */\nexport default class CookieStorage {\n\n /**\n * Constructs a new "
},
{
"path": "src/DateHelper.js",
"chars": 1561,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/StorageHelper-rn.js",
"chars": 3044,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/StorageHelper.js",
"chars": 2170,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "src/index.js",
"chars": 1580,
"preview": "/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Softwa"
},
{
"path": "webpack.config.js",
"chars": 2089,
"preview": "/* eslint-disable */\nvar webpack = require('webpack');\n\nvar banner = '/*!\\n' +\n' * Copyright 2016 Amazon.com,\\n' +\n' * I"
}
]
About this extraction
This page contains the full source code of the aws/amazon-cognito-identity-js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 73 files (1.4 MB), approximately 370.5k tokens, and a symbol index with 863 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.