Commit 2a93f97
authored
716 dissociate the encryption key from the api keys of the master password (#779)
* chore(env): add newline at the end of file
# Conflicts:
# .env.example
* chore(docs): update inline documentation
* feat(auth): add auth_secret_key setting
- remove session_secret_key setting from configuration
- remove default value for session_secret_key
- remove constr() deprecated function to implement new Annotated syntax in configuration.py
- add new auth_secret_key setting
- deprecated auth_master_key setting (still available to use for a moment)
- add default value for auth_secret_key (default = auth_master_key value for retrocompatibility)
- add deprecation warning messages
- fix EmptyDepencency typo to EmptyDependency
- remove usage of auth_master_key in most of the codebase
- add typing in IdentityAccessManager property
- identify duplicate functions for token encoding (added TODO)
- rename get_master_key into get_secret_key
- update SessionMiddleware (cookie encoding/decoding) middleware to now use auth_secret_key
- update config.yml, config.example.yml and config.test.yml
- remove duplicate socket_keepalive in config.test.yml
- remove TOKEN_PREFIX from Key(BaseModel) class due to a duplicate from IdentityAccessManager
- remove useless comment
- remove duplicate content in api.schemas.admin.providers and most of their references
- migrate old Provider class calls to the new one (in api.infrastructure.fastapi.schemas.providers)
- update some part of the documentation (not complete yet)
# Conflicts:
# api/schemas/admin/providers.py
* feat(admmin): add superadmin creation at startup
- remove MasterNotAllowedException exception
- remove hardcoded admin bypass
- delete MASTER_USER_ID and MASTER_KEY_ID for MASTER_ID
- add auth_master_username setting
- add auth_master_password setting
- remove use of master key as API key
- replace 0 refs to MASTER_ID global variable
- add setup_master method in lifespan (WIP: prints still present)
- rename master_key to secret_key in IdentityAccessManager
* feat(admin): force ID 0 for admin rol and user
- add master permission in PermissionType (unused for the moment)
- update inline documentation
- remove useless prints
* feat(roles): migrate PermissionType from old to new class (incomplete)
- restrict the master user permissions to only MASTER instead of the whole list.
* feat(alembic): add migration to add master permission to database
- add newline in carbon footprint migration
- fix inline doc typo
- remove debug prints and add logger prints
- check that the master role and user creation runs only at very first run
* chore(IAM): add CheckTokenResult typing class to check_token method
* chore(user): clean if statement in create_user method
- update TODO comments to make them clearer
* feat(admin): add MASTER permission bypass in is_admin method
* feat(admin): add deletion restriction for master user
- move MASTER_ID constant into variable.py
- rename user into user_id in DELETE /user endpoint
* chore(const): add typing to variable.py constants
* feat(amdin): add restrictions for master user in role creation, role update, user creation and user update
- needs to be tested
* fix(token): fix false positive on InvalidAPIKeyException for Master user
* feat(models): give access to models to master user
* chore(permission): migrate permission type
- from api.schemas.admin.roles to api.domain.role.entities
* fix(alembic): fix migration history
* fix(rebase): fix bad rebase conflict strategy
- add typing for ecologit class
* fix(rebase): revert bad python package update (mistral)
* feat(admin): remove alembic migration as we do not want to create a master user anymore
* chore: replace str, Enum inheritance by StrEnum type
* feat(role, user): migrate some endpoints from role and user ressourcesto clean architecture
- migrate endpoints
- add use cases for role, user, and bootstrap
- add exceptions
* chore(test): commented tests because of usecase migration
* feat(admin): migrate to new bootstrap admin management (without master user)
- remove master role
- add security boundaries to prevent deleting last admin user or admin role of OGL
- add new bootstrap admin version
- add new exceptions, repistories and factories
- remove old endpoints
- update default admin user and default admin password
* chore(sql): remove empty session.py
* chore: remove useless comments, update lifespan prototype
* feat(admin): remove securities about admin self deletion. An admin can now delete himself
- fix get_postgres_session iterator call
- quick fix of Routers class
- migrated to clean archi
* fix(admin): fix obsolete admin bypass (before id 0, now permission ADMIN)
- fix several playground bugs (login page glitch, redis token lock duration, migration issue on local, usage crash, 500 errors)
- add shield badge on corresponding admin roles
- add background tasks in playground
* tests(admin): add some integration tests for admin bootstrap
* tests(admin): add custom values for bootstrap admin tests
* fix(provider): replace old Provider class by new one for rebase
- still need to test
* feat(playground): fix seletors
- fix strategy display when updating a router
* test(postgres): add context comments for has admin db tests
* test(users): add test suit for get users repository
- add temporary implementation of update user
- add temporary implementation of delete user
* test(admin, bootstrap, roles, users): add tests for role and user use cases
- fix typing typo
- clean unused bootstrap and hasadmin usecases
- add some TODO comments
- move use case tests to unit folder instead of integration folder
* fix(playground): fix KeyError: 'carbon' in Usage page
* fix(playground): fix selector blank display for router update and creation (load balancing strategy)
* test(models): add new test on models when admin user don't have limits
- fix some models tests
* restore playground/ to main branch version
* fix(tests): fix unit tests. working on integration tests1 parent 655a8b1 commit 2a93f97
File tree
84 files changed
+2198
-562
lines changed- api
- alembic/versions
- domain
- bootstrap
- key
- role
- userinfo
- user
- endpoints
- admin
- helpers
- models
- infrastructure
- fastapi
- endpoints
- admin
- schemas
- postgres
- schemas/core
- sql
- tests
- integration
- endpoints
- postgres
- integ
- test_admin
- unit
- test_endpoints
- test_helpers
- test_identityaccessmanager
- test_modelregistry
- use_case
- admin
- roles
- users
- use_cases
- admin
- roles
- users
- models
- utils
- docs/src/content/docs/configuration
- playground/app/features/usage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
84 files changed
+2198
-562
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| 25 | + | |
18 | 26 | | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
28 | | - | |
29 | | - | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
| |||
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
71 | 98 | | |
72 | 99 | | |
73 | 100 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
19 | 16 | | |
20 | 17 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 18 | + | |
| 19 | + | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments