Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

able to set proxy agent to cognito http client #724

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,619 changes: 829 additions & 790 deletions packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions packages/amazon-cognito-identity-js/es/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ var Client = function () {
* @param {string} region AWS region
* @param {string} endpoint endpoint
*/
function Client(region, endpoint) {
function Client(region, endpoint, options) {
_classCallCheck(this, Client);

this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/';
this.userAgent = UserAgent.prototype.userAgent || 'aws-amplify/0.1.x js';
this.options = options || {};
}

/**
Expand All @@ -33,13 +34,13 @@ var Client = function () {
'X-Amz-User-Agent': this.userAgent
};

var options = {
var options = Object.assign(this.options, {
headers: headers,
method: 'POST',
mode: 'cors',
cache: 'no-cache',
body: JSON.stringify(params)
};
});

var response = void 0;

Expand Down
3 changes: 2 additions & 1 deletion packages/amazon-cognito-identity-js/es/CognitoUserPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var CognitoUserPool = function () {
var _ref = data || {},
UserPoolId = _ref.UserPoolId,
ClientId = _ref.ClientId,
ProxyAgent = _ref.ProxyAgent,
endpoint = _ref.endpoint,
AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;

Expand All @@ -55,7 +56,7 @@ var CognitoUserPool = function () {
this.userPoolId = UserPoolId;
this.clientId = ClientId;

this.client = new Client(region, endpoint);
this.client = new Client(region, endpoint, { agent: ProxyAgent || null });

/**
* By default, AdvancedSecurityDataCollectionFlag is set to true,
Expand Down
7 changes: 4 additions & 3 deletions packages/amazon-cognito-identity-js/lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ var Client = function () {
* @param {string} region AWS region
* @param {string} endpoint endpoint
*/
function Client(region, endpoint) {
function Client(region, endpoint, options) {
_classCallCheck(this, Client);

this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/';
this.userAgent = _UserAgent2.default.prototype.userAgent || 'aws-amplify/0.1.x js';
this.options = options || {};
}

/**
Expand All @@ -41,13 +42,13 @@ var Client = function () {
'X-Amz-User-Agent': this.userAgent
};

var options = {
var options = Object.assign(this.options, {
headers: headers,
method: 'POST',
mode: 'cors',
cache: 'no-cache',
body: JSON.stringify(params)
};
});

var response = void 0;

Expand Down
3 changes: 2 additions & 1 deletion packages/amazon-cognito-identity-js/lib/CognitoUserPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var CognitoUserPool = function () {
var _ref = data || {},
UserPoolId = _ref.UserPoolId,
ClientId = _ref.ClientId,
ProxyAgent = _ref.ProxyAgent,
endpoint = _ref.endpoint,
AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;

Expand All @@ -66,7 +67,7 @@ var CognitoUserPool = function () {
this.userPoolId = UserPoolId;
this.clientId = ClientId;

this.client = new _Client2.default(region, endpoint);
this.client = new _Client2.default(region, endpoint, { agent: ProxyAgent || null });

/**
* By default, AdvancedSecurityDataCollectionFlag is set to true,
Expand Down
Loading