auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2025 Vapi, Inc.

Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors:

Dan Goosewin <[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login() error

Login performs the browser-based authentication flow

func LoginWithAccountName added in v0.1.2

func LoginWithAccountName(accountName string) error

LoginWithAccountName performs authentication and optionally saves with a specific account name

func Logout added in v0.1.2

func Logout() error

Logout clears the stored authentication credentials

func LogoutAccount added in v0.1.2

func LogoutAccount(accountName string) error

LogoutAccount logs out from a specific account, or all accounts if accountName is empty

Types

type AuthManager

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

func NewAuthManager

func NewAuthManager() *AuthManager

func (*AuthManager) Authenticate

func (a *AuthManager) Authenticate() (string, error)

Authenticate opens the browser for OAuth-style authentication

type AuthStatus added in v0.1.2

type AuthStatus struct {
	IsAuthenticated bool
	APIKeySet       bool
	APIKeySource    string
	Environment     string
	BaseURL         string
	DashboardURL    string
	ActiveAccount   string
	TotalAccounts   int
	Accounts        map[string]config.Account
}

AuthStatus represents the current authentication status

func GetStatus added in v0.1.2

func GetStatus() (*AuthStatus, error)

GetStatus returns the current authentication status

Jump to

Keyboard shortcuts

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