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

Code from example README throws ValueError: Some authentication parameters are required : password #1081

Open
erik78se opened this issue Jul 30, 2024 · 4 comments
Assignees
Labels
kind/bug indicates a bug in the project

Comments

@erik78se
Copy link

Description

The code from the example in README throws an error:

  File "/home/erik/test-annotate/venv/lib/python3.10/site-packages/juju/client/connector.py", line 99, in connect
    raise ValueError(f'Some authentication parameters are required : {",".join(required)}')
ValueError: Some authentication parameters are required : password

Urgency

Casually reporting

Python-libjuju version

3.5.2.0

Juju version

3.3.6

Reproduce / Test

1. Install libjuju into a venv.
2. Connect and make sure "juju status" works on the current model.
3. Copy code from README
4. Run the code.
@erik78se
Copy link
Author

erik78se commented Jul 30, 2024

I can use the lib if I'm putting together connection parameters like this:

    model = Model()
    # connect() doesn't work - try with parameters.
    # await model.connect()
    await model.connect(endpoint=_CONTROLLER['endpoint'],
                        username=_CONTROLLER['username'],
                        password=_CONTROLLER['password'],
                        uuid=model_uuid,
			cacert=_CONTROLLER['cacert'])

@erik78se
Copy link
Author

It also works if the account.yaml contains username + password.

model = Model()
# connect() doesn't work - try with parameters.
# await model.connect()
await model.connect(account="admin")

@hmlanigan hmlanigan added kind/bug indicates a bug in the project kind/doc indicates a documentation change and removed kind/doc indicates a documentation change labels Aug 1, 2024
@hmlanigan
Copy link
Member

Maybe fixed by #1072.

@erik78se
Copy link
Author

erik78se commented Aug 1, 2024

Partially - but there are more issues which will surface if we use this with Macaroon based auth. We will update the issue mentioned in your post: #1072 and we can try to help you implement a fix. @hmlanigan @Aflynn50

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
Projects
None yet
Development

No branches or pull requests

3 participants