edgexfoundry / edgexfoundry/go-mod-secrets
Inconsistent Error Handling in GetSecret API Between Secure and Insecure Modes
- Dominant language
- Go
- Stars
- 11
- Forks
- 40
- Avg merge
- 9h 10m
- Merged PRs (30d)
- 6
Description
# 🐞 Bug Report
### Affected Services [**REQUIRED**]
Secret Store (`go-mod-secrets`, `go-mod-bootstrap`)
### Is this a regression?
n/a — this appears to be a design inconsistency rather than a regression.
### Description and Minimal Reproduction [**REQUIRED**]
The `GetSecret` API returns different error types depending on whether EdgeX is running in **secure** or **insecure** mode:
- In **secure mode**, when a secret is not found, the error returned is:
[`ErrSecretNotFound`](https://github.com/edgexfoundry/go-mod-secrets/blob/d08104d583edec144a859d292c93deafa67e8019/internal/pkg/openbao/secrets.go#L317 modes.
- In **insecure mode**, when a secret is not found, the error returned is:
[`errors.errorString`](https://github.com/edgexfoundry/go-mod-bootstrap/blob/2982f5004c563473e9de0a247a8d825addc7e24a/bootstrap/secret/insecure.go#L104 modes.
### Expected Behavior
The `GetSecret` API should return a consistent error type or value across both secure and insecure modes to simplify error handling and improve developer experience.
Contributor guide
Assessment
This issue has not been assessed yet.