Skip to content

Commit

Permalink
add permissive_cors option (#77)
Browse files Browse the repository at this point in the history
* update saml settings to include entityid

* rename entity_id

* Update __init__.py

* add permissive_cors option

* pin cryptography
  • Loading branch information
diegocepedaw authored Feb 3, 2023
1 parent 60441ef commit 62093b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'ujson==5.5.0',
'irisclient==1.3.0',
'oncallclient==1.1.0',
'cryptography==38.0.4'
],
entry_points={
'console_scripts': [
Expand Down
8 changes: 6 additions & 2 deletions src/iris_relay/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,12 @@ def get_relay_app(config=None):

# Note that ReqBodyMiddleware must be run before AuthMiddleware, since
# authentication uses the post body
cors = CORS(config.get('allow_origins_list', []))
app = falcon.App(middleware=[ReqBodyMiddleware(), AuthMiddleware(config), cors])
app = None
if config.get('permissive_cors'):
app = falcon.App(cors_enable=True, middleware=[ReqBodyMiddleware(), AuthMiddleware(config)])
else:
cors = CORS(config.get('allow_origins_list', []))
app = falcon.App(middleware=[ReqBodyMiddleware(), AuthMiddleware(config), cors])
app.req_options.strip_url_path_trailing_slash = True

ical_relay = OncallCalendarRelay(oncall_client, config['oncall']['url'])
Expand Down

0 comments on commit 62093b6

Please sign in to comment.