-
Notifications
You must be signed in to change notification settings - Fork 6
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
These func UndeleteSecret(path string, versions []int)
methods should return an error for better audit tracking
#18
Comments
@v0lkan assign |
@sahinakyol let me do some cleanup and then add more context here and then I'll assign :). Thanks for your help 🙏 |
Some more context: There is a key-value store implemented here: The issue with that is, its methods are inconsistent. For example We have a custom Here is the full list of methods:
For consistency, the signatures could better be as follows:
That's part one. Part two is the methods that consume these functions. For example func UndeleteSecret(path string, versions []int) {
kvMu.Lock()
err := kv.Undelete(path, versions)
kvMu.Unlock()
if err != nil {
return
}
persist.AsyncPersistSecret(kv, path)
} ^ it would be nice if this (and other similar functions) return the error instead... So that this can catch the error and instead of this state.UndeleteSecret(path, versions)
log.Log().Info("routeUndeleteSecret", "msg", "Secret undeleted") it could say: err := state.UndeleteSecret(path, versions)
if err.equals(ErrSecretNotFound) {
log.Log().Warn("routeUndeleteSecret", "msg", "Secret not found")
} else {
log.Log().Info("routeUndeleteSecret", "msg", "Secret undeleted")
} |
No description provided.
The text was updated successfully, but these errors were encountered: