{"action":"closed","issue":{"url":"https://api.github.com/repos/wireload/screenly-ose/issues/493","repository_url":"https://api.github.com/repos/wireload/screenly-ose","labels_url":"https://api.github.com/repos/wireload/screenly-ose/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/wireload/screenly-ose/issues/493/comments","events_url":"https://api.github.com/repos/wireload/screenly-ose/issues/493/events","html_url":"https://github.com/wireload/screenly-ose/issues/493","id":181914181,"number":493,"title":"add support for HTTP Basic Authentication","user":{"login":"TonyLHansen","id":7798250,"avatar_url":"https://avatars.githubusercontent.com/u/7798250?v=3","gravatar_id":"","url":"https://api.github.com/users/TonyLHansen","html_url":"https://github.com/TonyLHansen","followers_url":"https://api.github.com/users/TonyLHansen/followers","following_url":"https://api.github.com/users/TonyLHansen/following{/other_user}","gists_url":"https://api.github.com/users/TonyLHansen/gists{/gist_id}","starred_url":"https://api.github.com/users/TonyLHansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonyLHansen/subscriptions","organizations_url":"https://api.github.com/users/TonyLHansen/orgs","repos_url":"https://api.github.com/users/TonyLHansen/repos","events_url":"https://api.github.com/users/TonyLHansen/events{/privacy}","received_events_url":"https://api.github.com/users/TonyLHansen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-09T21:48:56Z","updated_at":"2016-10-12T18:31:24Z","closed_at":"2016-10-12T18:31:24Z","body":"bottle.py fully supports HTTP Basic Authentication via `@basic_auth()` decorators. It just needs to be called within server.py.\r\n\r\nHere is one implementation of it that has been tested and works. I tried doing a \"git clone\" so that I could do push you a pull request, but get a permission denied message; I'm obviously doing something wrong. Oh well. So instead, I'm enclosing context diffs for the needed changes.\r\n\r\nStart with the configuration changes. I chose to do this using an [auth] configuration section and user and password parameters in screenly.conf.\r\n\r\nThe server.py changes consist of adding a single function in the model section, and calls to that function using the auth_basic() decorator calls. The decorator needs to be added to all methods that I felt need protecting, which is almost all of them.\r\n  \r\nFinally, we need the changes to settings.py to access the configuration file parameters. This consists of an addition to the default configuration, and a single new function to check the credentials.\r\n\r\n[ansible.screenly.conf.diff.txt](https://github.com/wireload/screenly-ose/files/518580/ansible.screenly.conf.diff.txt)\r\n[server.py.diff.txt](https://github.com/wireload/screenly-ose/files/518581/server.py.diff.txt)\r\n[settings.py.diff.txt](https://github.com/wireload/screenly-ose/files/518582/settings.py.diff.txt)\r\n[screenly.conf.diff.txt](https://github.com/wireload/screenly-ose/files/518579/screenly.conf.diff.txt)"}}
{"actor":{"display_login":"TonyLHansen"}}