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

Commit c58d237

Browse files
committed
feat(clients): report trusted property in GET /client/:id
1 parent b8927a8 commit c58d237

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ A valid 200 response will be a JSON blob with the following properties:
8888
- `name`: A string name of the client.
8989
- `image_uri`: A url to a logo or image that represents the client.
9090
- `redirect_uri`: The url registered to redirect to after successful oauth.
91+
- `trusted`: Whether the client is a trusted internal application.
9192

9293
**Example:**
9394

9495
```json
9596
{
9697
"name": "Where's My Fox",
9798
"image_uri": "https://mozilla.org/firefox.png",
98-
"redirect_uri": "https://wheres.my.firefox.com/oauth"
99+
"redirect_uri": "https://wheres.my.firefox.com/oauth",
100+
"trusted": true
99101
}
100102
```
101103

lib/routes/client/get.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
schema: {
2222
id: validators.clientId,
2323
name: Joi.string().required(),
24+
trusted: Joi.boolean().required(),
2425
image_uri: Joi.any(),
2526
redirect_uri: Joi.string().required().allow('')
2627
}
@@ -37,6 +38,7 @@ module.exports = {
3738
reply({
3839
id: hex(client.id),
3940
name: client.name,
41+
trusted: client.trusted,
4042
image_uri: client.imageUri,
4143
redirect_uri: client.redirectUri
4244
});

test/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ describe('/v1', function() {
808808
assert.equal(body.name, client.name);
809809
assert(body.image_uri);
810810
assert(body.redirect_uri);
811+
assert(body.trusted);
811812
}).done(done, done);
812813
});
813814
});

0 commit comments

Comments
 (0)