This repository was archived by the owner on Apr 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
feat(devices): Devices capabilities #320
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -663,6 +663,7 @@ Content-Type: application/json | |
| "callbackPublicKey": "BCp93zru09_hab2Bg37LpTNG__Pw6eMPEP2hrQpwuytoj3h4chXpGc-3qqdKyqjuvAiEupsnOd_RLyc7erJHWgA", | ||
| "callbackAuthKey": "w3b14Zjc-Afj2SDOLOyong", | ||
| "callbackIsExpired": false, | ||
| "capabilities": ["pushbox"], | ||
| "uaBrowser": "Firefox", | ||
| "uaBrowserVersion": "42", | ||
| "uaOS": "Android", | ||
|
|
@@ -720,7 +721,8 @@ Content-Type: application/json | |
| "callbackURL": "https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef", | ||
| "callbackPublicKey": "BCp93zru09_hab2Bg37LpTNG__Pw6eMPEP2hrQpwuytoj3h4chXpGc-3qqdKyqjuvAiEupsnOd_RLyc7erJHWgA", | ||
| "callbackAuthKey": "w3b14Zjc-Afj2SDOLOyong", | ||
| "callbackIsExpired": false | ||
| "callbackIsExpired": false, | ||
| "capabilities": ["pushbox"] | ||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -755,7 +757,8 @@ curl \ | |
| "callbackURL": "https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef", | ||
| "callbackPublicKey": "BCp93zru09_hab2Bg37LpTNG__Pw6eMPEP2hrQpwuytoj3h4chXpGc-3qqdKyqjuvAiEupsnOd_RLyc7erJHWgA", | ||
| "callbackAuthKey": "w3b14Zjc-Afj2SDOLOyong", | ||
| "callbackIsExpired": false | ||
| "callbackIsExpired": false, | ||
| "capabilities": ["pushbox"] | ||
| }' | ||
| ``` | ||
|
|
||
|
|
@@ -775,6 +778,10 @@ Content-Type: application/json | |
| * Conditions: if id already exists or sessionTokenId is already used by a different device | ||
| * Content-Type : 'application/json' | ||
| * Body : `{"errno":101",message":"Record already exists"}` | ||
| * Status Code : 400 Bad Request | ||
| * Conditions: if the device in the request body contained an unknown capability name | ||
| * Content-Type : 'application/json' | ||
| * Body : `{"errno":139",message":"Unknown device capability"}` | ||
| * Status Code : 500 Internal Server Error | ||
| * Conditions: if something goes wrong on the server | ||
| * Content-Type : 'application/json' | ||
|
|
@@ -799,7 +806,8 @@ curl \ | |
| "callbackURL": "https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef", | ||
| "callbackPublicKey": "BCp93zru09_hab2Bg37LpTNG__Pw6eMPEP2hrQpwuytoj3h4chXpGc-3qqdKyqjuvAiEupsnOd_RLyc7erJHWgA", | ||
| "callbackAuthKey": "w3b14Zjc-Afj2SDOLOyong", | ||
| "callbackIsExpired": false | ||
| "callbackIsExpired": false, | ||
| "capabilities": ["pushbox"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also document the new error response in the section below? |
||
| }' | ||
| ``` | ||
|
|
||
|
|
@@ -819,6 +827,10 @@ Content-Type: application/json | |
| * Conditions: if sessionTokenId is already used by a different device | ||
| * Content-Type : 'application/json' | ||
| * Body : `{"errno":101",message":"Record already exists"}` | ||
| * Status Code : 400 Bad Request | ||
| * Conditions: if the device in the request body contained an unknown capability name | ||
| * Content-Type : 'application/json' | ||
| * Body : `{"errno":139",message":"Unknown device capability"}` | ||
| * Status Code : 404 Not Found | ||
| * Conditions: if device(uid,id) is not found in the database | ||
| * Content-Type : 'application/json' | ||
|
|
@@ -909,6 +921,7 @@ Content-Length: 285 | |
| "deviceCallbackURL":null, | ||
| "deviceCallbackPublicKey":null, | ||
| "deviceCallbackIsExpired":false, | ||
| "deviceCapabilities":["pushbox"], | ||
| "mustVerify":true, | ||
| "tokenVerificationId":"12c41fac80fd6149f3f695e188b5f846" | ||
| } | ||
|
|
@@ -975,6 +988,7 @@ Content-Length: 285 | |
| "deviceCallbackURL":null, | ||
| "deviceCallbackPublicKey":null, | ||
| "deviceCallbackIsExpired":false, | ||
| "deviceCapabilities":["pushbox"], | ||
| "mustVerify":true, | ||
| "tokenVerificationId":"12c41fac80fd6149f3f695e188b5f846" | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -510,6 +510,7 @@ The deviceCallbackPublicKey and deviceCallbackAuthKey fields are urlsafe-base64 | |
| d.callbackPublicKey AS deviceCallbackPublicKey, | ||
| d.callbackAuthKey AS deviceCallbackAuthKey, | ||
| d.callbackIsExpired AS deviceCallbackIsExpired, | ||
| d.capabilities AS deviceCapabilities, | ||
| ut.mustVerify, ut.tokenVerificationId | ||
| * keyFetchToken : t.authKey, t.uid, t.keyBundle, t.createdAt, a.emailVerified, a.verifierSetAt | ||
| * keyFetchTokenWithVerificationStatus : t.authKey, t.uid, t.keyBundle, t.createdAt, a.emailVerified, | ||
|
|
@@ -743,13 +744,16 @@ Parameters: | |
| Public key for push service | ||
| * `callbackAuthKey` (string): | ||
| Auth key for push service | ||
| * `capabilities` (array): | ||
| Array of strings describing the current device capabilities | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also document the new error under |
||
|
|
||
| Returns: | ||
|
|
||
| * Resolves with: | ||
| * An empty object `{}` | ||
| * Rejects with: | ||
| * `error.duplicate()` if a device already exists with the same `uid` and `deviceId` | ||
| * `error.unknownDeviceCapability()` if the input device contained an unknown capability name | ||
| * Any error from the underlying storage system (wrapped in `error.wrap()`) | ||
|
|
||
| ## updateDevice(uid, deviceId, device) | ||
|
|
@@ -777,12 +781,15 @@ Parameters: | |
| Public key for push service | ||
| * `callbackAuthKey` (string): | ||
| Auth key for push service | ||
| * `capabilities` (array): | ||
| Array of strings describing the current device capabilities | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also document the new error under |
||
|
|
||
| Returns: | ||
|
|
||
| * Resolves with: | ||
| * An empty object `{}` | ||
| * Rejects with: | ||
| * `error.unknownDeviceCapability()` if the input device contained an unknown capability name | ||
| * Any error from the underlying storage system (wrapped in `error.wrap()`) | ||
|
|
||
| ## deleteDevice(uid, deviceId) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also document the new error response in the section below?