desktop

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountView

type AccountView struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Alias    string `json:"alias"`
	Username string `json:"username"`
}

type AliasAccountRequest

type AliasAccountRequest struct {
	Profile string `json:"profile"`
	Name    string `json:"name"`
	Account string `json:"account"`
}

type AliasView

type AliasView struct {
	Name         string `json:"name"`
	Asset        string `json:"asset"`
	Account      string `json:"account"`
	Organization string `json:"organization"`
}

type AssetDetailView

type AssetDetailView struct {
	AssetView
	Accounts  []AccountView  `json:"accounts"`
	Protocols []ProtocolView `json:"protocols"`
}

type AssetListRequest

type AssetListRequest struct {
	Profile      string `json:"profile"`
	Organization string `json:"organization"`
	Search       string `json:"search"`
	Offset       int    `json:"offset"`
	Limit        int    `json:"limit"`
}

type AssetPage

type AssetPage struct {
	Count      int         `json:"count"`
	Offset     int         `json:"offset"`
	Limit      int         `json:"limit"`
	AliasCount int         `json:"aliasCount"`
	Results    []AssetView `json:"results"`
}

type AssetRequest

type AssetRequest struct {
	Profile      string `json:"profile"`
	Organization string `json:"organization"`
	Asset        string `json:"asset"`
}

type AssetView

type AssetView struct {
	ID            string      `json:"id"`
	Name          string      `json:"name"`
	Address       string      `json:"address"`
	Type          string      `json:"type"`
	Category      string      `json:"category"`
	TypeValue     string      `json:"typeValue"`
	CategoryValue string      `json:"categoryValue"`
	Aliases       []AliasView `json:"aliases"`
}

type AuthService

type AuthService interface {
	Status(string) (authapp.Status, error)
}

type AuthStatus

type AuthStatus struct {
	LoggedIn         bool   `json:"loggedIn"`
	Expired          bool   `json:"expired"`
	RefreshAvailable bool   `json:"refreshAvailable"`
	ExpiresAt        string `json:"expiresAt"`
}

type BootstrapState

type BootstrapState struct {
	Version             string              `json:"version"`
	CurrentProfile      string              `json:"currentProfile"`
	CurrentOrganization string              `json:"currentOrganization"`
	Profiles            []ProfileSummary    `json:"profiles"`
	Preferences         guiconfig.Config    `json:"preferences"`
	Workspace           guiconfig.Workspace `json:"workspace"`
}

type ConfigLoader

type ConfigLoader interface {
	Load() (projectconfig.Config, error)
}

type CreateAliasRequest

type CreateAliasRequest struct {
	Profile string `json:"profile"`
	Asset   string `json:"asset"`
	Name    string `json:"name"`
	Account string `json:"account"`
}

type HostKeyCoordinator

type HostKeyCoordinator struct {
	Emit func(HostKeyPrompt)
	// contains filtered or unexported fields
}

func (*HostKeyCoordinator) Confirm

func (c *HostKeyCoordinator) Confirm(ctx context.Context, host, fingerprint string) (bool, error)

func (*HostKeyCoordinator) Resolve

func (c *HostKeyCoordinator) Resolve(id string, accepted bool) error

type HostKeyPrompt

type HostKeyPrompt struct {
	ID          string `json:"id"`
	Host        string `json:"host"`
	Fingerprint string `json:"fingerprint"`
}

type LoginAttempt

type LoginAttempt struct {
	ID        string `json:"id"`
	Profile   string `json:"profile"`
	ExpiresAt string `json:"expiresAt"`
}

type LoginCoordinator

type LoginCoordinator struct {
	Config      ConfigLoader
	Tokens      TokenSaver
	Locker      authapp.Locker
	HTTPClient  *http.Client
	OpenBrowser func(string) error
	Timeout     time.Duration
	Now         func() time.Time
	// contains filtered or unexported fields
}

func (*LoginCoordinator) Cancel

func (c *LoginCoordinator) Cancel(id string) error

func (*LoginCoordinator) Complete

func (c *LoginCoordinator) Complete(ctx context.Context, id, rawCallback string) (AuthStatus, error)

func (*LoginCoordinator) Pending

func (c *LoginCoordinator) Pending(id string) bool

func (*LoginCoordinator) Start

func (c *LoginCoordinator) Start(ctx context.Context, requestedProfile string) (LoginAttempt, error)

type OrganizationView

type OrganizationView struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type PreferenceStore

