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 ¶
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 ¶
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 ¶
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 ¶
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.