Skip to content

Commit 42dda04

Browse files
committed
Allow config for user domain restriction to remain in config.
Avoid requiring deployment frameworks to add/remove config lines. Allow deployment to simply change config values to turn on/off feature.
1 parent 43d6194 commit 42dda04

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bravo_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def create_app(test_config=None):
9898
app.register_blueprint(auth_routes.bp, url_prefix='/ui')
9999

100100
# Initialize User Management and Authorization Routes
101-
if 'USER_DOMAIN_PERMITTED' in app.config:
101+
if 'USER_DOMAIN_PERMITTED' in app.config and not app.config['USER_DOMAIN_PERMITTED'] == "":
102102
DomainUser.set_permitted_domain(app.config['USER_DOMAIN_PERMITTED'])
103103
app.user_mgmt = MongoUserMgmt(app.mmongo, DomainUser)
104104
else:

bravo_api/default_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
GOOGLE_DISCOVERY_URL = "https://accounts.google.com/.well-known/openid-configuration"
1616

1717
# Use the following key to only allow users from a single domain
18+
# Leave undefined or "" to allow users to authenticate from all domains
1819
# USER_DOMAIN_PERMITTED = "example.com"

0 commit comments

Comments
 (0)