edgexfoundry / edgexfoundry/go-mod-secrets

Inconsistent Error Handling in GetSecret API Between Secure and Insecure Modes

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.