Documentation
¶
Index ¶
- Variables
- func NewAccountList(fs afero.Fs, log logging.Logger) (*defaultAccountList, error)
- type Account
- type AccountAuthType
- type AccountList
- type AccountProvider
- type AccountSource
- type CredentialsProvider
- type MockAccountList
- func (m *MockAccountList) GetAccountByName(name string) (*Account, error)
- func (m *MockAccountList) GetAccountByServerURL(url string) (*Account, error)
- func (m *MockAccountList) GetAccountsByServerType(serverType server_type.ServerType) ([]Account, error)
- func (m *MockAccountList) GetAllAccounts() ([]Account, error)
- type MockAccountProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAccountNotFound = errors.New("no such account")
Functions ¶
Types ¶
type Account ¶
type Account struct {
ServerType server_type.ServerType `json:"type"` // Which type of API this server provides
Source AccountSource `json:"source"` // Source of the saved server configuration
Name string `json:"name"` // Nickname
URL string `json:"url"` // Server URL, e.g. https://connect.example.com/rsc
Insecure bool `json:"insecure"` // Skip https server verification
Certificate string `json:"-"` // Root CA certificate, if server cert is signed by a private CA
AccountName string `json:"account_name"` // Username, if known
ApiKey string `json:"-"` // For Connect servers
SnowflakeConnection string `json:"-"` // Snowflake connection name used instead of API Key in SPCS
CloudEnvironment types.CloudEnvironment `json:"cloud_environment"` // Environment for Connect Cloud (production, staging, development)
CloudAccountID string `json:"cloud_account_id"` // Account ID for Connect Cloud
CloudAccountName string `json:"cloud_account_name"` // Account name for Connect Cloud
CloudAccessToken types.CloudAuthToken `json:"-"` // Access token for OAuth authentication
CloudRefreshToken string `json:"-"` // Refresh token for OAuth authentication
Token string `json:"-"` // Token ID for token-based authentication
PrivateKey string `json:"-"` // Base64-encoded private key for signing requests
}
func (*Account) AuthType ¶
func (acct *Account) AuthType() AccountAuthType
AuthType returns the detected AccountAuthType based on the properties of the Account.
func (*Account) HasCredential ¶ added in v1.16.0
HasCredential returns true if the Account is configured with valid credentials for authentication.
type AccountAuthType ¶
type AccountAuthType string
const ( AuthTypeNone AccountAuthType = "none" // No saved credentials AuthTypeAPIKey AccountAuthType = "api-key" // Connect API key AuthTypeSnowflake AccountAuthType = "snowflake" AuthTypeToken AccountAuthType = "token" // Token-based authentication with RSA key pair )
func (AccountAuthType) Description ¶
func (auth AccountAuthType) Description() string
type AccountList ¶
type AccountProvider ¶
type AccountSource ¶
type AccountSource string
const ( AccountSourceRsconnectPython AccountSource = "rsconnect-python" AccountSourceRsconnect AccountSource = "rsconnect" AccountSourceKeychain AccountSource = "keychain" )
func (AccountSource) Description ¶
func (source AccountSource) Description() string
type CredentialsProvider ¶
type CredentialsProvider struct {
// contains filtered or unexported fields
}
func NewCredentialsProvider ¶
func NewCredentialsProvider(log logging.Logger) (*CredentialsProvider, error)
func (*CredentialsProvider) Load ¶
func (p *CredentialsProvider) Load() ([]Account, error)
type MockAccountList ¶
type MockAccountList struct {
mock.Mock
AccountList
}
func NewMockAccountList ¶
func NewMockAccountList() *MockAccountList
func (*MockAccountList) GetAccountByName ¶
func (m *MockAccountList) GetAccountByName(name string) (*Account, error)
func (*MockAccountList) GetAccountByServerURL ¶
func (m *MockAccountList) GetAccountByServerURL(url string) (*Account, error)
func (*MockAccountList) GetAccountsByServerType ¶
func (m *MockAccountList) GetAccountsByServerType(serverType server_type.ServerType) ([]Account, error)
func (*MockAccountList) GetAllAccounts ¶
func (m *MockAccountList) GetAllAccounts() ([]Account, error)
type MockAccountProvider ¶
func (*MockAccountProvider) Load ¶
func (m *MockAccountProvider) Load() ([]Account, error)
Click to show internal directories.
Click to hide internal directories.