Skip to content

Commit

Permalink
improve description of authentication documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Avelino <t@avelino.xxx>
  • Loading branch information
avelino committed Jan 3, 2021
1 parent 48e67ec commit 534a2c4
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions docs/query-statements/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ menu: main

## Auth /auth - POST

pREST has support in jwt token generation based on two fields (example user and password), being possible to use an existing table from your database to login configuring some parameters in the configuration file (or environment variable), _by default this feature is_ **disabled**.
pREST has support in **JWT Token** generation based on two fields (example user and password), being possible to use an existing table from your database to login configuring some parameters in the configuration file (or environment variable), _by default this feature is_ **disabled**.

### Basic Authentication
- Bearer - [RFC 6750](https://tools.ietf.org/html/rfc6750), bearer tokens to access OAuth 2.0-protected resources
- Basic - [RFC 7617](https://tools.ietf.org/html/rfc7617), base64-encoded credentials. More information below

> understand more about _http authentication_ [see this documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
#### Bearer
```sh
curl -i -X POST http://127.0.0.1:8000/auth -H "Content-Type: application/json" -d '{"username": "<username>", "password": "<password>"}'
```

### Basic Authentication
#### Basic
```sh
curl -i -X POST http://127.0.0.1:8000/auth --user "<username>:<password>"
```
Expand Down Expand Up @@ -64,17 +69,17 @@ GET /DATABASE/SCHEMA/TABLE?FIELD=$eq.VALUE
### Filters parameters (query string) - GET

| Query String | Description |
| ------------ | ----------- |
| `?_select={field name 1},{fiel name 2}` | Limit fields list on result - sql ansii standard |
| `?_count={field name}` | Count per field - `*` representation all fields |
| `?_render=xml` | Set API render syntax - default is `json` |
| `?page={set page number}` | Navigation on return pages with large volume of data |
| `?page_size={number to return by pages}` | 10 is default number |
| `?distinct=true` | `DISTINCT` clause with SELECT |
| `?_order={FIELD}` | `ORDER BY` in sql query. For `DESC` order, use the prefix `-`. For *multiple* orders, the fields are separated by comma `fieldname01,-fieldname02,fieldname03` |
| `?_groupby={FIELD}` | `GROUP BY` in sql query, The grouper is more complicated, a topic has been created to describe how to use |
| `?{FIELD NAME}={VALUE}` | Filter by field, you can set as many query parameters as needed |
| Query String | Description |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `?_select={field name 1},{fiel name 2}` | Limit fields list on result - sql ansii standard |
| `?_count={field name}` | Count per field - `*` representation all fields |
| `?_render=xml` | Set API render syntax - default is `json` |
| `?page={set page number}` | Navigation on return pages with large volume of data |
| `?page_size={number to return by pages}` | 10 is default number |
| `?distinct=true` | `DISTINCT` clause with SELECT |
| `?_order={FIELD}` | `ORDER BY` in sql query. For `DESC` order, use the prefix `-`. For *multiple* orders, the fields are separated by comma `fieldname01,-fieldname02,fieldname03` |
| `?_groupby={FIELD}` | `GROUP BY` in sql query, The grouper is more complicated, a topic has been created to describe how to use |
| `?{FIELD NAME}={VALUE}` | Filter by field, you can set as many query parameters as needed |

### Group/Select functions support:

Expand Down Expand Up @@ -120,15 +125,15 @@ Uses these operators in various filter applications

## GET - Endpoints

| Endpointis | Description |
| ---------- | ----------- |
| `/databases` | List all databases |
| `/shemas` | List all schemas |
| `/tables` | List all tables |
| Endpointis | Description |
| ----------------------------------- | --------------------------------------------------------- |
| `/databases` | List all databases |
| `/shemas` | List all schemas |
| `/tables` | List all tables |
| `/show/{DATABASE}/{SCHEMA}/{TABLE}` | Lists table structure - all fields contained in the table |
| `/{DATABASE}/{SCHEMA}` | Lists table tables - find by schema |
| `/{DATABASE}/{SCHEMA}/{TABLE}` | List all rows, find by database, schema and table |
| `/{DATABASE}/{SCHEMA}/{VIEW}` | List all rows, find by database, schema and view |
| `/{DATABASE}/{SCHEMA}` | Lists table tables - find by schema |
| `/{DATABASE}/{SCHEMA}/{TABLE}` | List all rows, find by database, schema and table |
| `/{DATABASE}/{SCHEMA}/{VIEW}` | List all rows, find by database, schema and view |


## POST - Insert
Expand Down

0 comments on commit 534a2c4

Please sign in to comment.