canonical / data-platform-libs

A collection of charm libraries curated by the Data Platform Team
https://charmhub.io/data-platform-libs
Apache License 2.0
9 stars 9 forks source link

[DESIGN] Should ALL peer data handled as secret? #128

Open juditnovak opened 6 months ago

juditnovak commented 6 months ago

In order to elliminate the potential for developer error (i.e. "forgetting to register a peer relation field as a secret field"), should we potentially consider a specific interface function that makes sure that a field is added as a secret?

I.e. what could be called from the charm's set_secret() method, ensuring that the field will be considered as a secret So it would dynamically add the field to secret-fields if needed (see https://github.com/canonical/data-platform-libs/issues/127, and add the value specified.

This should be very simple to do, by literally calling the new function to be added, let's say update_secret_fields(new_field), and update_relation_data().

github-actions[bot] commented 6 months ago

https://warthogs.atlassian.net/browse/DPE-3326