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

Added cert auth method for auto auth #58

Closed

Conversation

qvicksilver
Copy link

No description provided.

@jasonodonnell
Copy link
Contributor

Hi @qvicksilver, sorry for the delay, I've been away for some time! It seems we have introduced a number of conflicts. Would you kindly resolve them so I can review this pull request?

Thank you!

@qvicksilver
Copy link
Author

Rebased!

@tvoran tvoran added enhancement New feature or request injector Area: mutating webhook service labels Mar 3, 2020
@@ -123,12 +123,15 @@ const (
// AnnotationVaultAuthPath specifies the mount path to be used for the Kubernetes auto-auth
// method.
AnnotationVaultAuthPath = "vault.hashicorp.com/auth-path"

// AnnotationVaultAuthMethod specifies the auto-auth method to use
AnnotationVaultAuthMethod = "vault.hashicorp.com/auth-method"
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be better to have auth config instead, cause there might be a need for other additional params in future? What do you think?

@@ -126,6 +120,16 @@ func (a *Agent) newConfig(init bool) ([]byte, error) {
Templates: a.newTemplateConfigs(),
}

if a.Vault.AuthMethod == "" || a.Vault.AuthMethod == DefaultVaultAuthMethod {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it better to abstract this logic rather than having it all over the place? If were to do it I would create an interface with methods GetAutoAuthConfig and GetAutoAuthPatches and create structs like KubernetesAutoAuth and CertAutoAuth which implements this interface. I can see this function growing as now there are 2 open PRs for adding different autoauthmethods soon there will be more autoauth methods and we will end up with a very big function. Apart from cognitive overhead it would also make it hard to test this method in future. What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

I totally agree, however that was never the scope of this. At the time of implementation we had the need to support authentication using certificates. We don't forsee any need for anything else in the future and there seemed to be no efforts in the upstream implementation to provide an abstract version.
If you feel this is not up to the projects standards it is perfectly fine to dismiss this PR, there will be no hard feelings. We don't use this solution anymore and will not put more time into it.

@smitthakkar96
Copy link
Contributor

smitthakkar96 commented Mar 7, 2020 via email

@pbar1
Copy link
Contributor

pbar1 commented Jan 17, 2021

Hey, I've got a PR open (#213) that supports all auth methods (including Cert) via annotations. Check that out to see if it covers your use case - going off of historical PRs, it seems like a common ask.

@jasonodonnell
Copy link
Contributor

All Auth Methods are supported. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request injector Area: mutating webhook service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants