From 85ef0f0ee2082baa88800f6a37b90c0f27c36dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Wojtasik?= Date: Wed, 13 Jul 2022 10:18:10 +0200 Subject: [PATCH] Apply review --- doc/configuration/listen.md | 2 +- doc/graphql-api/Admin-GraphQL.md | 10 +++++----- doc/graphql-api/User-GraphQL.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/configuration/listen.md b/doc/configuration/listen.md index 7b225eb17a..95b87dc1bf 100644 --- a/doc/configuration/listen.md +++ b/doc/configuration/listen.md @@ -500,7 +500,7 @@ The following options are supported for this handler: #### `listen.http.handlers.mongoose_graphql_cowboy_handler.schema_endpoint` * **Syntax:** string, one of `"admin"`, `"domain_admin"`, `"user"` -* **Default:** not set +* **Default:** no default, this option is mandatory * **Example:** `schema_endpoint = "admin"` Specifies the schema endpoint: diff --git a/doc/graphql-api/Admin-GraphQL.md b/doc/graphql-api/Admin-GraphQL.md index 07e95585a2..73856f0f8d 100644 --- a/doc/graphql-api/Admin-GraphQL.md +++ b/doc/graphql-api/Admin-GraphQL.md @@ -1,14 +1,14 @@ # MongooseIM's GraphQL API for the administrator -The new GraphQL admin API contains all the commands available through the REST API, and the vast majority of the CTL commands. Only commands that wouldn't have worked well with GraphQL style have been omitted. +The new GraphQL admin API contains all the commands available through the REST API, and the vast majority of the CLI (`mongooseimctl`) commands. Only commands that wouldn't have worked well with GraphQL style have been omitted. We can distinguish two levels of the administration. A global admin (has access to all commands), and the admin per domain (has access only to the own domain). Each of them is handled by a different endpoint. Please see the configuration [Listen](../../configuration/listen/#handler-types-graphql-api-mongoose_graphql_cowboy_handler) section for more details. There is only one schema for both admin types. Admin per domain simply has no permissions to execute global commands or commands with not owned domain. The API documentation clearly says which commands are global. -## Domain per admin configuration +## Domain admin configuration -Out of the box, domains are created a with disabled admin account. Admin per domain can be enabled only by the global admin with the command +Out of the box, domains are created with a disabled admin account. Admin per domain can be enabled only by the global admin with the command mutation.domains.setDomainPassword. Afterward, the domain admin can change the password with the same command. The admin per domain can be disabled by the global admin with the command mutation.domains.removeDomainPassword. @@ -25,7 +25,7 @@ with the word `Basic` followed by a space and a base64-encoded string. The authentication for global admin is optional because this endpoint shouldn't be exposed outside. The credentials set in the handler section in the config enables the authentication. Please see the [GraphQL handler](../configuration/listen.md#handler-types-graphql-api-mongoose_graphql_cowboy_handler) section for more details. -The base64-encoded string should have form +The base64-encoded string should have the form `LOGIN:PASSWORD`, where: - `LOGIN` is the login set in the config, @@ -33,7 +33,7 @@ The base64-encoded string should have form ### Domain admin endpoint -The authorization as a domain admin the base64-encoded string should have form +The authorization as a domain admin the base64-encoded string should have the form `admin@DOMAIN:PASSWORD`, where: - `DOMAIN` is the domain to authorize, diff --git a/doc/graphql-api/User-GraphQL.md b/doc/graphql-api/User-GraphQL.md index 912e098fee..3d3ebe0ff7 100644 --- a/doc/graphql-api/User-GraphQL.md +++ b/doc/graphql-api/User-GraphQL.md @@ -1,10 +1,10 @@ -# MongooseIM's REST API for the user +# MongooseIM's GraphQL API for the user -The new GraphQL user API contains all commands from the client REST API and provides plenty of news. Multiple commands previously available only for the admin have their counterparts for the user. +The new GraphQL user API contains all commands from the client REST API and provides plenty of new ones. Multiple commands previously available only for the admin have their counterparts for the user. ## Authentication -MongooseIM uses *Basic Authentication* as an authentication method for the GraphQL API. +MongooseIM uses *Basic Authentication* as the authentication method for the GraphQL API. *Basic authentication* is a simple authentication scheme built into the HTTP protocol. Each HTTP request to the client REST API has to contain the Authorization header