Documentation ¶
Index ¶
- Constants
- Variables
- func DisplayBrevLogo(t *terminal.Terminal)
- func GetAccessToken() (string, error)
- func GetCachedWorkspaceNames() []string
- func GetOrgNames() []string
- func GetWorkspaceNames() []string
- func GetandDisplaySSHKeys(t *terminal.Terminal) error
- func HandleNewClientErrors(err error) error
- func InstallVSCodeExtension(t *terminal.Terminal)
- func IsInProjectDirectory() (bool, error)
- func Login(prompt bool) (*string, error)
- func Logout() error
- func OpenBrowser(url string) error
- func PromptGetInput(pc PromptContent) string
- func PromptSelectInput(pc PromptSelectContent) string
- func RefreshWorkspaceCacheForActiveOrg() error
- func RequiredScopes() []string
- func RequiredScopesMin() []string
- func StringInList(a string, list []string) bool
- func WriteCaches() ([]Organization, []CacheableWorkspace, error)
- func WriteIndividualWorkspaceCache(orgID string, wss []Workspace) error
- func WriteOrgCache(orgs []Organization) error
- func WriteTokenToBrevConfigFile(token *Credentials) error
- type Application
- type Authenticator
- type CacheableWorkspace
- type Client
- func (a *Client) CreateUser(identity string) (*User, error)
- func (a *Client) CreateWorkspace(orgID string, name string, gitrepo string) (*Workspace, error)
- func (a *Client) DeleteWorkspace(wsID string) (*Workspace, error)
- func (a *Client) GetMe() (*User, error)
- func (a *Client) GetMeKeys() (*UserKeys, error)
- func (a *Client) GetMyWorkspaces(orgID string) ([]Workspace, error)
- func (a *Client) GetOrgs() ([]Organization, error)
- func (a *Client) GetWorkspace(wsID string) (*Workspace, error)
- func (a *Client) GetWorkspaceMetaData(wsID string) (*WorkspaceMetaData, error)
- func (a *Client) GetWorkspaces(orgID string) ([]Workspace, error)
- func (a *Client) ResetWorkspace(wsID string) (*Workspace, error)
- func (a *Client) StartWorkspace(wsID string) (*Workspace, error)
- func (a *Client) StopWorkspace(wsID string) (*Workspace, error)
- type Credentials
- type NewWorkspace
- type OauthToken
- type Organization
- type PromptContent
- type PromptSelectContent
- type RequestCreateWorkspace
- type Result
- type State
- type TempAuth
- type User
- type UserKeys
- type Workspace
- type WorkspaceGroupKeys
- type WorkspaceMetaData
- type WorkspaceWithMeta
Constants ¶
View Source
const (
// namespace used to set/get values from the keychain.
SecNamespace = "auth0-cli"
)
Variables ¶
View Source
var ( DefaultApplicationID = "92f59a4yf" DefaultApplication = Application{ ID: "92f59a4yf", Name: "VSCode", Port: 22778, StartCommand: "", Version: "1.57.1", } )
View Source
var DefaultApplicationList = []Application{DefaultApplication}
View Source
var Ta *time.Time
Functions ¶
func DisplayBrevLogo ¶
func GetAccessToken ¶
func GetCachedWorkspaceNames ¶
func GetCachedWorkspaceNames() []string
func GetOrgNames ¶
func GetOrgNames() []string
func GetWorkspaceNames ¶
func GetWorkspaceNames() []string
func GetandDisplaySSHKeys ¶
func HandleNewClientErrors ¶
func InstallVSCodeExtension ¶
func IsInProjectDirectory ¶
func Login ¶
BANANA: this feels like a bad dependency loop
... should the user creation happen outside of this function?
func Login(prompt bool, loginStore login.LoginStore) error {
func OpenBrowser ¶
open opens the specified URL in the default browser of the user.
func PromptGetInput ¶
func PromptGetInput(pc PromptContent) string
func PromptSelectInput ¶
func PromptSelectInput(pc PromptSelectContent) string
func RefreshWorkspaceCacheForActiveOrg ¶
func RefreshWorkspaceCacheForActiveOrg() error
func RequiredScopes ¶
func RequiredScopes() []string
RequiredScopes returns the scopes used for login.
func RequiredScopesMin ¶
func RequiredScopesMin() []string
RequiredScopesMin returns minimum scopes used for login in integration tests.
func StringInList ¶
func WriteCaches ¶
func WriteCaches() ([]Organization, []CacheableWorkspace, error)
func WriteOrgCache ¶
func WriteOrgCache(orgs []Organization) error
func WriteTokenToBrevConfigFile ¶
func WriteTokenToBrevConfigFile(token *Credentials) error
Types ¶
type Application ¶
type Authenticator ¶
type Authenticator struct { Audience string ClientID string DeviceCodeEndpoint string OauthTokenEndpoint string }
type CacheableWorkspace ¶
type CacheableWorkspace struct { OrgID string `json:"orgID"` Workspaces []Workspace `json:"workspaces"` }
func GetWsCacheData ¶
func GetWsCacheData() ([]CacheableWorkspace, error)
type Client ¶
type Client struct {
Key *OauthToken
}
func NewCommandClient ¶
func (*Client) CreateWorkspace ¶
func (*Client) GetMyWorkspaces ¶
Note: this is the "projects" view
func (*Client) GetOrgs ¶
func (a *Client) GetOrgs() ([]Organization, error)
func (*Client) GetWorkspaceMetaData ¶
func (a *Client) GetWorkspaceMetaData(wsID string) (*WorkspaceMetaData, error)
type Credentials ¶
type NewWorkspace ¶
func ValidateGitURL ¶
func ValidateGitURL(_ *terminal.Terminal, url string) NewWorkspace
type OauthToken ¶
type OauthToken struct { AccessToken string `json:"access_token"` AuthMethod string `json:"auth_method"` ExpiresIn int `json:"expires_in"` IDToken string `json:"id_token"` RefreshToken string `json:"refresh_token"` }
func GetToken ¶
func GetToken() (*OauthToken, error)
GetToken reads the previously-persisted token from the filesystem, returning nil for a token if it does not exist
func GetTokenFromBrevConfigFile ¶
func GetTokenFromBrevConfigFile(fs afero.Fs) (*OauthToken, error)
type Organization ¶
func GetActiveOrgContext ¶
func GetActiveOrgContext(fs afero.Fs) (*Organization, error)
func GetOrgCacheData ¶
func GetOrgCacheData() ([]Organization, error)
func GetOrgFromName ¶
func GetOrgFromName(name string) (*Organization, error)
type PromptContent ¶
type PromptSelectContent ¶
type RequestCreateWorkspace ¶
type RequestCreateWorkspace struct { Name string `json:"name"` WorkspaceGroupID string `json:"workspaceGroupId"` WorkspaceClassID string `json:"workspaceClassId"` GitRepo string `json:"gitRepo"` IsStoppable bool `json:"isStoppable"` WorkspaceTemplateID string `json:"workspaceTemplateId"` PrimaryApplicationID string `json:"primaryApplicationId"` Applications []Application `json:"applications"` }
type State ¶
type State struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerificationURI string `json:"verification_uri_complete"` ExpiresIn int `json:"expires_in"` Interval int `json:"interval"` }
func (*State) IntervalDuration ¶
type UserKeys ¶
type UserKeys struct { PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` WorkspaceGroups []WorkspaceGroupKeys `json:"workspaceGroups"` }
func (UserKeys) GetWorkspaceGroupKeysByGroupID ¶
func (u UserKeys) GetWorkspaceGroupKeysByGroupID(groupID string) (*WorkspaceGroupKeys, error)
type Workspace ¶
type Workspace struct { ID string `json:"id"` Name string `json:"name"` WorkspaceGroupID string `json:"workspaceGroupId"` OrganizationID string `json:"organizationId"` WorkspaceClassID string `json:"workspaceClassId"` CreatedByUserID string `json:"createdByUserId"` DNS string `json:"dns"` Status string `json:"status"` Password string `json:"password"` GitRepo string `json:"gitRepo"` }
func GetWorkspaceFromName ¶
type WorkspaceGroupKeys ¶
type WorkspaceMetaData ¶
type WorkspaceMetaData struct { PodName string `json:"podName"` NamespaceName string `json:"namespaceName"` }
func (WorkspaceMetaData) GetNamespaceName ¶
func (w WorkspaceMetaData) GetNamespaceName() string
func (WorkspaceMetaData) GetPodName ¶
func (w WorkspaceMetaData) GetPodName() string
type WorkspaceWithMeta ¶
type WorkspaceWithMeta struct { WorkspaceMetaData Workspace }
Click to show internal directories.
Click to hide internal directories.