Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
Premwoik committed Jul 13, 2022
1 parent 8a0967f commit 85ef0f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/configuration/listen.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions doc/graphql-api/Admin-GraphQL.md
Original file line number Diff line number Diff line change
@@ -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
<a href="../admin-graphql-doc.html#definition-DomainAdminMutation" target="_blank" rel="noopener noreferrer">mutation.domains.setDomainPassword</a>. 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 <a href="../admin-graphql-doc.html#definition-DomainAdminMutation" target="_blank" rel="noopener noreferrer">mutation.domains.removeDomainPassword</a>.
Expand All @@ -25,15 +25,15 @@ 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,
- `PASSWORD` is the password set in the config.

### 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,
Expand Down
6 changes: 3 additions & 3 deletions doc/graphql-api/User-GraphQL.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 85ef0f0

Please sign in to comment.