agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
47 lines • 2.22 kB
JavaScript
;
/**
* hosting/signin/types — the sign-in: what the server keeps about a person who
* proved who they are through a browser, and the two ports around it.
*
* A sign-in is the SERVER's record. The browser holds only a random value in
* an `HttpOnly` cookie; the store is keyed by that value's SHA-256 (the
* **sign-in key**), so a leaked store row is not a live cookie, and the key the
* transport hands onward cannot be turned back into one.
*
* Two ports, because two different parties need two different things:
*
* - {@link SignInStore} — where sign-ins are KEPT. Four verbs, no policy. An
* in-memory adapter ships (`memorySignIns`); a shared one (a database) is an
* app adapter behind the same four verbs.
* - {@link SignInSource} — what a DOOR asks: "who is behind this key, right
* now?" Lifetimes live here, not in the store (`signInSource`), so a store
* never decides whether a sign-in is still good.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedirectSignInError = exports.SIGN_IN_COOKIE_LOCALHOST = exports.SIGN_IN_COOKIE = void 0;
/**
* The sign-in cookie's name. `__Host-` makes the browser refuse it unless it is
* `Secure`, has `Path=/` and no `Domain` — so a sibling host cannot plant one —
* and `__Host-Http-` additionally refuses one set by script (RFC 10017
* §6.1.3.2). A browser that does not know the newer prefix still enforces
* `__Host-`, because the name starts with it.
*/
exports.SIGN_IN_COOKIE = '__Host-Http-af-signin';
/**
* The cookie's name on plain-`http` localhost, where the browser would refuse
* the `__Host-` prefix (it requires `Secure`). Development only: the
* sign-in door refuses it in production.
*/
exports.SIGN_IN_COOKIE_LOCALHOST = 'af-signin';
/** A callback that did not sign anybody in. Carries a reason CODE only. */
class RedirectSignInError extends Error {
code = 'ERR_REDIRECT_SIGN_IN';
reason;
constructor(reason) {
super(`[hosting] the sign-in did not complete (${reason}).`);
this.name = 'RedirectSignInError';
this.reason = reason;
}
}
exports.RedirectSignInError = RedirectSignInError;
//# sourceMappingURL=types.js.map