Skip to content

Commit 822efeb

Browse files
chore: add multiline parsing and refactor share cred behavior
1 parent cc5e5ed commit 822efeb

File tree

11 files changed

+294
-217
lines changed

11 files changed

+294
-217
lines changed

integration/cred_test.go

-16
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ func TestGPTScriptCredential(t *testing.T) {
1414
require.Contains(t, out, "CREDENTIAL")
1515
}
1616

17-
// TestCredentialScopes makes sure that environment variables set by credential tools and shared credential tools
18-
// are only available to the correct tools. See scripts/credscopes.gpt for more details.
19-
func TestCredentialScopes(t *testing.T) {
20-
out, err := RunScript("scripts/cred_scopes.gpt", "--sub-tool", "oneOne")
21-
require.NoError(t, err)
22-
require.Contains(t, out, "good")
23-
24-
out, err = RunScript("scripts/cred_scopes.gpt", "--sub-tool", "twoOne")
25-
require.NoError(t, err)
26-
require.Contains(t, out, "good")
27-
28-
out, err = RunScript("scripts/cred_scopes.gpt", "--sub-tool", "twoTwo")
29-
require.NoError(t, err)
30-
require.Contains(t, out, "good")
31-
}
32-
3317
// TestCredentialExpirationEnv tests a GPTScript with two credentials that expire at different times.
3418
// One expires after two hours, and the other expires after one hour.
3519
// This test makes sure that the GPTSCRIPT_CREDENTIAL_EXPIRATION environment variable is set to the nearer expiration time (1h).

integration/scripts/cred_scopes.gpt

-160
This file was deleted.

pkg/config/cliconfig.go

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error {
7373
type CLIConfig struct {
7474
Auths map[string]AuthConfig `json:"auths,omitempty"`
7575
CredentialsStore string `json:"credsStore,omitempty"`
76-
GatewayURL string `json:"gatewayURL,omitempty"`
7776
Integrations map[string]string `json:"integrations,omitempty"`
7877

7978
auths map[string]types.AuthConfig

pkg/credentials/store.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func validateCredentialCtx(ctxs []string) error {
225225
}
226226

227227
// check alphanumeric
228-
r := regexp.MustCompile("^[a-zA-Z0-9]+$")
228+
r := regexp.MustCompile("^[-a-zA-Z0-9]+$")
229229
for _, c := range ctxs {
230230
if !r.MatchString(c) {
231231
return fmt.Errorf("credential contexts must be alphanumeric")

0 commit comments

Comments
 (0)