Skip to content
Snippets Groups Projects
Commit feb20547 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge branch 'feat/pilote-swagger-link' into 'master'

Feat/pilote swagger link

See merge request web-et-numerique/llle_project/self-data-technical-doc!12
parents 871cb257 ba7d9ac7
No related branches found
No related tags found
1 merge request!12Feat/pilote swagger link
Pipeline #24379 failed
This section explains the different API route.
# Auth
- `api/auth/signin`: It is used for local and dev authentification. It is linked to two different password into the database.
- `api/auth/token` : It is used for generate one token. Only for internal process. This route is not call from another apps.
- `api/auth/token/check`: It is used for check one token. It is called from cozy-stack service of the usager.
- `api/auth/token`: It is used for generate one token. Only for internal process. This route is not call from another apps.
- `api/auth/login`: It is used for Sign&Go authentification. Linked to AuthStrategy.
- `login/callback`: Get the authentification from Sign&Go process.
# Beneficiary
- `/api/beneficiaire`: Get all usager known from Postgre database.
- `/api/beneficiaire/create'`: This rotue is used in order to store Usager domain and his trigger proccess from Cozy. This route is protected by a COZY_SECRET env variable token. This token is generated by us. If you change it, you need to inform Cozy team because this token is store in their side also.
- `/api/beneficiaire/remove'`: This rotue is used in order to remove Usager domain and his trigger proccess. Only availabe by POST. This route is not accessible from any part of TS FRONT application. Protected rout by the same token of create route.
## Add one benificiary by Postman
- Create a POST request
- Entry the URL: http://localhost:3020/api/beneficiaire/create or https://pilote-agent-rec.grandlyon.com/api/beneficiaire/create
- Push in Authorizathion/ Bearer Token => the token use by "process.env.COZY_SECRET"
- In Body, as JSON format example :
- ``
{"cozy_name":"pilote-rec.cozy.self-data.alpha.grandlyon.com","trigger":"https://pilote-rec.cozy.self-data.alpha.grandlyon.com/jobs/webhooks/d010bf3fa2aed6f3c6584ea93a54affc"}
``
- Local : ``
{"cozy_name":"mps.cozy.tools:8080","trigger":"http://mps.cozy.tools:8080/jobs/webhooks/"}
``
# Cozy
- `api/redirect/cozy`: Allow to send information to the cozy-stack in order to run smsProccess on cozy-stask side.
# Users
Authentification only used for local or dev environment because Sign&Go is only available for rec and prod env.
This section explains the different API route. Descriptions are not currently up-to-date.
A swagger documentation can be consulted at [http://localhost:3000/api/doc/](http://localhost:3000/api/doc/)
# Auth
- `api/auth/signin`: It is used for local and dev authentification. It is linked to two different password into the database.
- `api/auth/token` : It is used for generate one token. Only for internal process. This route is not call from another apps.
- `api/auth/token/check`: It is used for check one token. It is called from cozy-stack service of the usager.
- `api/auth/token`: It is used for generate one token. Only for internal process. This route is not call from another apps.
- `api/auth/login`: It is used for Sign&Go authentification. Linked to AuthStrategy.
- `login/callback`: Get the authentification from Sign&Go process.
# Beneficiary
- `/api/beneficiaire`: Get all usager known from Postgre database.
- `/api/beneficiaire/create'`: This rotue is used in order to store Usager domain and his trigger proccess from Cozy. This route is protected by a COZY_SECRET env variable token. This token is generated by us. If you change it, you need to inform Cozy team because this token is store in their side also.
- `/api/beneficiaire/remove'`: This rotue is used in order to remove Usager domain and his trigger proccess. Only availabe by POST. This route is not accessible from any part of TS FRONT application. Protected rout by the same token of create route.
## Add one benificiary by Postman
- Create a POST request
- Entry the URL: http://localhost:3020/api/beneficiaire/create or https://pilote-agent-rec.grandlyon.com/api/beneficiaire/create
- Push in Authorizathion/ Bearer Token => the token use by "process.env.COZY_SECRET"
- In Body, as JSON format example :
- ``
{"cozy_name":"pilote-rec.cozy.self-data.alpha.grandlyon.com","trigger":"https://pilote-rec.cozy.self-data.alpha.grandlyon.com/jobs/webhooks/d010bf3fa2aed6f3c6584ea93a54affc"}
``
- Local : ``
{"cozy_name":"mps.cozy.tools:8080","trigger":"http://mps.cozy.tools:8080/jobs/webhooks/"}
``
# Cozy
- `api/redirect/cozy`: Allow to send information to the cozy-stack in order to run smsProccess on cozy-stask side.
# Users
Authentification only used for local or dev environment because Sign&Go is only available for rec and prod env.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment