You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class Repos::ConjurCA retrieves its required secrets by creating a Resource object and calling its last_secret method.
This is not good for supportability as in case the variable has no value we get a "NoMethodError: undefined method 'value' for nil:NilClass" error which doesn't tell the story.
In FetchRequiredSecrets we first verify that the variable exists and that it has a value before retrieving it. We should use this class in Repos::ConjurCA so we have this capability out of the box.
Steps to reproduce the issue
Create an authn-k8s authenticator without loading a value into conjur/authn-k8s/<service-id>/ca/cert
Run the authn-client to authenticate with k8s
The Nil error will show in the logs
What's the expected result?
a RequiredResourceMissing or RequiredSecretMissing error is raised
What's the actual result?
a "NoMethodError: undefined method 'value' for nil:NilClass" error is raised
The text was updated successfully, but these errors were encountered:
@liavyona@orenbm: My knowledge about authn k8s troubleshooting is essentially non-existent. Could you please provide a more user focused description of the value that change provides? And please include an entry in the CHANGELOG. I'm assuming this is user facing, as an error class is changed and @InbalZilberman added it to the rolling release notes. Finally, I noticed that no tests were added/updated, which was a little surprising. Does this change need more coverage? Thanks!
This is unsafe (might cause NoMethodError) due to:
cert id / key_id / both didn't create at all => Resource[ca_info.cert_id] will be nil.
cert id / key_id / both created but didn't initialize => Resource[ca_info.cert_id].last_secret will be nil.
In my PR, we changed the relevant data fetching to use :Conjur::FetchRequiredSecrets.new which will raise a more clear error message (Errors::Conjur::RequiredSecretMissing).
The scenarios described above are edge cases and even extreme ones.
@liavyona can you please add an entry under Fixed for this?
something like:
Verify that Kubernetes Authenticator variables exist and have value before retrieving them so that we raise a proper error if they aren't and enhance supportability
Issue description
The class
Repos::ConjurCA
retrieves its required secrets by creating a Resource object and calling itslast_secret
method.This is not good for supportability as in case the variable has no value we get a "NoMethodError: undefined method 'value' for nil:NilClass" error which doesn't tell the story.
In
FetchRequiredSecrets
we first verify that the variable exists and that it has a value before retrieving it. We should use this class inRepos::ConjurCA
so we have this capability out of the box.Steps to reproduce the issue
conjur/authn-k8s/<service-id>/ca/cert
What's the expected result?
What's the actual result?
The text was updated successfully, but these errors were encountered: