Skip to content
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

Unable to retrieve secret value #947

Closed
gruyaume opened this issue Sep 8, 2023 · 6 comments · Fixed by #1065
Closed

Unable to retrieve secret value #947

gruyaume opened this issue Sep 8, 2023 · 6 comments · Fixed by #1065
Labels
kind/bug indicates a bug in the project work-in-progress disables stale bot

Comments

@gruyaume
Copy link

gruyaume commented Sep 8, 2023

Description

I am unable to retrieve the Juju secret content. I'm not certain whether this is a real bug or whether "I'm holding it wrong". In any case I haven't found how this can be done by looking at the documentation.

Whenever I try to retrieve the juju secret value, I receive "None" even though I know the secret exists and has some content (via the CLI).

Urgency

Blocker for our release

Python-libjuju version

3.2.2

Juju version

3.1.5

Reproduce / Test

Here's how I am using the lib:

from juju import jasyncio
from juju.model import Model


async def main():

    m = Model()
    await m.connect()

    secrets = await m.list_secrets(show_secrets=True)

    first_secret = secrets.results[0]
    print(first_secret.value)
    await m.disconnect()


if __name__ == '__main__':
    jasyncio.run(main())

And the results I'm getting:

None

On the other hand, I am able to get the secret via the Juju CLI

(venv) guillaume@thinkpad:~/code/vault-k8s-operator$ juju secrets
ID                    Owner      Rotation  Revision  Last updated
cjt5s4lp3des77vsgehg  vault-k8s  never            1  36 minutes ago 
(venv) guillaume@thinkpad:~/code/vault-k8s-operator$ juju show-secret cjt5s4lp3des77vsgehg --reveal
cjt5s4lp3des77vsgehg:
  revision: 1
  owner: vault-k8s
  created: 2023-09-07T23:34:42Z
  updated: 2023-09-07T23:34:42Z
  content:
    roottoken: hvs.p9v8yPn1iM0tE3w20vRyVmED
    unsealkeys: '["8adf4e322076da1de3a1b955f1a2edd0edd726ed171424b6c82cf769d9e709e0"]'
@gruyaume gruyaume added the kind/bug indicates a bug in the project label Sep 8, 2023
@cderici cderici added the 3.2 label Sep 21, 2023
@github-actions
Copy link

This issue is marked as incomplete because it has been open 30 days with no activity. Please remove incomplete label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the state/incomplete need more information label Oct 22, 2023
@gruyaume
Copy link
Author

@cderici This issue was automatically marked as incomplete. Is there any effort placed on implementing what is required here?

@github-actions github-actions bot removed the state/incomplete need more information label Oct 24, 2023
@cderici
Copy link
Contributor

cderici commented Oct 24, 2023

@cderici This issue was automatically marked as incomplete. Is there any effort placed on implementing what is required here?

Sorry for the late response, Guillaume, I do have an active ticket for this, I'll take a look very soon. Though keep in mind, the support for the secrets are pretty rudimentary at this point (on libjuju), only some basic stuff that Juan implemented to enable people to use it a little bit. We'll have a proper roadmap item to bring full support of secrets in the next cycle to both pylibjuju and the terraform provider.

Copy link

This issue is marked as incomplete because it has been open 30 days with no activity. Please remove incomplete label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the state/incomplete need more information label Nov 24, 2023
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2023
@cderici cderici reopened this Nov 29, 2023
@cderici cderici added work-in-progress disables stale bot and removed state/incomplete need more information labels Nov 29, 2023
@gboutry
Copy link
Contributor

gboutry commented Jun 27, 2024

@cderici is there any news on this issue?

Unblocked myself by using the facade directly:

await f.ListSecrets(filter_={"uri": pk_id}, show_secrets=True)

@cderici cderici removed the 3.2 label Jul 11, 2024
jujubot added a commit that referenced this issue Jul 11, 2024
#1065

#### Description

ListSecrets facade takes 2 arguments: `filter_`, and `show_secrets`. Previous instanciation passed a dict, which then landed in `filter_` field.

Fixes: #947


#### QA Steps

*<Commands / tests / steps to run to verify that the change works:>*

await f.ListSecrets(filter_={"uri": <secret_id>}, show_secrets=True)

All CI tests need to pass.

*<Please note that most likely an additional test will be required by the reviewers for any change that's not a one liner to land.>*

#### Notes & Discussion

*<Additional notes for the reviewers if needed. Please delete section if not applicable.>*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug indicates a bug in the project work-in-progress disables stale bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants