From 32d339e6b1b76030dbf7b6087ecd64ed328735bf Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Mon, 2 Apr 2018 11:01:37 -0300 Subject: [PATCH 1/3] Update docs about settings.oauth endpoint --- _data/toc.yml | 2 +- .../documentation/documentation-map/README.md | 2 +- developer-guides/rest-api/README.md | 16 ++++++++-------- .../rest-api/miscellaneous/README.md | 1 - developer-guides/rest-api/settings/README.md | 11 ++++++----- .../settings-oauth => settings/oauth}/README.md | 6 ++++-- 6 files changed, 20 insertions(+), 18 deletions(-) rename developer-guides/rest-api/{miscellaneous/settings-oauth => settings/oauth}/README.md (86%) diff --git a/_data/toc.yml b/_data/toc.yml index f7cac7858e..699697de9e 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -300,7 +300,6 @@ - users - Miscellaneous: - info - - settings.oauth - statistics - statistics.list - Rooms: @@ -309,6 +308,7 @@ - Settings: - get - get-by-id + - oauth - public - service-configuration - update diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 9388c213f6..e059e0772f 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -344,7 +344,6 @@ Here you can also find what articles are incomplete and missing. - users - Miscellaneous: - info - - settings.oauth - statistics - statistics.list - Rooms: @@ -353,6 +352,7 @@ Here you can also find what articles are incomplete and missing. - Settings: - get - update + - oauth - Spotlight - Users: - create diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index 32508c5a47..8436bbb12e 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -21,7 +21,6 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | Url | Short Description | Details Page | | :------------------------ | :-------------------------------------------------- | :------------------------------------- | | `/api/v1/info` | Information about the Rocket.Chat server. | [Link](miscellaneous/info/) | -| `/api/v1/settings.oauth` | Return list of all available oauth services. | [Link](miscellaneous/settings-oauth/) | | `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics/) | | `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics-list/) | @@ -162,13 +161,14 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and ### Settings -| Url | Method | Short Description | Details Page | -| :-------------------------------- | :----- | :--------------------------------- | :---------------------------------------------- | -| `/api/v1/settings` | `GET` | Lists all private settings. | [Link](settings/get/) | -| `/api/v1/settings.public` | `GET` | Lists all public settings. | [Link](settings/public/) | -| `/api/v1/service.configurations` | `GET` | Lists all service configurations. | [Link](settings/service-configuration/) | -| `/api/v1/settings/:_id` | `GET` | Gets a setting. | [Link](settings/get-by-id/) | -| `/api/v1/settings/:_id` | `POST` | Updates a setting. | [Link](settings/update/) | +| Url | Method | Short Description | Details Page | +| :-------------------------------- | :----- | :-------------------------------------------------- | :---------------------------------------------- | +| `/api/v1/settings` | `GET` | Lists all private settings. | [Link](settings/get/) | +| `/api/v1/settings.public` | `GET` | Lists all public settings. | [Link](settings/public/) | +| `/api/v1/settings.oauth` | `GET` | Return list of all available oauth services. | [Link](settings/oauth/) | +| `/api/v1/service.configurations` | `GET` | Lists all service configurations. | [Link](settings/service-configuration/) | +| `/api/v1/settings/:_id` | `GET` | Gets a setting. | [Link](settings/get-by-id/) | +| `/api/v1/settings/:_id` | `POST` | Updates a setting. | [Link](settings/update/) | ## Language specific wrappers diff --git a/developer-guides/rest-api/miscellaneous/README.md b/developer-guides/rest-api/miscellaneous/README.md index e388aaa74e..3206137301 100644 --- a/developer-guides/rest-api/miscellaneous/README.md +++ b/developer-guides/rest-api/miscellaneous/README.md @@ -5,6 +5,5 @@ Just some generic information, such as information about the server and authenti | Url | Short Description | Details Page | | :--- | :--- | :--- | | `/api/v1/info` | Information about the Rocket.Chat server. | [info](info/) | -| `/api/v1/settings.oauth` | Return list of all available oauth services. | [Link](settings-oauth/) | | `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](statistics/) | | `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](statistics-list/) | diff --git a/developer-guides/rest-api/settings/README.md b/developer-guides/rest-api/settings/README.md index 8b7fdf1c2a..63e76ed4d6 100644 --- a/developer-guides/rest-api/settings/README.md +++ b/developer-guides/rest-api/settings/README.md @@ -4,8 +4,9 @@ You can get and update the settings via the REST API, only if you have permissio | Url | Method | Short Description | Details Page | | :--- | :--- | :--- | :--- | -| `/api/v1/settings` | `GET` | Lists all private settings. | [Link](get/) | -| `/api/v1/settings.public` | `GET` | Lists all public settings. | [Link](public/) | -| `/api/v1/service.configurations` | `GET` | Lists all service configurations. | [Link](service-configuration/) | -| `/api/v1/settings/:_id` | `GET` | Gets a setting. | [Link](get-by-id/) | -| `/api/v1/settings/:_id` | `POST` | Updates a setting. | [Link](update/) | +| `/api/v1/settings` | `GET` | Lists all private settings. | [Link](get/) | +| `/api/v1/settings.public` | `GET` | Lists all public settings. | [Link](public/) | +| `/api/v1/settings.oauth` | `GET` | Return list of all available oauth services. | [Link](oauth/) | +| `/api/v1/service.configurations` | `GET` | Lists all service configurations. | [Link](service-configuration/) | +| `/api/v1/settings/:_id` | `GET` | Gets a setting. | [Link](get-by-id/) | +| `/api/v1/settings/:_id` | `POST` | Updates a setting. | [Link](update/) | diff --git a/developer-guides/rest-api/miscellaneous/settings-oauth/README.md b/developer-guides/rest-api/settings/oauth/README.md similarity index 86% rename from developer-guides/rest-api/miscellaneous/settings-oauth/README.md rename to developer-guides/rest-api/settings/oauth/README.md index 8ccd69bfd8..dffa969d7f 100644 --- a/developer-guides/rest-api/miscellaneous/settings-oauth/README.md +++ b/developer-guides/rest-api/settings/oauth/README.md @@ -23,7 +23,8 @@ curl http://localhost:3000/api/v1/settings.oauth "appId": "test", "buttonLabelText": "test", "buttonColor": "#13679A", - "buttonLabelColor": "#FFFFFF" + "buttonLabelColor": "#FFFFFF", + "custom": false }, { "id": "iJeY7x4wxnh2p3pLr", @@ -31,7 +32,8 @@ curl http://localhost:3000/api/v1/settings.oauth "appId": "test", "buttonLabelText": "", "buttonColor": "", - "buttonLabelColor": "" + "buttonLabelColor": "", + "custom": false } ], "success": true From b04100a16dd75390cf4050c412ae1a650b6eb8ad Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Thu, 5 Apr 2018 16:53:24 -0300 Subject: [PATCH 2/3] Fix the responde object according to the latest changes in the endpoint settings.oauth --- .../rest-api/settings/oauth/README.md | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/developer-guides/rest-api/settings/oauth/README.md b/developer-guides/rest-api/settings/oauth/README.md index dffa969d7f..64b6f75581 100644 --- a/developer-guides/rest-api/settings/oauth/README.md +++ b/developer-guides/rest-api/settings/oauth/README.md @@ -20,7 +20,7 @@ curl http://localhost:3000/api/v1/settings.oauth { "id": "iJeY7x4wxnh2p3pLr", "name": "facebook", - "appId": "test", + "clientId": "test", "buttonLabelText": "test", "buttonColor": "#13679A", "buttonLabelColor": "#FFFFFF", @@ -29,11 +29,31 @@ curl http://localhost:3000/api/v1/settings.oauth { "id": "iJeY7x4wxnh2p3pLr", "name": "twitter", - "appId": "test", + "clientId": "test", "buttonLabelText": "", "buttonColor": "", "buttonLabelColor": "", "custom": false + }, + { + "_id": "5RQ4SBL3NuZKsqxaF", + "service": "test", + "clientId": "test", + "secret": "test", + "custom": true, + "serverURL": "/test/test", + "tokenPath": "/oauth/token", + "identityPath": "/me", + "authorizePath": "/oauth/authorize", + "scope": "openid", + "buttonLabelText": "test", + "buttonLabelColor": "#FFFFFF", + "loginStyle": "popup", + "buttonColor": "#13679A", + "tokenSentVia": "payload", + "identityTokenSentVia": "default", + "usernameField": "dfsgdfgdfgdfgsd", + "mergeUsers": true } ], "success": true @@ -44,4 +64,5 @@ curl http://localhost:3000/api/v1/settings.oauth | Version | Description | | :--- | :--- | +| 0.64.0 | Renamed field `appId` to `clientId` and added flag `custom` to indicate whether the oauth service is customized | | 0.63.0 | Added | From a39456666be624094d2ba10dd6f4fe21e9629af9 Mon Sep 17 00:00:00 2001 From: Marcos Vinicius Spessatto Defendi Date: Thu, 19 Apr 2018 14:51:37 -0300 Subject: [PATCH 3/3] remove "secret" from response of REST /settings.oauth --- developer-guides/rest-api/settings/oauth/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/developer-guides/rest-api/settings/oauth/README.md b/developer-guides/rest-api/settings/oauth/README.md index 64b6f75581..99a217d794 100644 --- a/developer-guides/rest-api/settings/oauth/README.md +++ b/developer-guides/rest-api/settings/oauth/README.md @@ -39,7 +39,6 @@ curl http://localhost:3000/api/v1/settings.oauth "_id": "5RQ4SBL3NuZKsqxaF", "service": "test", "clientId": "test", - "secret": "test", "custom": true, "serverURL": "/test/test", "tokenPath": "/oauth/token",