/** * The umbrella brand and the names for every resource the installer creates in * (or for) an Ory project. Centralized here so every install path — the web * wizard, the TTY wizard, and the agent-identity gates — produces the same, * self-describing names, and so the naming policy lives in one place. * * The policy has two tiers, because many users install these plugins against * the **same** Ory project: * * - **Shared** resources (one per project, reused by every user/harness) are * addressed by a **stable, reserved identifier** so all installs find and * reuse the one resource instead of duplicating it: the login client's * {@link USER_LOGIN_CLIENT_ID} and the permission namespace * ({@link PERMISSION_NAMESPACE}). An identifier, not a display name — see * {@link USER_LOGIN_CLIENT_ID} for why the distinction is a security * property and not a preference. * - **Per-installer** resources (many per project by design — confidential * per-machine DCR credentials, write-once API keys) get an **attributable** * name carrying *who* and *where*, so a shared project's resource list stays * legible and prunable: {@link agentClientName}, {@link projectApiKeyName}. * * Display names stay short because the Console already provides the resource * type and project context around them. */ /** Human-readable umbrella name for everything this product creates. */ export declare const PRODUCT_NAME = "Ory Agent Security"; /** * The **reserved client id** of the shared user-login OAuth2 client — the one * thing that identifies it. Every provisioning path (Ory Console setup, the * local-dev Hydra seed) creates the client *at this id*, and every lookup * addresses it by this id, so all of them converge on one client. * * It is an id rather than a name for a security reason. A project set up for * Agent Security has public dynamic client registration enabled, and Hydra's DCR * endpoint places no restriction on `client_name` — so anyone can register a * client carrying {@link USER_LOGIN_CLIENT_NAME} verbatim with their own * `redirect_uris`, and a name-based lookup can resolve to it (Hydra lists * clients ordered by id, so re-registering until the assigned UUID sorts first * is roughly a coin flip). Whoever then installs a plugin would complete a PKCE * login — `offline_access` included — against the attacker's client. A * `client_id` is not forgeable the same way: Hydra assigns a fresh UUID to a * dynamically registered client and refuses a caller-chosen one, so only a * caller holding the project's admin credentials can claim this id. * * There is deliberately **no name-based fallback** anywhere: a fallback reopens * exactly that hole. */ export declare const USER_LOGIN_CLIENT_ID = "ory-agent-security-login"; /** * The **display name** of the shared user-login client — a human-readable label * for the Ory Console's client list, and nothing more. It is a *public* client * (no secret) that every user on a project shares across every harness plugin, * and the name says so plainly; no "PKCE" in it, since how it authenticates is * an implementation detail, not what it is. * * Never resolve the client by this string. It is attacker-supplyable (see * {@link USER_LOGIN_CLIENT_ID}); {@link USER_LOGIN_CLIENT_ID} is what dedupes * installs onto one client, and {@link isUserLoginClient} is the only accepted * test for "is this the login client". */ export declare const USER_LOGIN_CLIENT_NAME = "Agent Security login"; /** * Whether a client is *the* shared user-login client, decided **only** by its * id. A client carrying {@link USER_LOGIN_CLIENT_NAME} under any other id is * some other client — possibly one an attacker registered — and is rejected. */ export declare function isUserLoginClient(client: { clientId?: string; clientName?: string; }): boolean; /** * The single source of truth for the interactive user-login OAuth2 scopes. * Every place that registers the client (`ory create/update oauth2-client`, * the local-dev Hydra seed, the manual-setup help) and the PKCE flow that * requests them must agree, or the flow fails with `invalid_scope` (or the * requested scope is silently dropped). `openid`/`offline_access` are the * baseline; `profile`/`email` populate the id_token's name claims so the * signed-in user can be shown by name. */ export declare const USER_LOGIN_BASE_SCOPES: readonly ["openid", "offline_access"]; export declare const USER_LOGIN_SCOPES: readonly string[]; /** Space-delimited form for an OAuth2 `authorize` request / Hydra client `scope`. */ export declare const USER_LOGIN_SCOPE_OAUTH: string; /** Comma-delimited form for the `ory … oauth2-client --scope` CLI flag. */ export declare const USER_LOGIN_SCOPE_CLI: string; /** Default name for a project the installer creates. Harness-agnostic, since a * team typically points several harnesses at one shared project. */ export declare const DEFAULT_PROJECT_NAME = "Ory Agent Security"; /** The shared permission-model namespace (an OPL class name, so it must stay a * bare identifier — no spaces/branding — and stable across installs). */ export declare const PERMISSION_NAMESPACE = "AgentTool"; /** * The client_name for an agent's (or sub-agent's) OAuth2 identity registered * via DCR. These are confidential, per-machine credentials — many per shared * project by design — so the name is attributable: the harness it belongs to * and the host it was registered from, plus a short session label and the * sub-agent type when applicable. */ export declare function agentClientName(opts: { harness?: string; host: string; subAgentType?: string; sessionId?: string; }): string; /** * A short, stable label for a session id, for **display only** — `status` * output and log lines. Ids are usually UUIDs; the leading characters separate * them well enough for a human scanning a list, and the full id is always * recoverable from the delegation record and activity events. * * Never use this to build a permission subject. A derived session subject must * carry the full session id (`Agent:|`) so it matches what an * admin writes in the Console after reading the same id off the delegation graph. */ export declare function shortSessionLabel(sessionId: string): string; /** * The name for a project API key minted for runtime permission checks. Ory only * returns a key's secret at creation, so a key can't be reused across machines * — each installer that mints one gets its own. The name therefore carries the * signed-in *user* (the axis that matters on a shared project) plus the host, so * a team admin can tell whose key is whose and prune stale ones. No timestamp: * the Ory Console's key listing already shows a "Date Added" column. `user` * falls back to the host alone when it isn't resolvable (e.g. login skipped). */ export declare function projectApiKeyName(opts: { host: string; user?: string; }): string;