Skip to content

Commit 2dd35d1

Browse files
committed
docs: sync documentation after cipherstash-client 0.34 upgrade
Fix stale references across project documentation identified by dual-verification review: - CLAUDE.md: fix non-existent directory refs (encrypt/ → proxy/zerokms/, eql/ → proxy/encrypt_config/), add [env] header to mise snippet, remove disabled Elixir from test list, clarify check description - errors.md: fix ZeroKMS anchor mismatch (broken production help link), update UnsupportedParameterType message, fix TOC (duplicate entry, double-encrypt link, missing ZeroKMS entry), add MissingEncryptConfiguration and UnexpectedSetKeyset sections - CHANGELOG.md: add missing v2.1.21/v2.1.22 link definitions, update Unreleased compare link, add cipherstash-client upgrade entry
1 parent 32a15c6 commit 2dd35d1

File tree

7 files changed

+101
-18
lines changed

7 files changed

+101
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
99
### Changed
1010

1111
- **Log target renamed**: `KEYSET` log target renamed to `ZEROKMS`. The environment variable `CS_LOG__KEYSET_LEVEL` is now `CS_LOG__ZEROKMS_LEVEL`.
12+
- **Dependency upgrade**: Updated `cipherstash-client` from 0.33.2 to 0.34.0-alpha.4 with new `ZeroKMSBuilder` API and `AutoStrategy` authentication.
1213

1314
### Removed
1415

@@ -247,7 +248,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
247248
- Integration with CipherStash ZeroKMS.
248249
- Encrypt Query Language (EQL) for indexing and searching encrypted data.
249250

250-
[Unreleased]: https://github.com/cipherstash/proxy/compare/v2.1.20...HEAD
251+
[Unreleased]: https://github.com/cipherstash/proxy/compare/v2.1.22...HEAD
252+
[2.1.22]: https://github.com/cipherstash/proxy/releases/tag/v2.1.22
253+
[2.1.21]: https://github.com/cipherstash/proxy/releases/tag/v2.1.21
251254
[2.1.20]: https://github.com/cipherstash/proxy/releases/tag/v2.1.20
252255
[2.1.9]: https://github.com/cipherstash/proxy/releases/tag/v2.1.9
253256
[2.1.8]: https://github.com/cipherstash/proxy/releases/tag/v2.1.8

CLAUDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Key capabilities:
1818

1919
**Core Proxy (`packages/cipherstash-proxy/`):**
2020
- `postgresql/` - PostgreSQL wire protocol implementation, message parsing, and client handling
21-
- `encrypt/` - Integration with CipherStash ZeroKMS for key management and encryption operations
21+
- `proxy/zerokms/` - ZeroKMS client initialization and key management
2222
- `config/` - Configuration management for database connections, TLS, and encryption settings
23-
- `eql/` - EQL v2 types and encryption abstractions
23+
- `proxy/encrypt_config/` - Encryption configuration and schema management
2424

2525
**EQL Mapper (`packages/eql-mapper/`):**
2626
- SQL parsing and type inference engine
@@ -29,7 +29,7 @@ Key capabilities:
2929

3030
**Integration Tests (`packages/cipherstash-proxy-integration/`):**
3131
- Comprehensive test suite covering encryption scenarios
32-
- Language-specific integration tests (Python, Go, Elixir)
32+
- Language-specific integration tests (Python, Go)
3333

3434
**Showcase (`packages/showcase/`):**
3535
- Healthcare data model demonstrating EQL v2 encryption
@@ -76,7 +76,7 @@ mise run reset
7676
# Full test suite (hygiene + unit + integration)
7777
mise run test
7878

79-
# Hygiene checks only
79+
# Hygiene checks (compilation, formatting, clippy)
8080
mise run check
8181

