Expand description
Profile-root resolution + name validation.
Root: $XDG_DATA_HOME/afhttp/profiles/ (or $HOME/.local/share/afhttp/profiles/).
Persistent profiles are scoped by backend family under
<root>/<backend>/<name>.
Name validation rejects anything that would escape the root or break
filesystem traversal.
Constants§
Functions§
- default_
root - Resolve the default profile root.
- ensure_
backend_ dir - ensure_
no_ filesystem_ collision - Ensure that
<root>/<name>either does not exist or is already a directory. Rejects the case where a regular file or symlink occupies the slot —afhttp host --profile fooshould not silently start over a non-directory entry the user (or another tool) put there. - join_
root_ backend_ name - join_
root_ name - Join the root + name into a concrete profile directory path. Performs
structural validation only; callers that touch the filesystem should
also run
ensure_no_filesystem_collision. - validate_
backend_ key - validate_
name - Validate a profile name. Allowed: ASCII alphanumerics plus
-,_,.(but never starting with.), max 64 chars. Rejects Windows reserved device names so a profile created on Linux cannot become a poisoned path when the directory is read on Windows.