-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add credential management (#65)
Signed-off-by: Grant Linville <[email protected]>
- Loading branch information
1 parent
a649fff
commit c5466d0
Showing
9 changed files
with
224 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package gptscript | ||
|
||
import "time" | ||
|
||
type CredentialType string | ||
|
||
const ( | ||
CredentialTypeTool CredentialType = "tool" | ||
CredentialTypeModelProvider CredentialType = "modelProvider" | ||
) | ||
|
||
type Credential struct { | ||
Context string `json:"context"` | ||
ToolName string `json:"toolName"` | ||
Type CredentialType `json:"type"` | ||
Env map[string]string `json:"env"` | ||
Ephemeral bool `json:"ephemeral,omitempty"` | ||
ExpiresAt *time.Time `json:"expiresAt"` | ||
RefreshToken string `json:"refreshToken"` | ||
} | ||
|
||
type CredentialRequest struct { | ||
Content string `json:"content"` | ||
AllContexts bool `json:"allContexts"` | ||
Context []string `json:"context"` | ||
Name string `json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: echocred | ||
credential: mycredentialtool as testcred | ||
|
||
#!/usr/bin/env bash | ||
|
||
echo $VALUE | ||
|
||
--- | ||
name: mycredentialtool | ||
|
||
#!sys.echo | ||
|
||
{"env":{"VALUE":"hello"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters