use github token env var if present when fetching org id (#19244)

This commit is contained in:
Raymond Ho
2023-02-21 12:17:35 -08:00
committed by GitHub
parent 1b33b99253
commit 77e80a8030
4 changed files with 51 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/url"
"os"
"strings"
"time"
@@ -94,7 +95,8 @@ func (b *backend) pathConfigWrite(ctx context.Context, req *logical.Request, dat
}
if c.OrganizationID == 0 {
client, err := b.Client("")
githubToken := os.Getenv("VAULT_AUTH_CONFIG_GITHUB_TOKEN")
client, err := b.Client(githubToken)
if err != nil {
return nil, err
}