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

Add support for UserCredentials for consumer #132

Closed
eugenestarchenko opened this issue Jun 13, 2023 · 1 comment
Closed

Add support for UserCredentials for consumer #132

eugenestarchenko opened this issue Jun 13, 2023 · 1 comment

Comments

@eugenestarchenko
Copy link

Sadly NACK does not work for jetstream consumers the way we use it 😔
the piece of code that looks up the credentials from the account object is missing for the consumer

// FIXME: Add support for UserCredentials for consumer.

here is the equivalent piece for the stream object (which works fine)
// Lookup the UserCredentials.
if acc.Spec.Creds != nil {
secretName := acc.Spec.Creds.Secret.Name
secret, err := c.ki.Secrets(ns).Get(c.ctx, secretName, k8smeta.GetOptions{})
if err != nil {
return err
}
// Write the user credentials to the cache dir.
accDir := filepath.Join(c.cacheDir, ns, spec.Account)
if err := os.MkdirAll(accDir, 0755); err != nil {
return err
}
for k, v := range secret.Data {
if k == acc.Spec.Creds.File {
accUserCreds = filepath.Join(c.cacheDir, ns, spec.Account, k)
if err := os.WriteFile(filepath.Join(accDir, k), v, 0644); err != nil {
return err
}
}
}
}
}

https://github.com/nats-io/nack/blob/main/controllers/jetstream/consumer.go#LL95C29-L95C44

Do you have a possible ETA for this case?
Thank you!

@AMarti96
Copy link

This should be fixed in #128

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

2 participants