Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
SMD-536 add role as env variable in development config
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbi-hbrown committed Feb 23, 2024
1 parent 019ec14 commit 67e027b
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 137 deletions.
11 changes: 5 additions & 6 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jinja2 import ChoiceLoader, PackageLoader, PrefixLoader

import static_assets
from app.const import TOWNS_FUND_AUTH
from app.const import PF_AUTH, TF_AUTH
from app.main.authorisation import AuthMapping, AuthService
from app.main.fund import (
PATHFINDERS_APP_CONFIG,
Expand Down Expand Up @@ -78,7 +78,7 @@ def setup_funds_and_auth(app: Flask) -> None:
TODO: Going forwards the logic and state for "auth" and "fund" config should be extracted from this repo and
encapsulated in separate microservices with their own databases.
This current mono-repo implementation with state stored in code (see _TF_FUND_CONFIG and _FUND_AUTH) works
This current mono-repo implementation with state stored in code (see _TF_FUND_CONFIG and _TOWNS_FUND_AUTH) works
for now but should not be seen as a long term solution.
:param app: the Flask app
Expand All @@ -96,12 +96,11 @@ def setup_funds_and_auth(app: Flask) -> None:
)

# auth
tf_auth = TOWNS_FUND_AUTH
tf_auth = TF_AUTH
tf_auth.update(Config.ADDITIONAL_EMAIL_LOOKUPS)

pf_auth = {}
for domain, (local_authorities, places, fund_types) in TOWNS_FUND_AUTH.items():
pf_auth[domain] = (local_authorities,)
pf_auth = PF_AUTH
pf_auth.update(Config.PF_EMAIL_LOOKUPS)

app.config["AUTH_MAPPINGS"] = AuthService(
fund_to_auth_mappings={
Expand Down
Loading

0 comments on commit 67e027b

Please sign in to comment.