auth

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default ClickUp OAuth app credentials. These can be overridden via config.
	DefaultClientID     = ""
	DefaultClientSecret = ""
)

Variables

This section is empty.

Functions

func ClearToken

func ClearToken() error

ClearToken removes stored credentials from keyring and file.

func GetAuthMethod

func GetAuthMethod() string

GetAuthMethod returns the authentication method used ("oauth" or "token").

func GetAuthURL

func GetAuthURL(clientID, redirectURI string) string

GetAuthURL returns the authorization URL for the OAuth flow.

func GetToken

func GetToken() (string, error)

GetToken retrieves the stored API token.

func OAuthFlow

func OAuthFlow(clientID, clientSecret string) (string, error)

OAuthFlow performs the OAuth 2.0 authorization code flow using a local HTTP server.

func StoreToken

func StoreToken(token, method string) error

StoreToken saves the API token to the OS keyring, falling back to plaintext.

Types

type AuthUser

type AuthUser struct {
	ID             int    `json:"id"`
	Username       string `json:"username"`
	Email          string `json:"email"`
	ProfilePicture string `json:"profilePicture"`
}

AuthUser represents the authenticated ClickUp user.

func ValidateToken

func ValidateToken(token string) (*AuthUser, error)

ValidateToken checks that a token is valid by calling the ClickUp API. Returns the authenticated user info on success.

type OAuthResult

type OAuthResult struct {
	AccessToken string
	Error       error
}

OAuthResult holds the result of an OAuth flow.

Jump to

Keyboard shortcuts

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