type PreferenceStore interface {
	Load() (guiconfig.Config, error)
	Save(guiconfig.Config) error
	Update(context.Context, func(*guiconfig.Config) error) error
}

type ProfileSummary

type ProfileSummary struct {
	Name         string     `json:"name"`
	URL          string     `json:"url"`
	Organization string     `json:"organization"`
	AliasCount   int        `json:"aliasCount"`
	Auth         AuthStatus `json:"auth"`
}

type ProtocolView

type ProtocolView struct {
	Name string `json:"name"`
	Port int    `json:"port"`
}

type QuickSearchRequest

type QuickSearchRequest struct {
	Profile      string `json:"profile"`
	Organization string `json:"organization"`
	Query        string `json:"query"`
	Limit        int    `json:"limit"`
}

type RenameAliasRequest

type RenameAliasRequest struct {
	Profile     string `json:"profile"`
	CurrentName string `json:"currentName"`
	NewName     string `json:"newName"`
}

type ResourceService

type ResourceService interface {
	ListOrganizations(context.Context, string) ([]jumpserver.Organization, error)
	ListAssets(context.Context, string, string, string, int, int) (jumpserver.AssetPage, error)
	FindAsset(context.Context, string, string, string) (jumpserver.AssetDetail, error)
}

type Service

type Service struct {
	Version     string
	Licenses    string
	Login       *LoginCoordinator
	Config      ConfigLoader
	Auth        AuthService
	Resources   ResourceService
	Settings    SettingsService
	Preferences PreferenceStore
}

func (Service) AddProfile

func (s Service) AddProfile(name, siteURL string) error

func (Service) Bootstrap

func (s Service) Bootstrap() (BootstrapState, error)

func (Service) CancelLogin

func (s Service) CancelLogin(attemptID string) error

func (Service) CompleteLogin

func (s Service) CompleteLogin(ctx context.Context, attemptID, callbackURL string) (AuthStatus, error)

func (Service) CreateAlias

func (s Service) CreateAlias(ctx context.Context, request CreateAliasRequest) (AliasView, error)

func (Service) DeleteAlias

func (s Service) DeleteAlias(profile, name string) error

func (Service) DeleteProfile

func (s Service) DeleteProfile(name string) error

func (Service) GetAsset

func (s Service) GetAsset(ctx context.Context, request AssetRequest) (AssetDetailView, error)

func (Service) GetAuthStatus

func (s Service) GetAuthStatus(profile string) (AuthStatus, error)

func (Service) LicenseText

func (s Service) LicenseText() string

func (Service) ListAssets

func (s Service) ListAssets(ctx context.Context, request AssetListRequest) (AssetPage, error)

func (Service) ListOrganizations

func (s Service) ListOrganizations(ctx context.Context, profile string) ([]OrganizationView, error)

func (Service) Logout

func (s Service) Logout(ctx context.Context, profile string) error

func (Service) QuickSearch

func (s Service) QuickSearch(ctx context.Context, request QuickSearchRequest) ([]AssetView, error)

func (Service) RefreshAuth

func (s Service) RefreshAuth(ctx context.Context, profile string) (AuthStatus, error)

func (Service) RenameAlias

func (s Service) RenameAlias(request RenameAliasRequest) (AliasView, error)

func (Service) SavePreferences

func (s Service) SavePreferences(value guiconfig.Config) error

func (Service) SaveWorkspace

func (s Service) SaveWorkspace(ctx context.Context, workspace guiconfig.Workspace) error

func (Service) SetAliasAccount

func (s Service) SetAliasAccount(ctx context.Context, request AliasAccountRequest) error

func (Service) SetOrganization

func (s Service) SetOrganization(profile, organization string) error

func (Service) StartLogin

func (s Service) StartLogin(ctx context.Context, profile string) (LoginAttempt, error)

func (Service) UpdateProfileURL

func (s Service) UpdateProfileURL(name, siteURL string) error

func (Service) UseProfile

func (s Service) UseProfile(name string) error

type SettingsService

type SettingsService interface {
	AddProfile(string, string) error
	UpdateProfileURL(string, string) error
	DeleteProfile(string) error
	UseProfile(string) error
	SetProfileOrganization(string, string) error
	CreateAlias(string, string, projectconfig.Alias) error
	DeleteAlias(string, string) error
	RenameAlias(string, string, string) error
	SetAliasAccount(string, string, string) error
}

type TokenSaver

type TokenSaver interface {
	Save(string, credential.Token) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL