opengisch / qfieldcloud

QFieldCloud allows seamless synchronization of your field data with your spatial infrastructure with change tracking, team management and online-offline work capabilities in QField.
https://qfield.cloud
MIT License
102 stars 44 forks source link

Add Secrets to the admin page #939

Closed boardend closed 1 month ago

boardend commented 2 months ago

Secrets list view: Screenshot from 2024-04-26 11-04-09


Adding a new secret: Screenshot from 2024-04-26 11-05-37


Modifying an existing secret: Screenshot from 2024-04-26 11-05-54

duke-nyuki commented 2 months ago

Task linked: QF-3734 Add a way to configure secrets via the Admin

boardend commented 1 month ago

@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.

boardend commented 1 month ago

There is now a read-only ProjectSecretInline:

Screenshot from 2024-05-25 11-14-44

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.

suricactus commented 1 month ago

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.

boardend commented 1 month ago

One thing which you might have considered is to move the validation from admin.ProjectSecretForm.clean() to the models.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.