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

feat: add possibility to inject auth info from secrets #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kristofgyuracz
Copy link
Collaborator

No description provided.

@kristofgyuracz kristofgyuracz force-pushed the secret-auth branch 2 times, most recently from 36cf40e to 534ece7 Compare October 4, 2024 08:12
Copy link
Collaborator

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, once the secret watcher is added it should work just fine. 🚀

Comment on lines +113 to +120
if queriedOutput.Spec.Authentication != nil {
if queriedOutput.Spec.Authentication.BasicAuth != nil && queriedOutput.Spec.Authentication.BasicAuth.SecretRef != nil {
queriedSecret := &corev1.Secret{}
if err = r.Client.Get(ctx, types.NamespacedName{Namespace: queriedOutput.Spec.Authentication.BasicAuth.SecretRef.Namespace, Name: queriedOutput.Spec.Authentication.BasicAuth.SecretRef.Name}, queriedSecret); err != nil {
logger.Error(errors.WithStack(err), "failed getting secrets for output", "output", queriedOutput.NamespacedName().String())
}
outputWithSecretData.Secret = *queriedSecret
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please extract these into a GetSecret() / PopulateSecret() method for BasicAuthConfig / BearerAuthConfig?

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

Successfully merging this pull request may close these issues.

2 participants