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

Commit

Permalink
Merge pull request #83 from communitiesuk/smd-615-auth-override
Browse files Browse the repository at this point in the history
SMD-615: Debug user for local development
  • Loading branch information
gidsg authored Feb 16, 2024
2 parents e6a14f9 + 093be70 commit 3834dbf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions config/envs/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ class DevelopmentConfig(DefaultConfig):
with open(_test_public_key_path, mode="rb") as public_key_file:
RSA256_PUBLIC_KEY = public_key_file.read()
FSD_LOG_LEVEL = logging.DEBUG

DEBUG_USER_ON = True
DEBUG_USER = {
"full_name": "Development User",
"email": "[email protected]",
"roles": [],
"highest_role_map": {},
}
10 changes: 9 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ babel==2.12.1
# flask-babel
bandit==1.7.5
# via -r requirements-dev.in
beautifulsoup4==4.12.2
# via
# -r requirements.txt
# funding-service-design-utils
black==22.12.0
# via -r requirements-dev.in
blinker==1.6.2
Expand Down Expand Up @@ -133,7 +137,7 @@ flipper-client==1.3.2
# via
# -r requirements.txt
# funding-service-design-utils
funding-service-design-utils==2.0.2
funding-service-design-utils==2.0.41
# via -r requirements.txt
gitdb==4.0.10
# via gitpython
Expand Down Expand Up @@ -305,6 +309,10 @@ six==1.16.0
# thrift
smmap==5.0.0
# via gitdb
soupsieve==2.5
# via
# -r requirements.txt
# beautifulsoup4
sqlalchemy==2.0.13
# via
# -r requirements.txt
Expand Down
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ async-timeout==4.0.2
# via redis
babel==2.12.1
# via flask-babel
beautifulsoup4==4.12.2
# via funding-service-design-utils
blinker==1.6.2
# via
# flask
Expand Down Expand Up @@ -76,7 +78,7 @@ flask-wtf==1.1.1
# govuk-frontend-wtf
flipper-client==1.3.2
# via funding-service-design-utils
funding-service-design-utils==2.0.2
funding-service-design-utils==2.0.41
# via -r requirements.in
govuk-frontend-jinja==2.6.0
# via
Expand Down Expand Up @@ -157,6 +159,8 @@ six==1.16.0
# python-consul
# python-dateutil
# thrift
soupsieve==2.5
# via beautifulsoup4
sqlalchemy==2.0.13
# via
# alembic
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@pytest.fixture()
def mocked_auth(monkeypatch):
def access_token(return_app=SupportedApp.POST_AWARD_FRONTEND, auto_redirect=True):
return {"accountId": "test-user"}
return {"accountId": "test-user", "roles": []}

monkeypatch.setattr(
"fsd_utils.authentication.decorators._check_access_token",
Expand Down

0 comments on commit 3834dbf

Please sign in to comment.