You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-26Lines changed: 61 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,53 +253,85 @@ The `config.yaml` contains environment variables that are internal to the Python
253
253
254
254
## Launch the API
255
255
256
+
> [!WARNING]
257
+
> Beforehand, check that your venv is activated.
258
+
259
+
### Using VS Code
260
+
261
+
1. In the activity bar (the leftmost part), click the _Run and Debug_ icon (the play button).
262
+
2. Click the green play button.
263
+
264
+
Check that your Hyperion instance is up and running by navigating to http://localhost:8000/information.
265
+
266
+
### Using the command-line interface
267
+
256
268
```bash
257
269
fastapi dev app/main.py
258
270
```
259
271
260
-
## Use Alembic migrations
272
+
Check that your Hyperion instance is up and running by navigating to http://localhost:8000/information.
261
273
262
-
See [migrations README](./migrations/README)
274
+
## Create your own user
263
275
264
-
Warning : on SQLite databases, you have to drop the database and recreate it to apply the new DDL.
276
+
There are many ways to do so, ranked here from easiest (GUI only) to hardest (CLI only).
277
+
Note that registration and activation are distinct steps, so for fun you may register one way and activate your account another way.
265
278
266
-
##OpenAPI specification
279
+
### With CalypSSO
267
280
268
-
API endpoints are parsed following the OpenAPI specifications at `http://127.0.0.1:8000/openapi.json`.
281
+
#### Registering your account
269
282
270
-
A Swagger UI is available at `http://127.0.0.1:8000/docs`. For authentication to work, a valid `AUTH_CLIENT` must be defined in the `.env`, with `http://127.0.0.1:8000/docs/oauth2-redirect` as the redirect URI, and `scope=API` must be added to the authentication request.
283
+
Go to http://localhost:8000/calypsso/register and type a valid email address to register (start the creation of) your account.
271
284
272
-
##Create the first user
285
+
#### Activating your account
273
286
274
-
You can create the first user either using Titan or calling the API directly.
287
+
Go back to the shell running your Hyperion instance, in the logs look for a link looking like http://localhost:3000/calypsso/activate?activation_token=12345.
288
+
Open it and activate (end the creation of) your account.
To activate your account you will need an activation token which will be printed in the console.
292
+
1. Click "_Se connecter_" on the login page: you land CalypSSO's login page.
293
+
2. Click "_Créer un compte_" and create your account using CalypSSO as above.
279
294
280
-
### With Titan
295
+
### Using the API through the swagger
281
296
282
-
Press "Créer un compte" on the first page and follow the process.
297
+
#### Registering your account
283
298
284
-
### Using the API directly
299
+
1. Go to http://localhost:8000/docs: this is called the _swagger_, a web interface to interact with the API, it is a layer on top of the "automatic documentation" (the _OpenAPI specification_) generated by FastAPI at http://localhost:8000/openapi.json.
300
+
2. Search `/users/create`.
301
+
3. Open it, click "Try it out".
302
+
4. Fill in your email address, and click "Execute".
285
303
286
-
Create the account:
304
+
#### Activating your account
305
+
306
+
1. Go back to the shell running your Hyperion instance, in the logs look for a link looking like http://localhost:3000/calypsso/activate?activation_token=12345.
307
+
2. Copy this activation token.
308
+
3. Go again on the swagger and search `/users/activate`.
309
+
4. Open it, click "Try it out".
310
+
5. Fill in your information, using the `activation_token` you copied (click "Schema" next to "Edit Value" so see what fields are optional), and click "Execute".
311
+
312
+
### Using the API in command line
313
+
314
+
> [!TIP]
315
+
> On Windows, `curl` is different.
316
+
> To get the same results as on Linux and MacOS:
317
+
>
318
+
> - either replace `curl` with `curl.exe`
319
+
> - or run the `curl` commands below in a bash (using WSL or using Git Bash)
1. Go back to the shell running your Hyperion instance, in the logs look for a link looking like http://localhost:3000/calypsso/activate?activation_token=12345.
0 commit comments