-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expand the secret ID out to the full URI when only given the ID #1358
feat: expand the secret ID out to the full URI when only given the ID #1358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Do you envision this breaking anyone's tests? Hopefully not, but would be worth a super tox run.
Could we also run this on a real charm on Juju, for an end-to-end test?
self.id = Secret._canonicalize_id(id) | ||
if model_uuid is None: | ||
warnings.warn( | ||
'`model_uuid` should always be provided when creating a ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases can this happen? Only if people manually create a SecretInfo
object? (Which they shouldn't be doing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases can this happen? Only if people manually create a
Secret
object? (Which they shouldn't be doing.)
Manually create a SecretInfo
, yes. And yes, I don't know why they would, although we don't tell them not to (as we do with Secret
, for example). This is probably overly cautious - I can't find any charm doing this (Scenario does, but we can fix that in advance of a release), but seemed better than just having None
work and then in some future version (3.0?) suddenly not work.
Good question. I don't see it breaking anyone's charms, since it's already the case that the
Good call: 112 charms' tests passed with main, 110 with this branch. One of the failures was
And this is a legitimate bug 😞. Harness isn't properly getting the secret because it can't handle the different types of URI like Juju can. I'll fix that and re-run.
Sorry, I always forget to mention I've done that. Juju 3.6b2, LXD (I don't think either of those should matter). With main:
With this branch:
|
…y forms can be used, like with Juju.
They pass now, so this doesn't break the unit tests of at least those 112 charms, which makes me fairly confident it won't break for anyone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls remove coverage.xml from the PR
Thanks! Guess which PR I worked on immediately prior to this 😆. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, only small technical issues/notes.
Adjust the rules for getting the 'canonical' form of the Secret URI:
secret:
, leave it as-is (unchanged)secret:
prefix to end up with the formsecret:id
(unchanged)secret://{model UUID}/{secret ID
form (new)Also adjust the code that calls the canonicalization [sic] method so that the model UUID is always available in regular ops use. If someone is creating
SecretInfo
objects themselves then aNone
value for the UUID is the default, for backwards compatibility (but a warning is issued in that case).Fixes #1312.