feat(auth): session login with per-domain scope
Cookie session with /auth/login, /auth/logout and /auth/me. Four accounts come from WEBAPI_USUARIOS (admin plus one per domain) and a second before_request answers 403 when an account asks for another domain. The data suites run with WEBAPI_AUTH_REQUIRED=0; test_auth.py turns the lock back on and covers both hooks. The Dockerfile normalises the entrypoint so a Windows checkout still starts the container.
This commit is contained in:
+9
-1
@@ -50,6 +50,11 @@ ENV MLFLOW_DISABLE_TELEMETRY=true DO_NOT_TRACK=true
|
||||
ENV WEBAPI_REPORT_DIR=/data/reportes
|
||||
ENV INDICADORES_DIR=/data/indicadores
|
||||
ENV MLFLOW_DISABLE_AGENT_HINT=1
|
||||
# Session login (webapi/blueprints/auth.py): the four demonstration accounts live
|
||||
# in the code; WEBAPI_USUARIOS (JSON list, see .env.example) replaces them.
|
||||
# Signs the session cookie: the same value in every worker and across restarts,
|
||||
# or the login does not survive the next request.
|
||||
ENV WEBAPI_SECRET_KEY=issteleon-dev-cambiar-en-produccion
|
||||
# Without it the measure routes (/<domain>/indicadores, /<domain>/fhir) aren't
|
||||
# registered. The entrypoint replaces it with one compiled against the
|
||||
# deployment's engine when that engine isn't SQLite (webapi.dbt_manifest).
|
||||
@@ -57,7 +62,10 @@ COPY --from=manifest /app/Transformation /app/Transformation
|
||||
ENV DBT_MANIFEST=/app/Transformation/target/manifest.json
|
||||
ENV TRANSFORMATION_DIR=/app/Transformation
|
||||
|
||||
RUN chmod +x /app/WebApi/docker-entrypoint.sh
|
||||
# A checkout on Windows can bring the script with CRLF, and then the shebang
|
||||
# is `#!/bin/sh\r`: the container would not start. Normalize it here so the
|
||||
# image builds the same from any platform.
|
||||
RUN sed -i 's/\r$//' /app/WebApi/docker-entrypoint.sh && chmod +x /app/WebApi/docker-entrypoint.sh
|
||||
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["/app/WebApi/docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user