diff --git a/.gitbook.yaml b/.gitbook.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5b2a1cd01d4635d31552520bc73418003d7c6af2 --- /dev/null +++ b/.gitbook.yaml @@ -0,0 +1,5 @@ +root: ./docs/ + +​structure: + readme: ../README.md + summary: ../SUMMARY.md​ diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png deleted file mode 100644 index 10febd929a561a618dbc7af89b8498b1c1eca5f4..0000000000000000000000000000000000000000 Binary files a/.gitbook/assets/image (1).png and /dev/null differ diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png deleted file mode 100644 index 10febd929a561a618dbc7af89b8498b1c1eca5f4..0000000000000000000000000000000000000000 Binary files a/.gitbook/assets/image.png and /dev/null differ diff --git a/SUMMARY.md b/SUMMARY.md deleted file mode 100644 index ace0f7f0958fff00a51dbb5e6bf408bd874c68ce..0000000000000000000000000000000000000000 --- a/SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Table of contents - -* [ðŸ Home](README.md) - -## For Developers - -* [Get Started](docs/for-developers/get-started/README.md) - * [Introduction](docs/get-started/Introduction.md) - * [Setup development environment](docs/get-started/Setup-development-environment.md) -* [Configuration](for-developers/configuration/README.md) - * [Gateway](for-developers/configuration/gateway.md) -* [Connectors](docs/for-developers/connector/README.md) - * [Parsing response with JSONdata](docs/gateway/Connector/Parsing-response-with-JSONata.md) -* [Gateway](for-developers/gateway/README.md) - * [🔑 Authentication](for-developers/gateway/authentication.md) - * [👥 Users](for-developers/gateway/users.md) -* [Frontend](docs/for-developers/frontend/README.md) - * [Update GraphQL Queries](docs/frontend/Update-queries-GrahpQL-in-the-frontend.md) - * [📊 Visualisations](for-developers/frontend/visualisations.md) diff --git a/.gitbook/assets/image (2).png b/docs/.gitbook/assets/image (2).png similarity index 100% rename from .gitbook/assets/image (2).png rename to docs/.gitbook/assets/image (2).png diff --git a/.gitbook/assets/image (3).png b/docs/.gitbook/assets/image (3).png similarity index 100% rename from .gitbook/assets/image (3).png rename to docs/.gitbook/assets/image (3).png diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 0000000000000000000000000000000000000000..e8b3900e00d0a3ddfc6c10129513291f7cbf877f --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,19 @@ +# Table of contents + +* [ðŸ Home](../README.md) + +## For Developers + +* [Get Started](for-developers/get-started/README.md) + * [Introduction](for-developers/get-started/Introduction.md) + * [Setup development environment](for-developers/get-started/Setup-development-environment.md) +* [Configuration](for-developers/configuration/README.md) + * [Gateway](for-developers/configuration/gateway.md) +* [Connectors](for-developers/connector/README.md) + * [Parsing response with JSONdata](for-developers/connector/Parsing-response-with-JSONata.md) +* [Gateway](for-developers/gateway/README.md) + * [🔑 Authentication](for-developers/gateway/authentication.md) + * [👥 Users](for-developers/gateway/users.md) +* [Frontend](for-developers/frontend/README.md) + * [Update GraphQL Queries](for-developers/frontend/Update-queries-GrahpQL-in-the-frontend.md) + * [📊 Visualisations](for-developers/frontend/visualisations.md) diff --git a/for-developers/configuration/README.md b/docs/for-developers/configuration/README.md similarity index 100% rename from for-developers/configuration/README.md rename to docs/for-developers/configuration/README.md diff --git a/for-developers/configuration/gateway.md b/docs/for-developers/configuration/gateway.md similarity index 100% rename from for-developers/configuration/gateway.md rename to docs/for-developers/configuration/gateway.md diff --git a/docs/gateway/Connector/Add-a-connector.md b/docs/for-developers/connector/Add-a-connector.md similarity index 100% rename from docs/gateway/Connector/Add-a-connector.md rename to docs/for-developers/connector/Add-a-connector.md diff --git a/docs/gateway/Connector/Parsing-response-with-JSONata.md b/docs/for-developers/connector/Parsing-response-with-JSONata.md similarity index 100% rename from docs/gateway/Connector/Parsing-response-with-JSONata.md rename to docs/for-developers/connector/Parsing-response-with-JSONata.md diff --git a/docs/frontend/Update-queries-GrahpQL-in-the-frontend.md b/docs/for-developers/frontend/Update-queries-GrahpQL-in-the-frontend.md similarity index 100% rename from docs/frontend/Update-queries-GrahpQL-in-the-frontend.md rename to docs/for-developers/frontend/Update-queries-GrahpQL-in-the-frontend.md diff --git a/for-developers/frontend/visualisations.md b/docs/for-developers/frontend/visualisations.md similarity index 100% rename from for-developers/frontend/visualisations.md rename to docs/for-developers/frontend/visualisations.md diff --git a/for-developers/gateway/README.md b/docs/for-developers/gateway/README.md similarity index 100% rename from for-developers/gateway/README.md rename to docs/for-developers/gateway/README.md diff --git a/for-developers/gateway/authentication.md b/docs/for-developers/gateway/authentication.md similarity index 100% rename from for-developers/gateway/authentication.md rename to docs/for-developers/gateway/authentication.md diff --git a/for-developers/gateway/users.md b/docs/for-developers/gateway/users.md similarity index 100% rename from for-developers/gateway/users.md rename to docs/for-developers/gateway/users.md diff --git a/docs/get-started/Introduction.md b/docs/for-developers/get-started/Introduction.md similarity index 100% rename from docs/get-started/Introduction.md rename to docs/for-developers/get-started/Introduction.md diff --git a/docs/get-started/Setup-development-environment.md b/docs/for-developers/get-started/Setup-development-environment.md similarity index 100% rename from docs/get-started/Setup-development-environment.md rename to docs/for-developers/get-started/Setup-development-environment.md diff --git a/for-developers/authentication.md b/for-developers/authentication.md deleted file mode 100644 index bed3b7e54346a681b603aa11ad401be6dce03a65..0000000000000000000000000000000000000000 --- a/for-developers/authentication.md +++ /dev/null @@ -1,92 +0,0 @@ -# Authentication - -The authentication implementation is based on [passport.js](https://www.passportjs.org) it allows a flexible way to implement different strategies inside the gateway.  - -For now the authentication system is quite simple and only use JWT. The real implementation of authorization and authentication is left to the connector.  - -#### How it works ? - -The communication between the frontend and the gateway is handled by JWT token who contains user information such as his username. - -.png>) - -The gateway will handle the authentication process with the frontend in a unique fashion always using a JWT token. This token can contains information specific to some connector. For that purpose the user model contains a field `extraFields` which basically a dictionary.  - -{% code title="user.model.ts" %} -```typescript -import { Field, ObjectType } from '@nestjs/graphql'; -import { Entity, PrimaryColumn, Column } from 'typeorm'; - -@Entity({ name: 'user' }) -@ObjectType() -export class User { - @PrimaryColumn() - @Field() - id: string; - - @Field() - username: string; - - @Field({ nullable: true }) - fullname?: string; - - @Field({ nullable: true }) - email?: string; - - @Column({ nullable: true, default: false }) - @Field({ nullable: true }) - agreeNDA?: boolean; - - extraFields?: Record<string, any>; -} -``` -{% endcode %} - -This field can be used by the connector to store information related to the user as other token for engine API endpoints. - -#### Login  - -The real login system is delegated to the connector by using the `login` method in the interface. - -{% code title="engine.interface.ts" %} -```typescript -export interface IEngineService { - // ... - - /** - * Method that login a user with username and password - * @param username - * @param password - * @returns User object or empty if user not found - */ - login?( - username: string, - password: string, - ): Promise<User | undefined>; - - // ... -} -``` -{% endcode %} - -This method can be optional as the authentication can be made by a 3rd party system under the same domain as this is the case for `exareme`. - -When the login is performed, this function should return a `User` object and can feed the `extraFields` attribute with data needed to perform future request to the engine. - -#### Logout - -The same mechanism is applied to the logout system using the method logout from the engine. - -{% code title="engine.interface.ts" %} -```typescript -export interface IEngineService { - // ... - - logout?(req: Request - ): Promise<void>; - - // ... -} -``` -{% endcode %} -