Artifact 951d10b7bf9af03c29eacee88ca977c3742a90eb703347636c5a395eefe8fe7a:
- File
src/cred.h
— part of check-in
[38a6005d71]
at
2026-11-18 17:44:16
on branch stage-2
— Plan the credential project and add the credential seam
The credential project holds only sanctioned credentials, runs one authority reached over SSH, and starts after stage 2. pic gets a single function that reads the key from the environment and a wipe helper, so the helper-command source can replace it later without touching callers. (user: dmestas, size: 640) [annotate] [blame] [check-ins using] [more...]
/* pic's only credential code. A credential is fetched into a caller buffer * just before use and wiped right after; it is never journaled, logged or put * in an error message. See docs/credential-project.md for where this goes. */ #ifndef PIC_CRED_H #define PIC_CRED_H #include <stddef.h> /* Fetches the credential NAME (today "anthropic", from ANTHROPIC_API_KEY) * into buf. 0, or -1 with err saying what is missing (never the value). */ int pic_cred_get(const char *name, char *buf, size_t cap, char *err, size_t errcap); /* Overwrites n bytes in a way the compiler may not remove. */ void pic_cred_wipe(void *p, size_t n); #endif