credentials

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodexToken

func GetCodexToken() (string, error)

GetCodexToken is a convenience wrapper that returns just the token. Deprecated: Use GetCodexCredentials instead to get both token and account ID.

func GetGeminiCredentials

func GetGeminiCredentials() (string, error)

GetGeminiCredentials returns an error explaining how to configure Gemini. Kept for backwards compatibility with the old error message.

Types

type CodexCredentials

type CodexCredentials struct {
	AccessToken string
	AccountID   string // Empty if not available
}

CodexCredentials holds the token and optional account ID for Codex auth

func GetCodexCredentials

func GetCodexCredentials() (*CodexCredentials, error)

GetCodexCredentials retrieves the OpenAI credentials from Codex auth. It reads from ~/.codex/auth.json and returns the OAuth access_token along with the account_id (needed for ChatGPT backend API).

type GeminiOAuthCredentials

type GeminiOAuthCredentials struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiryDate   int64  `json:"expiry_date"`
}

GeminiOAuthCredentials holds the OAuth credentials loaded from ~/.gemini/oauth_creds.json

func GetGeminiOAuthCredentials

func GetGeminiOAuthCredentials() (*GeminiOAuthCredentials, error)

GetGeminiOAuthCredentials loads OAuth credentials from ~/.gemini/oauth_creds.json These are used for the Code Assist API (cloudcode-pa.googleapis.com)

Jump to

Keyboard shortcuts

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