auth

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package auth provides authentication utilities for the AhaSend CLI.

This package handles client authentication through multiple methods:

  • Global API key flags (--api-key and --account-id)
  • Profile-based authentication from configuration files
  • Profile switching and validation

The main function GetAuthenticatedClient creates authenticated clients for use by CLI commands, handling the authentication precedence and validation automatically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthenticatedClient

func GetAuthenticatedClient(cmd *cobra.Command) (client.AhaSendClient, error)

GetAuthenticatedClient returns an authenticated AhaSend client It checks for global flags first, then falls back to profiles

func RequireAuth

func RequireAuth(cmd *cobra.Command) error

RequireAuth validates that authentication is available

Types

This section is empty.

Jump to

Keyboard shortcuts

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