summaryrefslogtreecommitdiffstats
path: root/ogcp/forms/auth.py
Commit message (Collapse)AuthorAgeFilesLines
* forms: improve scopes field description in UserFormAlejandro Sirgo Rica2024-06-141-1/+1
| | | | | Improve the information provided to the user related to scope selection.
* forms: use checkboxes for scope selection in UserFormAlejandro Sirgo Rica2024-06-141-1/+3
| | | | | | | Enable selection of multiple scopes in user/add and user/edit for restricted users. Replace quick form creation with an inline form definition in add_user.html and edit_user.html
* Move password hashing to the backendJavier Sánchez Parra2022-06-301-8/+2
| | | | | | | | | | | This patch moves login password hashing from the frontend/javascript to the backend/flask. This patch moves password hashing of login and user management forms. Related commits: * c7b0024 ("Add password hashing") * 661254b ("Add 'Add user' to Users section")
* Add 'Delete user' to Users sectionv0.9.2Javier Sánchez Parra2022-04-271-0/+9
| | | | | Creates "Delete user" form. The user to be deleted is selected from the sidebar in Users section.
* Add 'Add user' to Users sectionJavier Sánchez Parra2022-04-271-1/+30
| | | | | Creates "Add user" form with the following inputs: username, password, password confirmation, role (administrator or regular), allowed scopes.
* Add password hashingJavier Sánchez Parra2022-04-221-0/+2
| | | | | | | | | | | The front-end now hashes passwords before sending them to the back-end. It uses SHA-512. This commit adds a hidden input which sends the password hash to not interfere with browsers' save password functionality. Also change passwords of the template configuration file for their hashed/digested versions.
* Rename "submit" to "submit_btn"Javier Sánchez Parra2022-04-221-1/+1
| | | | | Otherwise, wtforms use "submit" as id of the <input> tag, shadowing javascript function ".submit()".
* Use lazy translation in classesJavier Sánchez Parra2022-01-131-3/+4
| | | | | | | | | | | | | From flask babel documentation: --- Additionally if you want to use constant strings somewhere in your application and define them outside of a request, you can use a lazy strings. Lazy strings will not be evaluated until they are actually used. To use such a lazy string, use the lazy_gettext() function. --- _() and _l() functions are aliases of gettext() and lazy_gettext() respectively. Both functions belong to flask babel library.
* ogcp is AGPLv3+OpenGnSys Support Team2021-05-201-0/+7
| | | | Update license header in files.
* Add loginJose M. Guisado2021-03-051-0/+20
Ogcp requires a simple login page in order to avoid exposure of the ogServer API to anyone trying to access the web page. Because the main authorization mechanism in ogServer is the api token the login implemented for the ogcp does not include registration process but a single user and password specified in the ogcp.json. "USER": "user", "PASS": "pass" Adds two new views: /login and /logout. They are used to login the user so that the rest of views regarding ogServer functionality can be accessed in a "login required" fashion. Index view (/) is an exception, it can be accessed logged in or not so different data can be displayed. Templates can now access a variable "current_user" to get information about login status. This is a Flask-Login feature. - Templates regarding login can be found in templates/auth/ - Login form is defined in forms/auth.py to separate it from action_forms.py - Adds Flask-Login module to requirements.txt - Adds default user and pass in ogcp.json