Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement component bootstrapping #52

Closed
ionut-arm opened this issue Oct 6, 2020 · 6 comments
Closed

Implement component bootstrapping #52

ionut-arm opened this issue Oct 6, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request multitenancy

Comments

@ionut-arm
Copy link
Member

The service now offers operations that can be used to bootstrap the client library into using the recommended provider and the supported authentication method.

Currently the users of BasicClient need to make those calls themselves and then configure the client object, but there's no reason that functionality cannot be implemented on top of or into BasicClient to limit code duplication.

A design proposal should be made before this can be started.

@ionut-arm ionut-arm added the enhancement New feature or request label Oct 6, 2020
@hug-dev
Copy link
Member

hug-dev commented Oct 14, 2020

In the BasicClient we would add two methods:

  • set_default_provider: will set the first provider returned by ListProviders
  • set_default_auth_data: will set the appropriate auth data based on the first auth type returned by ListAuthenticators

In the new constructor: set the two defaults.

@ionut-arm ionut-arm self-assigned this Oct 14, 2020
@ionut-arm
Copy link
Member Author

Do you think we should have new set the defaults or should we leave it as is and only call the default methods in Default::default()?

@ionut-arm
Copy link
Member Author

It's a bit annoying that there's no method overloading in Rust... :( would've been nice to have one new with an AppIdentity param and one without.

@hug-dev
Copy link
Member

hug-dev commented Oct 15, 2020

Maybe there could be different kind of constructions:

  • new with no paramaters choosing everything for you
  • new_with_auth_data: setting only the auth data
  • etc...

Implementing Default might be hard on types if you don't have access to a client to call ListProviders or ListAuthenticators?

@ionut-arm
Copy link
Member Author

Implementing Default might be hard on types if you don't have access to a client to call ListProviders or ListAuthenticators?

? I think you can just create a client, call the methods on it and return it. That's what new will do as well.

@ionut-arm
Copy link
Member Author

Done in #58

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request multitenancy
Projects
None yet
Development

No branches or pull requests

2 participants