Skip to content

Commit

Permalink
feat: add discovery support (#145)
Browse files Browse the repository at this point in the history
* chore: allow app client secret blank for PKCE
* feat: add discovery support
* feat: refresh discovery when expired
* feat: support retry on initial request error
* enhancement: retry when fetch external discovery data error
* fix: expired check issue
* fix: wrong cache id
* fix review issue
* fix: remove unused peer deps
* fix: wrong ts peer deps
* fix karma-ts version issue
* chore: add discovery test
* fix: test in descri
* fix karma test
* chore: add tests
* fix discovery tests
* add discovery tests
* chore: add discovery tests
  • Loading branch information
embbnux committed Dec 2, 2020
1 parent 986b1ad commit a51d7f3
Show file tree
Hide file tree
Showing 11 changed files with 964 additions and 26 deletions.
6 changes: 3 additions & 3 deletions demo/src/apiKey.html
Expand Up @@ -26,7 +26,7 @@ <h1>
<div class="panel-body">

<div class="form-group">
<label for="appKey" class="col-xs-2 control-label">APP Key</label>
<label for="appKey" class="col-xs-2 control-label">App Client Id</label>

<div class="col-xs-10">
<input type="text" class="form-control" id="appKey" placeholder="APP Key" required>
Expand All @@ -37,7 +37,7 @@ <h1>
<label for="appSecret" class="col-xs-2 control-label">APP Secret</label>

<div class="col-xs-10">
<input type="text" class="form-control" id="appSecret" placeholder="App Secret" required>
<input type="text" class="form-control" id="appSecret" placeholder="App Client Secret">
</div>
</div>

Expand Down Expand Up @@ -117,4 +117,4 @@ <h1>
</script>

</body>
</html>
</html>
4 changes: 3 additions & 1 deletion demo/src/login.html
Expand Up @@ -157,7 +157,9 @@ <h1>
}

function show3leggedLogin({ implicit, usePKCE }) {

if (!implicit && !usePKCE && !platform._clientSecret) {
throw new Error('App Client Secret is required for authorization code flow');
}
platform
.loginWindow({
url: platform.loginUrl({ implicit, usePKCE })
Expand Down
4 changes: 2 additions & 2 deletions demo/src/scripts.js
Expand Up @@ -6,7 +6,7 @@
var appSecret = localStorage.getItem('ringcentral-demo-appSecret');
var server = localStorage.getItem('ringcentral-demo-server');

if (!appSecret || !appKey || !server) {
if (!appKey || !server) {
if (location.href.indexOf('apiKey.html') == -1) {
location.assign('apiKey.html');
}
Expand Down Expand Up @@ -39,4 +39,4 @@

};

})();
})();
1 change: 0 additions & 1 deletion redux/package.json
Expand Up @@ -27,7 +27,6 @@
"peerDependencies": {
"@ringcentral/sdk": ">=4",
"react": "*",
"react-dom": "*",
"redux": "*"
},
"main": "./lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/SDK-spec.ts
Expand Up @@ -2,7 +2,7 @@ import {expect, SDK, spy} from './test/test';

describe('RingCentral.SDK', () => {
const test = async (suite, server) => {
suite.timeout(10000); // Per SLA should be 3 seconds
suite.timeout(20000); // Per SLA should be 3 seconds

const sdk = new SDK({
server,
Expand Down

0 comments on commit a51d7f3

Please sign in to comment.