/** The legacy tree documents EQL v2 throughout; only the v2 IA must be v3-only. */
constV3_SCOPE=["content/docs/"];
constRULES: Rule[]=[
{
id: "lockcontext-identify",
pattern: /\.identify\s*\(/,
message:
"`LockContext.identify()` is deprecated. Per-operation CTS tokens were removed in protect-ffi 0.25; the token it fetches no longer affects encryption.",
fix: 'Authenticate the client with `OidcFederationStrategy` via `config.authStrategy`, then pass the claim to `.withLockContext({ identityClaim: ["sub"] })`.',
scope: IDENTITY_SCOPE,
},
{
id: "identity-token-option",
pattern: /identityToken\s*:/,
message:
"`withLockContext({ identityToken })` has never existed in any released version of @cipherstash/stack.",
fix: 'Use `.withLockContext({ identityClaim: ["sub"] })` on the operation, not on the client.',
scope: IDENTITY_SCOPE,
},
{
id: "bare-lockcontext-constructor",
pattern: /new\s+LockContext\s*\(\s*\)/,
message:
"A bare `new LockContext()` is only useful with the deprecated `identify()` flow.",
fix: 'Pass a plain `{ identityClaim: ["sub"] }` to `.withLockContext()`. The Supabase query builder still requires an instance: `new LockContext({ context: { identityClaim: ["sub"] } })`.',
scope: IDENTITY_SCOPE,
},
{
id: "eql-v2-encrypted-type",
pattern: /\beql_v2_encrypted\b/,
message: "The `eql_v2_encrypted` column type was removed in EQL 3.0.0.",
fix: "Type the column with an EQL v3 domain variant, e.g. `public.text_eq`. See /reference/eql/core-concepts.",
scope: V3_SCOPE,
},
{
id: "eql-v2-schema-functions",
pattern: /\beql_v2\.\w+\s*\(/,
message: "The `eql_v2` schema was removed in EQL 3.0.0.",
fix: "Use the `eql_v3` equivalents, or the encrypted operators directly with a typed operand.",