Documentation
¶
Overview ¶
Package auth implements the device-code login flow against the cloud API.
Index ¶
- type Credentials
- type Service
- func (s Service) LoginWithBrowser(ctx context.Context, cfg *config.Config, w io.Writer) (Credentials, error)
- func (s Service) LoginWithToken(ctx context.Context, cfg *config.Config, token string) (Credentials, error)
- func (s Service) Logout() error
- func (s Service) Signup(ctx context.Context, cfg *config.Config, email string, w io.Writer) (Credentials, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
Credentials are the platform credentials produced by a successful login.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs Volcano authentication workflows.
func NewService ¶
func NewService(deps cliruntime.Deps) Service
NewService returns an authentication service.
func (Service) LoginWithBrowser ¶
func (s Service) LoginWithBrowser(ctx context.Context, cfg *config.Config, w io.Writer) (Credentials, error)
LoginWithBrowser runs the OAuth device flow, then routes the browser through Volcano Web's login page (like Signup does for signup) rather than opening the backend's raw device-verification URI directly.
func (Service) LoginWithToken ¶
func (s Service) LoginWithToken(ctx context.Context, cfg *config.Config, token string) (Credentials, error)
LoginWithToken validates token and returns credentials to persist.
func (Service) Signup ¶ added in v0.0.4
func (s Service) Signup(ctx context.Context, cfg *config.Config, email string, w io.Writer) (Credentials, error)
Signup runs the same device flow as login but routes the browser through Volcano Web's signup page first. The signup origin is taken from the device authorization response's verification URI, so signup always targets the same environment as login; an explicit VOLCANO_WEB_URL still wins.