-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rack-cors and configuration #40
Conversation
** Why are these changes being introduced: * The application needs to accept communications from other domains in order to do its job. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-266 ** How does this address that need: * This adds the rack-cors gem, with the recommended default config file, to enable the application to receive communication from our various search applications. * A new required ENV is defined, to give control over which systems can connect via CORS. By default, no external connections are allowed. ** Document any side effects to this change: * None
6843086
to
df6e1e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I added a note to consider updating the docs to reference a possible local development confusion around port numbers that may not be immediately obvious for developers unfamiliar with CORS.
README.md
Outdated
@@ -6,6 +6,8 @@ | |||
|
|||
`LINKRESOLVER_BASEURL`: base url for our link resolver. `https://mit.primo.exlibrisgroup.com/discovery/openurl?institution=01MIT_INST&rfr_id=info:sid/mit.tacos.api&vid=01MIT_INST:MIT` is probably the best value unless you are doing something interesting. | |||
|
|||
`ORIGINS`: comma-separated list of domains allowed to connect to (and thus query or contribute to) the application. If not defined, no external connections will be permitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a note that non-standard ports also need to be included (i.e. localhost
will not work when running on localhost:5000
, etc)
Update env description based on code review feedback
Good call - I had to work out the port number thing myself, so that's probably good to have in the readme. I've pushed a commit to update the description there. |
This adds the rack-cors gem, with the recommended default config file,
to enable the application to receive communication from our various
search applications.
To confirm that this is solving the CORS problem, I've been connecting to the Rails console in the review app, doing searches in the related Bento PR build, and confirming that I can see them appearing via the console.
Developer
Tickets
Requires database migrations?
NO
Includes new or updated dependencies?
YES
Code Reviewer
(not just this pull request message)