pjwalen / argumentum

A platform for arguments.
1 stars 0 forks source link

How do you want to authenticate users? #15

Open pjwalen opened 6 years ago

pjwalen commented 6 years ago

Set up authentication so the controller functions that create / modify database records are restricted to an authenticated admin. (check this out as an example http://flask.pocoo.org/docs/0.12/patterns/viewdecorators/)

  1. Create a require_login python decorator that we can use to mark certain controller endpoints as requiring login access
  2. The decorator should reference two environment variables (ie. ADMIN_USER, ADMIN_PASSWORD) so we can set the expected username and password as a variable in elastic beanstalk.
  3. For now, a valid login can be done through basic-auth like this.... http://:@ourwebsite.com/ a login page isn't necessary yet.
  4. Update the templates so the hamburger menu is hidden, if a user isn't authenticated.
  5. This goes without saying, but please don't include any actual usernames or passwords in source code.
  6. If possible, write a test case to test both good and bad authentication to all of the sensitive endpoints.