8282
# Unit tests only
@@ -111,6 +111,7 @@ mise run postgres:down
111111
### Authentication & Encryption
112112
Proxy requires CipherStash credentials configured in `mise.local.toml`:
113113
```toml
114+
[env]
114115
CS_WORKSPACE_CRN = "crn:region:workspace-id"
115116
CS_CLIENT_ACCESS_KEY = "your-access-key"
116117
CS_DEFAULT_KEYSET_ID = "your-keyset-id"

Cargo.lock

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/errors.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Authentication errors:
66
- [Database](#authentication-failed-database)
77
- [Client](#authentication-failed-client)
8+
- [ZeroKMS](#zerokms-authentication-failed)
89

910
- Mapping errors:
1011
- [Invalid parameter](#mapping-invalid-parameter)
@@ -15,8 +16,7 @@
1516

1617
- Encrypt errors:
1718
- [Column could not be encrypted](#encrypt-column-could-not-be-encrypted)
18-
- [Column could not be encrypted](#encrypt-column-could-not-be-encrypted)
19-
- [Could not decrypt data for keyset](#encrypt-encrypt-could-not-decrypt-data-for-keyset)
19+
- [Could not decrypt data for keyset](#encrypt-could-not-decrypt-data-for-keyset)
2020
- [KeysetId could not be parsed](#encrypt-keyset-id-could-not-be-parsed)
2121
- [KeysetId could not be set](#encrypt-keyset-id-could-not-be-set)
2222
- [KeysetName could not be set](#encrypt-keyset-name-could-not-be-set)
@@ -26,6 +26,8 @@
2626
- [Unknown table](#encrypt-unknown-table)
2727
- [Unknown index term](#encrypt-unknown-index-term)
2828
- [Column configuration mismatch](#encrypt-column-config-mismatch)
29+
- [Missing encrypt configuration](#encrypt-missing-encrypt-configuration)
30+
- [Unexpected SET keyset](#encrypt-unexpected-set-keyset)
2931

3032
- Decrypt errors:
3133
- [Column could not be deserialised](#encrypt-column-could-not-be-deserialised)
@@ -91,7 +93,7 @@ Client authentication failed. Check username and password.
9193
<!-- ---------------------------------------------------------------------------------------------------- -->
9294

9395

94-
## ZeroKMS <a id='authentication-failed-zerokms'></a>
96+
## ZeroKMS <a id='zerokms-authentication-failed'></a>
9597

9698
Authentication failed when connecting to ZeroKMS.
9799

@@ -184,7 +186,7 @@ The parameter type is not supported.
184186
### Error message
185187

186188
```
187-
Encryption of PostgreSQL {name} (OID {oid}) types is not currently supported.
189+
Encryption of EQL column {column_type} using strategy {eql_term} is not supported.
188190
```
189191

190192
### How to fix
@@ -577,6 +579,41 @@ If the error persists, please contact CipherStash [support](https://cipherstash.
577579
<!-- ---------------------------------------------------------------------------------------------------- -->
578580

579581

582+
## Missing encrypt configuration <a id='encrypt-missing-encrypt-configuration'></a>
583+
584+
The encrypted column type does not have a matching encrypt configuration.
585+
586+
587+
### Error message
588+
589+
```
590+
Missing encrypt configuration for column type `{plaintext_type}`.
591+
```
592+
593+
### How to fix
594+
595+
1. Define the encrypted configuration for the column type using [EQL](https://github.com/cipherstash/encrypt-query-language).
596+
2. If this error persists, please contact CipherStash [support](https://cipherstash.com/support) as this may indicate a bug.
597+
598+
599+
<!-- ---------------------------------------------------------------------------------------------------- -->
600+
601+
602+
## Unexpected SET keyset <a id='encrypt-unexpected-set-keyset'></a>
603+
604+
A `SET CIPHERSTASH.KEYSET` statement was used when a default keyset has already been configured.
605+
606+
607+
### Error message
608+
609+
```
610+
Cannot SET CIPHERSTASH.KEYSET if a default keyset has been configured.
611+
```
612+
613+
### How to fix
614+
615+
1. Remove the `SET CIPHERSTASH.KEYSET` statement from your application code.
616+
2. Or remove the `default_keyset_id` from the proxy configuration to allow dynamic keyset selection.
580617

581618

582619
<!-- ---------------------------------------------------------------------------------------------------- -->

packages/cipherstash-proxy/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ tracing-subscriber = { workspace = true }
5757
uuid = { version = "1.11.0", features = ["serde", "v4"] }
5858
vitaminc-protected = "0.1.0-pre4.2"
5959
x509-parser = "0.17.0"
60+
url = "2.5.8"
6061

6162

6263
[dev-dependencies]

packages/cipherstash-proxy/src/config/tandem.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ pub struct DevelopmentConfig {
6767

6868
#[serde(default)]
6969
pub enable_mapping_errors: bool,
70+
71+
#[serde(default)]
72+
pub zerokms_host: Option<String>,
73+
74+
#[serde(default)]
75+
pub cts_host: Option<String>,
7076
}
7177

7278
/// Config defaults to a file called `tandem` in the current directory.
@@ -252,6 +258,18 @@ impl TandemConfig {
252258
}
253259
}
254260

261+
pub fn zerokms_host(&self) -> Option<String> {
262+
self.development
263+
.as_ref()
264+
.and_then(|dev| dev.zerokms_host.clone())
265+
}
266+
267+
pub fn cts_host(&self) -> Option<String> {
268+
self.development
269+
.as_ref()
270+
.and_then(|dev| dev.cts_host.clone())
271+
}
272+
255273
pub fn use_structured_logging(&self) -> bool {
256274
matches!(self.log.format, LogFormat::Structured)
257275
}

packages/cipherstash-proxy/src/proxy/zerokms/mod.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ use cipherstash_client::{
99
zerokms::{ClientKey, ZeroKMSBuilder},
1010
AutoStrategy, ZeroKMS,
1111
};
12+
use url::Url;
1213

1314
pub type ScopedCipher = cipherstash_client::encryption::ScopedCipher<AutoStrategy>;
1415

1516
pub type ZerokmsClient = ZeroKMS<AutoStrategy, ClientKey>;
1617

1718
pub(crate) fn init_zerokms_client(config: &TandemConfig) -> Result<ZerokmsClient, Error> {
19+
if config.cts_host().is_some() {
20+
tracing::warn!(
21+
target: "config",
22+
"development.cts_host is configured but no longer supported. \
23+
CTS endpoint is now resolved automatically from credentials. \
24+
Remove development.cts_host from your configuration."
25+
);
26+
}
27+
1828
let strategy = AutoStrategy::builder()
1929
.with_access_key(&config.auth.client_access_key)
2030
.with_workspace_crn(config.auth.workspace_crn.clone())
@@ -26,6 +36,17 @@ pub(crate) fn init_zerokms_client(config: &TandemConfig) -> Result<ZerokmsClient
2636

2737
let client_key = config.encrypt.build_client_key()?;
2838

29-
let builder = ZeroKMSBuilder::new(strategy);
39+
let mut builder = ZeroKMSBuilder::new(strategy);
40+
41+
if let Some(zerokms_host) = config.zerokms_host() {
42+
let url = Url::parse(&zerokms_host).map_err(|_| {
43+
Error::from(crate::error::ConfigError::InvalidParameter {
44+
name: "development.zerokms_host".to_string(),
45+
value: zerokms_host,
46+
})
47+
})?;
48+
builder = builder.with_base_url(url);
49+
}
50+
3051
Ok(builder.with_client_key(client_key).build()?)
3152
}

0 commit comments

Comments
 (0)