Skip to main content

Module external_credentials

Module external_credentials 

Source
Expand description

Capability-gated I/O for credentials owned by another CLI.

Every external open/read stays behind an opaque grant. Consumption opens one absolute regular file through a no-follow traversal, validates that same handle, and reads a bounded payload from it. This prevents a consented path from being redirected through a leaf or parent symlink/reparse point and avoids the old exists-then-read race.

Functions§

read_codewhale_owned_to_string
Read one Codewhale-owned credential file through the same no-follow, bounded I/O boundary used for external grants. On Unix the opened handle must belong to the effective user and have no group/other permission bits. The caller is responsible for constraining path to a validated basename below Codewhale’s credentials directory before invoking this function.
read_to_string
Open and read the exact granted file once. Missing files are reported as Ok(None); every other unsafe or malformed filesystem shape fails closed.