Skip to content

Commit

Permalink
fix(login): hide providers configurations in gn_commons/config (#3330)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize authored Jan 16, 2025
1 parent 3183319 commit 9111f81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion backend/geonature/utils/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ def validate_provider(self, data, **kwargs):
ProviderConfigurationSchema().load(provider, unknown=INCLUDE)


class AuthenticationFrontendConfig(AuthenticationConfig):

@post_load
def post_load(self, data, **kwargs):
data["PROVIDERS"] = [
{"id_provider": provider["id_provider"]} for provider in data["PROVIDERS"]
]
return data


class GnPySchemaConf(Schema):
SQLALCHEMY_DATABASE_URI = fields.String(
required=True,
Expand Down Expand Up @@ -208,6 +218,9 @@ class GnPySchemaConf(Schema):
SERVER = fields.Nested(ServerConfig, load_default=ServerConfig().load({}))
MEDIAS = fields.Nested(MediasConfig, load_default=MediasConfig().load({}))
ALEMBIC = fields.Nested(AlembicConfig, load_default=AlembicConfig().load({}))
AUTHENTICATION = fields.Nested(
AuthenticationConfig, load_default=AuthenticationConfig().load({}), unknown=INCLUDE
)

@post_load()
def folders(self, data, **kwargs):
Expand Down Expand Up @@ -579,7 +592,9 @@ class GnGeneralSchemaConf(Schema):
PROFILES_REFRESH_CRONTAB = fields.String(load_default="0 3 * * *")
MEDIA_CLEAN_CRONTAB = fields.String(load_default="0 1 * * *")
AUTHENTICATION = fields.Nested(
AuthenticationConfig, load_default=AuthenticationConfig().load({}), unknown=INCLUDE
AuthenticationFrontendConfig,
load_default=AuthenticationFrontendConfig().load({}),
unknown=INCLUDE,
)

@validates_schema
Expand Down
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
- [Sensibilité] Correction du comptage du nombre de règles supprimées dans la commande `geonature sensitivity remove-referential` (#3323, par @jacquesfize)
- [Synthèse] Correction de la disparition du filtre par `id_import` après l'affichage d'une fiche observation (par @jacquesfize)
- [Authentification] Correction des redirections du module Admin lors de l'authentification (#3322, par @jacquesfize)
- Correction d'une régression de performances de la récupération des JDD, introduite dans la 2.15.1 (#3320, par @Pierre-Narcisi)
- [Métadonnées] Correction d'une régression de performances de la récupération des JDD, introduite dans la 2.15.1 (#3320, par @Pierre-Narcisi)
- [Authentification] La configuration des providers n'est plus accessible depuis la route `gn_commons/config` (#3330 par @jacquesfize)

## 2.15.1 (2025-01-10)

Expand Down

0 comments on commit 9111f81

Please sign in to comment.