Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
feat: add pkce strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
dudiq authored and Alex committed Jun 13, 2019
1 parent c3f2eb1 commit c800d38
Show file tree
Hide file tree
Showing 21 changed files with 722 additions and 527 deletions.
7 changes: 1 addition & 6 deletions env/dev.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const infura = {
key: 'zU4GTAQ0LjJNKddbyztc',
};

const isProduction = false;

const oauthServer = 'https://oauth2-dev.endpass.com:9000/oauth2';
const oauthServer = 'https://identity-dev.endpass.com/api/v1.1/oauth';

module.exports = {
infura,
isProduction,
oauthServer,
};
7 changes: 1 addition & 6 deletions env/prod.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const infura = {
key: 'zU4GTAQ0LjJNKddbyztc',
};

const isProduction = true;

const oauthServer = 'https://oauth2.endpass.com:9000/oauth2';
const oauthServer = 'https://identity.endpass.com/api/v1.1/oauth';

module.exports = {
infura,
isProduction,
oauthServer,
};
7 changes: 1 addition & 6 deletions env/test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const infura = {
key: 'zU4GTAQ0LjJNKddbyztc',
};

const isProduction = false;

const oauthServer = 'https://oauth2-dev.endpass.com:9000/oauth2';
const oauthServer = 'https://identity-dev.endpass.com/api/v1.1/oauth';

module.exports = {
infura,
isProduction,
oauthServer,
};
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@endpass/connect",
"version": "0.22.1-beta",
"version": "0.23.0-beta",
"authVersion": "",
"main": "./dist/endpass-connect.min.js",
"module": "./dist/endpass-connect.esm.js",
Expand All @@ -25,7 +25,7 @@
"build:lib": "NODE_ENV=production rollup -c",
"build:browser": "webpack --mode production",
"build:dev": "rollup -c",
"test": "jest && npm run e2e",
"test": "jest",
"setup-e2e": "bash e2e-preloader $npm_package_config_repo $npm_package_config_commit",
"e2e": "cypress run",
"e2e:open": "cypress open",
Expand Down Expand Up @@ -74,8 +74,8 @@
}
},
"dependencies": {
"@endpass/class": "^0.14.4",
"@endpass/utils": "^1.4.2",
"@endpass/class": "^0.14.5",
"@endpass/utils": "^1.7.0",
"axios": "^0.19.0",
"axios-token-interceptor": "^0.1.0",
"lodash.get": "^4.4.2",
Expand All @@ -94,12 +94,13 @@
"@commitlint/config-conventional": "^8.0.0",
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/git": "^7.0.8",
"@types/lodash": "^4.14.133",
"@types/lodash": "^4.14.134",
"@types/lodash.get": "^4.4.6",
"@types/node": "^12.0.4",
"@types/node": "^12.0.7",
"@types/web3": "^1.0.18",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"@typescript-eslint/eslint-plugin": "^1.10.2",
"@typescript-eslint/parser": "^1.10.2",
"axios-mock-adapter": "^1.16.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.6",
"commitizen": "^3.1.1",
Expand All @@ -112,14 +113,14 @@
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-prettier": "^3.1.0",
"gh-pages": "^2.0.1",
"husky": "^1.3.1",
"husky": "^2.4.0",
"jest": "^24.8.0",
"jest-localstorage-mock": "^2.4.0",
"lint-staged": "^8.1.7",
"prettier": "^1.17.1",
"lint-staged": "^8.2.0",
"prettier": "^1.18.2",
"regenerator-runtime": "^0.13.2",
"rimraf": "^2.6.3",
"rollup": "^1.13.1",
"rollup": "^1.15.0",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
Expand All @@ -131,7 +132,7 @@
"rollup-plugin-visualizer": "^1.1.1",
"semantic-release": "^15.13.12",
"typescript": "^3.5.1",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2"
"webpack": "^4.33.0",
"webpack-cli": "^3.3.4"
}
}
2 changes: 2 additions & 0 deletions src/Context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Network from '@endpass/class/Network';
import CrossWindowMessenger from '@endpass/class/CrossWindowMessenger';
import OauthPkceStrategy from '@/class/Oauth/OauthPkceStrategy';
import {
Emmiter,
InpageProvider,
Expand Down Expand Up @@ -242,6 +243,7 @@ export default class Context {
this.oauthRequestProvider = new Oauth({
...params,
clientId: this.oauthClientId,
strategy: OauthPkceStrategy,
});
await this.oauthRequestProvider.init();
}
Expand Down
6 changes: 3 additions & 3 deletions src/class/Bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Widget from './Widget';
export default class Bridge {
/**
* @param InstanceType<{import('@Context')} options.context Context link
* @param {String} options.url Url for open dialog
* @param {string} options.url Url for open dialog
* @param {any} options.initialPayload initial data for Auth
*/
constructor({ context, url, initialPayload }) {
Expand Down Expand Up @@ -124,7 +124,7 @@ export default class Bridge {
}

/**
* @param {Object} [parameters]
* @param {object} [parameters]
* @returns {Element}
*/
mountWidget(parameters) {
Expand All @@ -150,7 +150,7 @@ export default class Bridge {
* Ask messenger before til it give any answer and resolve promise
* Also, it is caches ready state and in the next time just resolve returned
* promise
* @returns {Promise<Boolean>}
* @returns {Promise<boolean>}
*/
checkReadyState() {
/* eslint-disable-next-line */
Expand Down
188 changes: 0 additions & 188 deletions src/class/Oauth.js

This file was deleted.

Loading

0 comments on commit c800d38

Please sign in to comment.