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

how do you pass in credentials for MinioAdmin after the major refactor? #1331

Closed
jessebot opened this issue Nov 17, 2023 · 5 comments
Closed

Comments

@jessebot
Copy link
Contributor

jessebot commented Nov 17, 2023

After #1291, how do you pass in credentials for the MinioAdmin class now? credentials type is not defined here, but is required as there is no default:

credentials,

But when I look at the code here, it shows it should be of type Provider:

if not isinstance(credentials, Provider):
raise ValueError("valid credentials must be provided")

However, when I look at Provider, it doesn't explain what type credentials are either:

class Provider: # pylint: disable=too-few-public-methods
"""Credential retriever."""
__metaclass__ = ABCMeta
@abstractmethod
def retrieve(self):
"""Retrieve credentials and its expiry if available."""

In the future, before merging and releasing a major refactoring change like this, please require doc and example updates. A deprecation warning would have also been helpful.

For the type hints, I added #1334 to try and help out. If I can get confirmation on how to pass in credentials, I'm happy to create further PRs to update some examples to help out.

@pbrw
Copy link
Contributor

pbrw commented Nov 17, 2023

Here is an example:

from minio.credentials import StaticProvider

madmin = MinioAdmin(
     "127.0.0.1:9000",
     credentials=StaticProvider(
         access_key='minioadmin', 
         secret_key='minioadmin'
     ),
     secure=False
)

@jessebot
Copy link
Contributor Author

awesome, thank you! I'll give that a try and then also try to add some examples in a PR shortly :)

@balamurugana
Copy link
Member

Refer #1334

@furkansahin
Copy link

furkansahin commented Nov 22, 2023

I landed here, too. It would be really nice if you had some documentation around MinioAdmin class in general...

@jessebot
Copy link
Contributor Author

Sorry, the project I'm on right now started demoing an alternative self hosted object store, and then I didn't have time to try out the new suggested workflow. If others have more time and have tested the example in #1331 (comment) please feel free to submit example PRs ahead of me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants