authid

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package authid defines the canonical identifier and containment contract for auth files managed by switchAILocal stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FoldKey

func FoldKey(id string) (string, error)

FoldKey returns a conservative, cross-platform collision key for id. Stores must not persist two distinct auth IDs with the same key. The key is for equality checks only and must never replace the case-preserving auth ID.

func FromFSPath

func FromFSPath(root, path string) (string, error)

FromFSPath converts a path beneath root into a canonical auth ID. Relative paths are interpreted relative to root. Existing parent symlinks are resolved before containment is checked; the final file component is intentionally not followed so deleting a symlink removes the link, not its target. Callers must use the returned ID for subsequent access, never the original path string.

func ToFSPath

func ToFSPath(root, id string) (string, error)

ToFSPath resolves a canonical auth ID beneath root. It rejects an ID whose existing parent components resolve through a symlink to a different ID. Callers that read or mutate the filesystem must still use os.Root with the ID to enforce containment during the operation and prevent symlink races.

func Validate

func Validate(id string) error

Validate checks that id is a canonical, slash-separated relative auth ID. It validates rather than normalizes so malformed spellings cannot silently change the ID. Stores must use FoldKey to reject case-folding and Unicode- normalization collisions against existing IDs before writes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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