security

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

internal/security/auth.go

Index

Constants

View Source
const MinTokenLength = 32

MinTokenLength is the minimum byte length required for a valid bridge auth token.

Variables

This section is empty.

Functions

func ValidateFilePermissions

func ValidateFilePermissions(filePath string) bool

ValidateFilePermissions checks that a bridge file has secure permissions (owner-only access on Unix). It is stateless, hence a package-level function.

Types

type AuthManager

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

AuthManager handles secure token management for bridge communication

func NewAuthManager

func NewAuthManager() *AuthManager

NewAuthManager creates a new authentication manager

func (*AuthManager) GetAuthHeaders

func (am *AuthManager) GetAuthHeaders() map[string]string

GetAuthHeaders returns authentication headers for HTTP requests

func (*AuthManager) LoadTokenFromString

func (am *AuthManager) LoadTokenFromString(token string) error

LoadTokenFromString loads and validates an auth token provided directly, such as the VSTR_TOKEN env var injected by the extension into its terminals.

Jump to

Keyboard shortcuts

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