Skip to content
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

Can't un-set HTTP referrer requirements on an API key via the web admin UI #155

Closed
GUI opened this issue Nov 24, 2014 · 1 comment
Closed

Comments

@GUI
Copy link
Member

GUI commented Nov 24, 2014

  • In the admin add a new api key and save the record. Note in the database the value of settings.allowed_referers is null.
  • Open that same api user back up for editing. Add some values in the "Restrict Access to HTTP Referers" field. Save the record. Note that the value of settings.allowed_referers in the database is now an array of strings.
  • Open the same user again for editing. Remove all the values in the "Restrict Access to HTTP Referers" field. Save the record. Note that the value of settings.allowed_referers in the database is now [""] (an array containing an empty string).

So even though it looks like you've removed this setting from this specific key in the admin UI, there's actually this weird rogue empty string in the database. This value of an empty string messes with the referrer checks and essentially renders this specific key inoperable, since nothing matches this empty referrer value.

GUI added a commit to NREL/api-umbrella-web that referenced this issue Dec 7, 2014
These multi-line inputs were getting set to [""] when trying to unset
them via the admin UI: 18F/api.data.gov#155
@GUI
Copy link
Member Author

GUI commented Dec 8, 2014

Should be fixed by updates I've pushed live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant