diff --git a/foca/foca.py b/foca/foca.py index 22b2ce66..0be363db 100644 --- a/foca/foca.py +++ b/foca/foca.py @@ -46,11 +46,9 @@ def foca(config: Optional[str] = None) -> App: logger.info(f"Error handler registered.") # Enable cross-origin resource sharing - if(conf.security.cors.enabled == True): + if(conf.security.cors.enabled is True): enable_cors(cnx_app.app) logger.info(f"CORS enabled.") - else: - logger.info(f"CORS disabled") # Register OpenAPI specs if conf.api.specs: diff --git a/foca/models/config.py b/foca/models/config.py index 143ccd4a..72c113c8 100644 --- a/foca/models/config.py +++ b/foca/models/config.py @@ -708,6 +708,7 @@ class AuthConfig(FOCABaseConfig): ] validation_checks: ValidationChecksEnum = ValidationChecksEnum.all + class CORSConfig(FOCABaseConfig): """Model for Cross Origin Resource Sharing configuration. @@ -725,6 +726,7 @@ class CORSConfig(FOCABaseConfig): """ enabled: bool = True + class SecurityConfig(FOCABaseConfig): """Model for list the Security configuration.