fle-scala
Field-Level Encryption is not supported by the Couchbase Scala SDK — alternatives and workarounds
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Field-Level Encryption is not supported by the Couchbase Scala SDK — alternatives and workarounds
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Couchbase SDK error handling — UnambiguousTimeoutException vs AmbiguousTimeoutException, DocumentNotFoundException, CasMismatchException, DurabilityImpossibleException, SDK debug logging, sdk-doctor connectivity diagnostics, retryable vs non-retryable errors, circuit breaker, error best practices
Couchbase SDK patterns for Rust — CAS optimistic locking, retry on CasMismatch, tokio bulk operations with join_all/FuturesUnordered, atomic counters, sub-document (MutateInSpec/LookupInSpec), array operations, exists, replica reads, touch/getAndTouch, preserve_expiry, error handling
Configure and optimize Couchbase SDK connections in Rust — async/tokio cluster setup, singleton pattern, wait_until_ready, timeouts, KV CRUD (upsert/insert/get/replace/remove), expiry, durability, sub-document operations
SQL++ queries with the Couchbase Rust SDK — scope.query, cluster.query, positional and named parameters, scan consistency, deserializing rows into structs, DML (INSERT/UPDATE/DELETE/UPSERT), MutationState RYOW
Testing Couchbase Rust applications — unit testing with mockall, integration testing with testcontainers-rs, scope/collection isolation
Distributed ACID transactions are not supported by the Couchbase Rust SDK 1.x — alternatives and workarounds
| name | fle-scala |
| summary | Field-Level Encryption is not supported by the Couchbase Scala SDK — alternatives and workarounds |
| description | Field-Level Encryption is not supported by the Couchbase Scala SDK — alternatives and workarounds |
| compatibility | Scala SDK 1.x. FLE not supported. |
| metadata | {"last_verified":"2026-05","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about server-side encryption at rest","skill":"security"}]} |
The Couchbase Scala SDK does not support Field-Level Encryption. There is no CryptoManager API.
Option 1 — Encrypt in application code before writing:
import javax.crypto.{Cipher, SecretKey}
import javax.crypto.spec.{GCMParameterSpec, SecretKeySpec}
import java.util.Base64
def encrypt(plaintext: String, key: SecretKey): String = {
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
val iv = new Array[Byte](12)
new java.security.SecureRandom().nextBytes(iv)
cipher.init(Cipher.ENCRYPT_MODE, key, new GCMParameterSpec(128, iv))
val ciphertext = cipher.doFinal(plaintext.getBytes("UTF-8"))
Base64.getEncoder.encodeToString(iv ++ ciphertext)
}
val doc = ujson.Obj(
"name" -> "Alice",
"ssn" -> encrypt("123-45-6789", secretKey) // store ciphertext
)
collection.upsert("user::alice", doc).get
Option 2 — Use the Java SDK from Scala:
The Java SDK supports FLE via @Encrypted. You can use it from Scala by depending on couchbase-java and couchbase-encryption directly. See fle-java.
Option 3 — Server-side encryption at rest (Couchbase Server 8.x):
See the security skill.