-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# MongooseIM's GraphQL API for the administration | ||
|
||
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. | ||
|
||
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 owned 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 to execute commands with not owned domain. The API documentation clearly says which commands are global. | ||
|
||
## Domain per admin configuration | ||
|
||
Out of the box, domains are created with 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>. Afterwards the damain 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>. | ||
|
||
## Authentication | ||
|
||
MongooseIM uses *Basic Authentication* as an authentication method for the GraphQL API. | ||
|
||
*Basic authentication* is a simple authentication scheme built into the HTTP protocol. | ||
Each HTTP request to the GraphQL API has to contain the Authorization header | ||
with the word `Basic` followed by a space and a base64-encoded string. | ||
|
||
### Global admin endpoint | ||
|
||
The authentication for global admin is optional because this endpoint shouldn't be exposed outside. The credentials can be set in the handler section in the config what enables the authentication. | ||
|
||
The base64-encoded string should have form | ||
`login:password`, where: | ||
|
||
- `login` is the login set in the config, | ||
- `password` is the password set in the config. | ||
|
||
Please see the [Authentication](#authentication) section for more details. | ||
|
||
### Domain admin endpoint | ||
|
||
For example, to authorize as `admin@localhost` with the password `secret`, the | ||
client would send a header: | ||
|
||
``` | ||
Authorization: Basic YWxpY2VAbG9jYWxob3N0OnNlY3JldA== | ||
``` | ||
|
||
## GraphiQL | ||
|
||
## API static documentation | ||
|
||
<a style="float: right; padding: 5px" href="../admin-graphql-doc.html" target="_blank" rel="noopener noreferrer">Open GraphQL documentation as a full page</a> | ||
|
||
<iframe src="../admin-graphql-doc.html" | ||
height="800" width="800" style="border: 1px solid black;"></iframe> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# MongooseIM's REST API for the user | ||
|
||
<iframe src="../user-graphql-doc.html" | ||
height="800" width="800" style="border: 1px solid black;"></iframe> |
This file contains 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