Add THRESHOLD_* env var support with BOUNDARY_* fallback
Introduce api.Getenv/api.LookupEnv which prefer THRESHOLD_X and fall back to legacy BOUNDARY_X; use them for user-facing env var reads. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eeb38a1a84
commit
306960d24b
16 files changed
+135
-57
No files matched your search
@@ -5,7 +5,6 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
retryablehttp "github.com/hashicorp/go-retryablehttp"
|
||||
@@ -60,8 +59,8 @@ func (d *OutputStringError) parseRequest() {
|
||||
for k, v := range d.Request.Header {
|
||||
for _, h := range v {
|
||||
if strings.ToLower(k) == "authorization" {
|
||||
tokenName := os.Getenv("BOUNDARY_TOKEN_NAME")
|
||||
keyringType := os.Getenv("BOUNDARY_KEYRING_TYPE")
|
||||
tokenName := Getenv("BOUNDARY_TOKEN_NAME")
|
||||
keyringType := Getenv("BOUNDARY_KEYRING_TYPE")
|
||||
switch {
|
||||
case tokenName == "none" || keyringType == "none":
|
||||
h = `Bearer <token>`
|
||||
|
||||
Reference in new issue
Block a user