import type { ConnectionOwnership } from "@opengeni/contracts"; import { type AccessGrantAuthorization } from "@opengeni/core"; /** A verified external actor must not enter a native callback that has no * corresponding key/identity reauthorization proof. Remove at an entry point * only when that provider's signed continuation and commit fence are wired. */ export declare function requireLegacyOAuthActor(access: AccessGrantAuthorization): void; /** True only for an exact authenticated managed human. Unknown provenance fails closed. */ export declare function isPersonalConnectionOwnerPrincipal(access: AccessGrantAuthorization): boolean; /** Rejects an OpenGeni-minted machine subject; see the namespace list's rationale. */ export declare function isPersonalConnectionOwnerSubject(subjectId: string): boolean; export declare const PERSONAL_CONNECTION_PRINCIPAL_MESSAGE: string; /** Personal-only connectors cannot degrade to workspace ownership, so they say so exactly. */ export declare function personalOnlyConnectionPrincipalMessage(label: string): string; /** * Rejects a non-human principal before a personal Connection is created. * `label` names a personal-only connector, whose message must not suggest a * workspace-owned alternative that its provider profile forbids. * * This shares that helper's core caller-integrity checks, then additionally * rejects every reserved machine-subject namespace as defence-in-depth. The * sibling guards a self-service authority surface where the caller claims to * *be* the owner (403 "not you"), while this one rejects an ownership *value* * that is unavailable to the caller, alongside `assertOwnershipAllowed`'s * existing 422 convention. */ export declare function assertPersonalConnectionOwnerPrincipal(access: AccessGrantAuthorization, label?: string): void; /** The same fence expressed for a flow that resolves ownership after admission. */ export declare function assertConnectionOwnershipAllowedForPrincipal(ownership: ConnectionOwnership, personalOwnershipAllowed: boolean): void; /** * The claim a start path mints into its HMAC-signed OAuth state when it has * verified the live principal may own a personal Connection. * * An OAuth callback carries signed state, not a live principal, so it cannot * re-evaluate `principalKind`. Requiring this claim makes the callback enforce * exactly what the start path decided with the full signal, instead of guessing * from the subject's shape. A state minted before this claim existed simply * lacks it and fails closed for personal ownership - which is precisely the * in-flight rolling-deploy window these fences exist to close. */ export declare const PERSONAL_OWNER_VERIFIED_STATE_CLAIM: "personalOwnerVerified"; /** True only for an explicit boolean `true` claim; absent or malformed fails closed. */ export declare function personalOwnerVerifiedInState(payload: Record): boolean; /** * Callback-side fence for every path that persists a personal owner. Requires * both the signed start-time verification and a non-machine subject. */ export declare function personalOwnerStateAccepted(state: { ownership: ConnectionOwnership; subjectId: string; personalOwnerVerified: boolean; }): boolean;