qfieldcloud
                                
                                
                                
                                    qfieldcloud copied to clipboard
                            
                            
                            
                        Add Secrets to the admin page
Secrets list view:
Adding a new secret:
Name,Type,ValueandProjectcan be specifiedCreated bywill be set to the current user
Modifying an existing secret:
Valueis not presented to the user- Everything is read only
- Except that the 
Valuecan be overwritten- TextInput or Textarea based on 
Type 
 - TextInput or Textarea based on 
 
 - Except that the 
 
Task linked: QF-3734 Add a way to configure secrets via the Admin
@suricactus BadSignature error occurs when you have secrets in the db encrypted with a different key (e.g. a db dump from another system). Try to clean the secrets table and test with newly created secrets.
There is now a read-only ProjectSecretInline:
The only missing part is a button in the project admin to create a new secret for that project. @suricactus do you have an idea how this can be implemented (without a custom project template)?
Otherwise I think this is ready to be merged.
The only missing part is a button in the project admin to create a new secret for that project. @suricactus do you have an idea how this can be implemented (without a custom project template)?
See potential fix to this issue here: https://github.com/opengisch/qfieldcloud/pull/949
Otherwise I think this is ready to be merged.
I did a small commit, check it's commit and message. In general, we always prefer to use the decorator for new admin stuff, the old way looks a bit too hacky.
One thing which you might have considered is to move the validation from
admin.ProjectSecretForm.clean()to themodels.Secret.clean().
Since we are messing with the name in admin.ProjectSecretForm.clean() too, I will leave everything in one place. But I will keep it in mind, when we e.g. extend the scope of the secrets.
Just re-based on my machine. If the tests pass, I will squash and merge.