Documentation
¶
Overview ¶
Package securefile owns atomic publication of permission-sensitive files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StageRootKey ¶
StageRootKey validates a group-readable projected Secret and atomically publishes an owner-only runtime file. Kubernetes applies fsGroup to Secret volumes, which makes the projected source readable by Hikyo's non-root UID; the server still receives the stricter 0400 file required by ReadRootKey.
func WriteAtomic ¶
WriteAtomic writes contents beside path, syncs and closes the file, then atomically replaces path and syncs the directory so the rename is durable. Callers own validation and contextual error text.
func WriteAtomicPrepared ¶
func WriteAtomicPrepared(path string, contents []byte, mode os.FileMode, prepare func(*os.File) error) (returnErr error)
WriteAtomicPrepared is WriteAtomic with a prepare hook that runs on the open temporary file after its mode is set and before any byte is written, so a caller can apply ownership or other attributes that must be in place before publication. A nil prepare is a plain WriteAtomic; a prepare error aborts the publication and removes the temporary file.
Types ¶
This section is empty.