auth

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package auth provides authentication utilities for the Detrix client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverToken

func DiscoverToken(detrixHome string) string

DiscoverToken discovers the authentication token from environment or file. Priority: 1. DETRIX_TOKEN environment variable 2. ~/detrix/auth-token file 3. {detrixHome}/auth-token file (if detrixHome provided)

func IsAuthorized

func IsAuthorized(r *http.Request, validToken string) bool

IsAuthorized checks if a request is authorized. Localhost requests are always authorized. Remote requests require a valid Bearer token.

func IsLocalhost

func IsLocalhost(addr string) bool

IsLocalhost checks if the given address is localhost.

Types

This section is empty.

Jump to

Keyboard shortcuts

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