Documentation
¶
Index ¶
- Constants
- func GitURLForRepoName(repoName string) (string, error)
- func NewHelper(c *config.CLIConfig, helper string) (credentials.Store, error)
- func RepoNameForCredentialStore(store string) string
- type Credential
- type CredentialBuilder
- type CredentialHelperDirs
- type CredentialStore
- type CredentialType
- type HelperStore
- type NoopStore
- func (s NoopStore) Add(context.Context, Credential) error
- func (s NoopStore) Get(context.Context, string) (*Credential, bool, error)
- func (s NoopStore) List(context.Context) ([]Credential, error)
- func (s NoopStore) Refresh(context.Context, Credential) error
- func (s NoopStore) Remove(context.Context, string) error
- type Store
- func (s Store) Add(ctx context.Context, cred Credential) error
- func (s Store) Get(ctx context.Context, toolName string) (*Credential, bool, error)
- func (s Store) List(ctx context.Context) ([]Credential, error)
- func (s Store) Refresh(ctx context.Context, cred Credential) error
- func (s Store) Remove(ctx context.Context, toolName string) error
Constants ¶
View Source
const ( CredentialTypeTool CredentialType = "tool" CredentialTypeModelProvider CredentialType = "modelProvider" ExistingCredential = "GPTSCRIPT_EXISTING_CREDENTIAL" CredentialExpiration = "GPTSCRIPT_CREDENTIAL_EXPIRATION" )
View Source
const ( DefaultCredentialContext = "default" AllCredentialContexts = "*" )
Variables ¶
This section is empty.
Functions ¶
func GitURLForRepoName ¶
Types ¶
type Credential ¶
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"` }
func (Credential) IsExpired ¶
func (c Credential) IsExpired() bool
type CredentialBuilder ¶
type CredentialHelperDirs ¶
type CredentialHelperDirs struct {
RevisionFile, LastCheckedFile, BinDir string
}
func GetCredentialHelperDirs ¶
func GetCredentialHelperDirs(cacheDir, store string) CredentialHelperDirs
type CredentialStore ¶
type CredentialStore interface { Get(ctx context.Context, toolName string) (*Credential, bool, error) Add(ctx context.Context, cred Credential) error Refresh(ctx context.Context, cred Credential) error Remove(ctx context.Context, toolName string) error List(ctx context.Context) ([]Credential, error) }
func NewStore ¶
func NewStore(cfg *config.CLIConfig, credentialBuilder CredentialBuilder, credCtxs []string, cacheDir string) (CredentialStore, error)
type CredentialType ¶
type CredentialType string
type HelperStore ¶
type HelperStore struct {
// contains filtered or unexported fields
}
func (*HelperStore) Erase ¶
func (h *HelperStore) Erase(serverAddress string) error
func (*HelperStore) Get ¶
func (h *HelperStore) Get(serverAddress string) (types.AuthConfig, error)
func (*HelperStore) GetAll ¶
func (h *HelperStore) GetAll() (map[string]types.AuthConfig, error)
func (*HelperStore) Store ¶
func (h *HelperStore) Store(authConfig types.AuthConfig) error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (Store) Add ¶
func (s Store) Add(ctx context.Context, cred Credential) error
Add adds a new credential to the credential store. Any context set on the credential object will be overwritten with the first context of the credential store.
Click to show internal directories.
Click to hide internal directories.