Skip to content

chore: add checkParam credential field #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type Credential struct {
Type CredentialType `json:"type"`
Env map[string]string `json:"env"`
Ephemeral bool `json:"ephemeral,omitempty"`
CheckParam string `json:"checkParam"`
ExpiresAt *time.Time `json:"expiresAt"`
RefreshToken string `json:"refreshToken"`
}
Expand Down
2 changes: 2 additions & 0 deletions gptscript_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@ func TestCredentials(t *testing.T) {
Type: CredentialTypeTool,
Env: map[string]string{"ENV": "testing"},
RefreshToken: "my-refresh-token",
CheckParam: "my-check-param",
})
require.NoError(t, err)

Expand All @@ -1732,6 +1733,7 @@ func TestCredentials(t *testing.T) {
require.Contains(t, cred.Env, "ENV")
require.Equal(t, cred.Env["ENV"], "testing")
require.Equal(t, cred.RefreshToken, "my-refresh-token")
require.Equal(t, cred.CheckParam, "my-check-param")

// Delete
err = g.DeleteCredential(context.Background(), "testing", name)
Expand Down