Skip to content

Conversation

@ionut-arm
Copy link
Member

This commit implements bootstrapping of the BasicClient. Previously,
the client would be initialised without any implicit provider and
with a mandatory authentication value. Now the client can be initialised
with default values for both, with a conditional parameter required for
the case when direct authentication is in use.

Signed-off-by: Ionut Mihalcea ionut.mihalcea@arm.com

@ionut-arm ionut-arm added enhancement New feature or request multitenancy labels Oct 15, 2020
@ionut-arm ionut-arm requested a review from hug-dev October 15, 2020 15:25
@ionut-arm ionut-arm self-assigned this Oct 15, 2020
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Will make it much more easier to use the client. Just a few comments but agree globally.

AuthType::UnixPeerCredentials => {
self.auth_data = AuthenticationData::UnixPeerCredentials
}
_ => continue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we want a wildcard watch here? Might be good to trigger a compilation error if we add one more AuthType to the interface.

edit: I see you might have done that to cover the case where the clients do not support an authentication method. But even in those case, it might be good to have a compilation error to at least be aware of it and have a specific log message maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a specific log message without having to have one match branch per type - just capturing and printing the AuthType that was not supported. Apart from that I don't think this failing is of much use, since there's no guarantee that when we add the new variant in the interface is also when we'll implement the functionality for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a log, but not a separate arm for each type

};
client.set_default_provider()?;
client.set_default_auth(app_name)?;
Ok(client)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to log which authenticator and provider were selected at the end!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a log!

@ionut-arm ionut-arm marked this pull request as ready for review October 16, 2020 09:21
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

src/auth.rs Outdated
/// Please check the
/// [Parsec Threat Model](https://parallaxsecond.github.io/parsec-book/parsec_security/parsec_threat_model/threat_model.html)
/// for more information.
AppIdentity(String),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we keep AppIdentity here then and not use Direct 😬 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, indeed, forgot about that

This commit implements bootstrapping of the `BasicClient`. Previously,
the client would be initialised without any implicit provider and
with a mandatory authentication value. Now the client can be initialised
with default values for both, with a conditional parameter required for
the case when direct authentication is in use.

Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
@ionut-arm ionut-arm merged commit 855d7f9 into parallaxsecond:master Oct 16, 2020
@ionut-arm ionut-arm deleted the bootstrap branch October 16, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request multitenancy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants