Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(keys): replace scope key TLD (#505) r=@rfk
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Nov 24, 2017
1 parent 5d772f6 commit a5e6d8f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/dev.json
Expand Up @@ -43,7 +43,7 @@
"termsUri": "",
"privacyUri": "",
"trusted": true,
"allowedScopes": "https://identity.mozilla.org/apps/notes",
"allowedScopes": "https://identity.mozilla.com/apps/notes",
"publicClient": true
},
{
Expand Down Expand Up @@ -122,7 +122,7 @@
"allowHttpRedirects": true,
"scopes": [
{
"scope": "https://identity.mozilla.org/apps/notes",
"scope": "https://identity.mozilla.com/apps/notes",
"hasScopedKeys": true
}
]
Expand Down
8 changes: 4 additions & 4 deletions config/test.json
Expand Up @@ -64,7 +64,7 @@
"imageUri": "https://mozorg.cdn.mozilla.net/media/img/firefox/new/header-firefox.png",
"redirectUri": "https://example.domain/return?foo=bar",
"trusted": true,
"allowedScopes": "https://identity.mozilla.org/apps/sample-scope-can-scope-key https://identity.mozilla.org/apps/sample-scope kv https://identity.mozilla.org/apps/another-can-scope-key",
"allowedScopes": "https://identity.mozilla.com/apps/sample-scope-can-scope-key https://identity.mozilla.com/apps/sample-scope kv https://identity.mozilla.com/apps/another-can-scope-key",
"canGrant": false,
"publicClient": false
}
Expand All @@ -90,15 +90,15 @@
"allowHttpRedirects": true,
"scopes": [
{
"scope": "https://identity.mozilla.org/apps/sample-scope",
"scope": "https://identity.mozilla.com/apps/sample-scope",
"hasScopedKeys": false
},
{
"scope": "https://identity.mozilla.org/apps/sample-scope-can-scope-key",
"scope": "https://identity.mozilla.com/apps/sample-scope-can-scope-key",
"hasScopedKeys": true
},
{
"scope": "https://identity.mozilla.org/apps/another-can-scope-key",
"scope": "https://identity.mozilla.com/apps/another-can-scope-key",
"hasScopedKeys": true
}
]
Expand Down
6 changes: 3 additions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bVx_8EXJFKDDOGzK9v7Zq6D7gkhP-CHEaNYaTHMn65tLQtBS6snGdaXlxoGHMWmDL6STbnJzWa7sa4QwHf-AgT1rUkQQAUHNa_XLZ0FEzqiCPctMadlihiUZL2V6vxIDBS4mHUF4qj0FvIMJflivDnJVkRNijDuP-h-Lh_A~eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJvYXV0aC5meGEiLCJleHAiOjE1MDY5Njk2OTY0MzksImlzcyI6ImFwaS5hY2NvdW50cy5maXJlZm94LmNvbSJ9.M5xyk3RffucgaavjbUm7Eqnt47hzeGbGa2VR3jnVEIlRHfz5S25Qf3ngejwee7XECvIywbaKWeijXFOwS-EkB-7qP1gl4oNJjPmbnCk7S1lgckLWvdMIU-HLGKjrN6Mw76__LzvAbsusSeGmsvTCIVuOJ49Xs3tC1fLyB_re0QNpCcS6AUnJ1KOxIMEM3Om7ysNO5F_AqcD3PwlEti5lbwSk8iP5TWL12C2Nkb_6Hxze_mA1NZNAHOips9bF2J7oy1hqGoMYj1XYZrsyjpPWEuZQATAPlKSjbh1hq-UtDeT7DlwEmIbIUd3JA8qh1MkHKGgavd4fIMap0IPmr9rs4A",
"scope": "https://identity.mozilla.org/apps/sample-scope-can-scope-key"
"scope": "https://identity.mozilla.com/apps/sample-scope-can-scope-key"
}'
```

Expand All @@ -561,8 +561,8 @@ A valid response will return JSON the scoped key information for every scope tha

```json
{
"https://identity.mozilla.org/apps/sample-scope-can-scope-key": {
"identifier": "https://identity.mozilla.org/apps/sample-scope-can-scope-key",
"https://identity.mozilla.com/apps/sample-scope-can-scope-key": {
"identifier": "https://identity.mozilla.com/apps/sample-scope-can-scope-key",
"keyRotationSecret": "0000000000000000000000000000000000000000000000000000000000000000",
"keyRotationTimestamp": 1506970363512
}
Expand Down
10 changes: 5 additions & 5 deletions test/api.js
Expand Up @@ -346,7 +346,7 @@ describe('/v1', function() {
});

it('should succeed with https:// scopes', function() {
const scopes = 'profile:email profile:uid https://identity.mozilla.org/apps/notes https://identity.mozilla.org/apps/lockbox';
const scopes = 'profile:email profile:uid https://identity.mozilla.com/apps/notes https://identity.mozilla.com/apps/lockbox';
const client = clientByName('Mocha');
mockAssertion().reply(200, VERIFY_GOOD);

Expand Down Expand Up @@ -2237,7 +2237,7 @@ describe('/v1', function() {
const SCOPED_CLIENT_ID = 'aaa6b9b3a65a1871';
const NO_KEY_SCOPES_CLIENT_ID = '38a6b9b3a65a1871';
const BAD_CLIENT_ID = '0006b9b3a65a1871';
const SCOPE_CAN_SCOPE_KEY = 'https://identity.mozilla.org/apps/sample-scope-can-scope-key';
const SCOPE_CAN_SCOPE_KEY = 'https://identity.mozilla.com/apps/sample-scope-can-scope-key';
let genericRequest;

beforeEach(function () {
Expand All @@ -2261,15 +2261,15 @@ describe('/v1', function() {

const body = res.result[SCOPE_CAN_SCOPE_KEY];

assert.equal(body.identifier, 'https://identity.mozilla.org/apps/sample-scope-can-scope-key');
assert.equal(body.identifier, 'https://identity.mozilla.com/apps/sample-scope-can-scope-key');
assert.equal(body.keyRotationSecret, '0000000000000000000000000000000000000000000000000000000000000000');
assert.equal(body.keyRotationTimestamp, 123456);
});
});

it('works with multiple scopes', () => {
mockAssertion().reply(200, VERIFY_GOOD);
const ANOTHER_CAN_SCOPE_KEY = 'https://identity.mozilla.org/apps/another-can-scope-key';
const ANOTHER_CAN_SCOPE_KEY = 'https://identity.mozilla.com/apps/another-can-scope-key';
genericRequest.payload.scope = `${SCOPE_CAN_SCOPE_KEY} ${ANOTHER_CAN_SCOPE_KEY}`;

return Server.api.post(genericRequest)
Expand Down Expand Up @@ -2305,7 +2305,7 @@ describe('/v1', function() {
});

it('fails with a non-scoped-key scope ', () => {
genericRequest.payload.scope = 'https://identity.mozilla.org/apps/sample-scope';
genericRequest.payload.scope = 'https://identity.mozilla.com/apps/sample-scope';
mockAssertion().reply(200, VERIFY_GOOD);
return Server.api.post(genericRequest)
.then((res) => {
Expand Down

0 comments on commit a5e6d8f

Please sign in to comment.