auth

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package auth implements the authentication flow for the CLI

Index

Constants

View Source
const (
	ZeaburApiKeyConfirmEndpoint = constant.ZeaburDashURL + "/auth/api-key/confirm"
)

Zeabur "API Key Confirmation" endpoint constants

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackServer

type CallbackServer struct {
	// contains filtered or unexported fields
}

func NewCallbackServer

func NewCallbackServer() (*CallbackServer, error)

func (*CallbackServer) Close

func (s *CallbackServer) Close() error

func (*CallbackServer) GetCallbackURL

func (s *CallbackServer) GetCallbackURL() string

func (*CallbackServer) Port

func (s *CallbackServer) Port() int

func (*CallbackServer) Serve

func (s *CallbackServer) Serve() error

func (*CallbackServer) WaitForToken

func (s *CallbackServer) WaitForToken(ctx context.Context) (TokenResponse, error)

type Client

type Client interface {
	GenerateToken(ctx context.Context) (string, error)
}

type ImplicitFlowClient

type ImplicitFlowClient struct {
	Endpoint url.URL
	// contains filtered or unexported fields
}

func NewImplicitFlowClient

func NewImplicitFlowClient(callbackServer *CallbackServer) *ImplicitFlowClient

func (*ImplicitFlowClient) GenerateToken

func (c *ImplicitFlowClient) GenerateToken(ctx context.Context) (token string, err error)

type TokenResponse

type TokenResponse struct {
	Token string
	State string
}

Jump to

Keyboard shortcuts

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