Skip to content

Commit 3bd9dde

Browse files
committed
docs: fix 25 documentation issues found by dual-verification review
Correct blocking issues across 15 documentation files: - Fix TLS example TOML field names to match serde model (certificate_path/private_key_path) - Fix incorrect passwords in Go test README and DEVELOPMENT.md - Fix broken relative links in how-to guide and message-flow SVG references - Fix CHANGELOG Prometheus metric name (cache_hit → cache_hits) - Add missing Prometheus metrics to reference table - Fix supported architectures to include both arm64 and amd64 - Fix LICENSE link, port convention typo, callout syntax - Fix searchable-json operator direction, malformed JSON, and remove duplicate section - Add .env.proxy.docker credential template to README getting-started - Fill in "Running Proxy locally" TODO section - Clarify cipher_cache_size, mapping_errors_enabled env var, and language test paths - Update ARCHITECTURE.md package tree with missing directories
1 parent 2dd35d1 commit 3bd9dde

File tree

15 files changed

+72
-119
lines changed

15 files changed

+72
-119
lines changed

ARCHITECTURE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ packages/
214214
│ │ ├── parser.rs # SQL parsing entry point
215215
│ │ └── context/ # Session state (statements, portals, metadata)
216216
│ ├── proxy/ # Encryption service, schema management, config
217-
│ └── config/ # Configuration parsing
217+
│ ├── config/ # Configuration parsing
218+
│ ├── cli/ # CLI argument parsing
219+
│ ├── connect/ # Database connection management
220+
│ ├── tls/ # TLS configuration and setup
221+
│ └── log/ # Logging targets and configuration
218222
├── eql-mapper/ # SQL type inference and transformation
219223
│ └── src/
220224
│ ├── inference/ # Type inference engine

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1717

1818
### Added
1919

20-
- **Cipher cache miss metric**: New Prometheus counter `cipherstash_proxy_keyset_cipher_cache_miss_total` tracks cache misses requiring cipher initialization. This complements the `cipherstash_proxy_keyset_cipher_cache_hit_total` metric, and can be used to calculate cache hit/miss ratio.
20+
- **Cipher cache miss metric**: New Prometheus counter `cipherstash_proxy_keyset_cipher_cache_miss_total` tracks cache misses requiring cipher initialization. This complements the `cipherstash_proxy_keyset_cipher_cache_hits_total` metric, and can be used to calculate cache hit/miss ratio.
2121
- **Cipher init duration metric**: New Prometheus histogram `cipherstash_proxy_keyset_cipher_init_duration_seconds` tracks cipher initialization time including ZeroKMS network calls.
2222
- **Encrypt/decrypt timing**: Debug logs for `encrypt_eql` and `decrypt_eql` now include `duration_ms`.
2323
- **Cache eviction logging**: ScopedCipher cache eviction events are now logged under the `ZEROKMS` target.

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Key capabilities:
2929

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

3436
**Showcase (`packages/showcase/`):**

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ For more information see the [Code of Conduct FAQ](./CODE_OF_CONDUCT.md) or cont
3838

3939
## Licensing
4040

41-
See the [LICENSE](./LICENSE) file for our project's licensing.
41+
See the [LICENSE](./LICENSE.md) file for our project's licensing.

DEVELOPMENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ To use a different version of EQL, set the path to the desired EQL release file
427427

428428
PostgreSQL port numbers are 4 digits:
429429

430-
- The first two digits denote non-TLS (`55`) or non-TLS (`56`)
430+
- The first two digits denote non-TLS (`55`) or TLS (`56`)
431431
- The last two digits denote the version of PostgreSQL
432432

433433
PostgreSQL latest always runs on `5532`.
@@ -470,7 +470,7 @@ All containers use the same credentials and database, defined in `tests/pg/commo
470470
POSTGRES_DB="cipherstash"
471471
POSTGRES_USER="cipherstash"
472472
PGUSER="cipherstash"
473-
POSTGRES_PASSWORD="password"
473+
POSTGRES_PASSWORD="p@ssword"
474474
```
475475

476476
PostgreSQL configuration files live at:
@@ -496,7 +496,7 @@ Environment files:
496496

497497
If you ever get confused about where your configuration is coming from, run `mise cfg` to get a list of config files in use.
498498

499-
Certificates are generated by `mkcert`, and live in `tests/tls/`.
499+
Certificates are generated by `openssl`, and live in `tests/tls/`.
500500

501501

502502
#### Configuration: development endpoints

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ cd proxy
6868
# Sign up, create a workspace, and generate credentials
6969
# Visit: https://dashboard.cipherstash.com/sign-up
7070

71-
# Put credentials in .env.proxy.docker
72-
# Copy the credentials from the dashboard and paste them into .env.proxy.docker using your preferred text editor.
73-
nano .env.proxy.docker
71+
# Create .env.proxy.docker with your CipherStash credentials
72+
# Replace the placeholder values with your actual credentials from the dashboard
73+
cat > .env.proxy.docker << 'EOF'
74+
CS_WORKSPACE_CRN=crn:...your-workspace-crn...
75+
CS_CLIENT_ACCESS_KEY=your-client-access-key
76+
CS_ENCRYPT__DEFAULT_KEYSET_ID=your-keyset-id
77+
CS_ENCRYPT__CLIENT_ID=your-client-id
78+
CS_ENCRYPT__CLIENT_KEY=your-client-key
79+
EOF
7480

7581
# Start the containers
7682
docker compose up

cipherstash-proxy-example.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[tls]
2-
type = "Path" # To provide paths to PEM files
3-
certificate = "tests/tls/server.cert"
4-
private_key = "tests/tls/server.key"
2+
certificate_path = "tests/tls/server.cert"
3+
private_key_path = "tests/tls/server.key"
54

6-
# type = "Pem" # To directly provide PEM contents
7-
# certificate = """-----BEGIN CERTIFICATE-----
5+
# To directly provide PEM contents:
6+
# certificate_pem = """-----BEGIN CERTIFICATE-----
87
# ...your certificate content here...
98
# -----END CERTIFICATE-----
109
# """
11-
# private_key = """-----BEGIN PRIVATE KEY-----
10+
# private_key_pem = """-----BEGIN PRIVATE KEY-----
1211
# ...your private key content here...
1312
# -----END PRIVATE KEY-----
1413
# """

docs/errors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ When `mapping_errors_enabled` is `false` (the default), then type check errors a
220220

221221
When `mapping_errors_enabled` is `true`, then type check errors are raised, and statement execution halts.
222222

223+
Configure this setting with the environment variable `CS_DEVELOPMENT__ENABLE_MAPPING_ERRORS` or in the TOML config file under `[development] enable_mapping_errors = true`.
224+
223225
In our experience, most production systems have a relatively small number of columns that require protection.
224226
As SQL is large and complex, instead of blocking statements with type check errors that are false negatives, the default behaviour of Proxy is to allow the statement.
225227

docs/how-to/index.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
```
5959
6060
61-
For a fully-working example, go to [`docker-compose.yml`](./docker-compose.yml).
61+
For a fully-working example, go to [`docker-compose.yml`](../../docker-compose.yml).
6262
Follow the steps in [Getting started](../README.md#getting-started) to see it in action.
6363

6464
Once you have set up a `docker-compose.yml`, start the Proxy container:
@@ -132,7 +132,27 @@ Read the full list of configuration options and what they do in the [reference d
132132

133133
## Running Proxy locally
134134

135-
TODO: Add instructions for running Proxy locally
135+
To run CipherStash Proxy locally for development:
136+
137+
```bash
138+
# Install prerequisites
139+
mise trust --yes && mise install
140+
141+
# Start PostgreSQL and install EQL
142+
mise run postgres:up --extra-args "--detach --wait"
143+
mise run postgres:setup
144+
145+
# Run Proxy as a local process
146+
mise run proxy
147+
```
148+
149+
Alternatively, run Proxy in a container:
150+
151+
```bash
152+
mise run proxy:up --extra-args "--detach --wait"
153+
```
154+
155+
See [Configuring Proxy](#configuring-proxy) for required environment variables and configuration options.
136156

137157
## Setting up the database schema
138158

@@ -223,14 +243,14 @@ The first SQL statement adds a `match` index, which is used for partial matches
223243
The second SQL statement adds an `ore` index, which is used for ordering with `ORDER BY`.
224244

225245

226-
> ![IMPORTANT]
246+
> [!IMPORTANT]
227247
> Adding, updating, or deleting encrypted indexes on columns that already contain encrypted data will not re-index that data. To use the new indexes, you must `SELECT` the data out of the column, and `UPDATE` it again.
228248

229249
To learn how to use encrypted indexes for other encrypted data types like `text`, `int`, `boolean`, `date`, and `jsonb`, see the [EQL documentation](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/reference/INDEX.md).
230250

231251
When deploying CipherStash Proxy into production environments with real data, we recommend that you apply these database schema changes with the normal tools and process you use for making changes to your database schema.
232252

233-
To see more examples of how to modify your database schema, check out [the example schema](./sql/schema-example.sql) from [Getting started](#getting-started).
253+
To see more examples of how to modify your database schema, check out [the example schema](../sql/schema-example.sql) from [Getting started](#getting-started).
234254

235255
## Encrypting data in an existing database
236256

docs/reference/index.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This page contains reference documentation for configuring CipherStash Proxy and
1616

1717
## Proxy config options
1818

19-
You can configure CipherStash Proxy with a config file, enviroment variables, or a combination of the two – see [Configuring Proxy](#configuring-proxy) for instructions.
19+
You can configure CipherStash Proxy with a config file, environment variables, or a combination of the two – see [Configuring Proxy](#configuring-proxy) for instructions.
2020

2121
The following are all the configuration options available for Proxy, with their equivalent environment variables:
2222

@@ -29,7 +29,7 @@ The following are all the configuration options available for Proxy, with their
2929
# Env: CS_SERVER__HOST
3030
host = "0.0.0.0"
3131

32-
# Proxy host posgt
32+
# Proxy host port
3333
# Optional
3434
# Default: `6432`
3535
# Env: CS_SERVER__PORT
@@ -60,8 +60,8 @@ worker_threads = "4"
6060
# Env: CS_SERVER__THREAD_STACK_SIZE
6161
thread_stack_size = "2097152"
6262

63-
# Cipher cache size (number of entries)
64-
# Sets the maximum number of encryption/decryption operations to cache
63+
# Cipher cache size (number of keyset-scoped ciphers)
64+
# Sets the maximum number of keyset-scoped ciphers to cache (internal sizing is calculated per entry)
6565
# Optional
6666
# Default: `64`
6767
# Env: CS_SERVER__CIPHER_CACHE_SIZE
@@ -82,7 +82,7 @@ cipher_cache_ttl_seconds = "3600"
8282
# Env: CS_DATABASE__HOST
8383
host = "0.0.0.0"
8484

85-
# Database host post
85+
# Database host port
8686
# Optional
8787
# Default: `5432`
8888
# Env: CS_DATABASE__PORT
@@ -199,7 +199,7 @@ format = "pretty"
199199
# Log format
200200
# Optional
201201
# Valid values: `stdout | stderr`
202-
# Default: `info`
202+
# Default: `stdout`
203203
# Env: CS_LOG__OUTPUT
204204
output = "stdout"
205205

@@ -238,7 +238,7 @@ slow_db_response_min_duration_ms = "100"
238238
# Env: CS_PROMETHEUS__ENABLED
239239
enabled = "false"
240240

241-
# Prometheus exporter post
241+
# Prometheus exporter port
242242
# Optional
243243
# Default: `9930`
244244
# Env: CS_PROMETHEUS__PORT
@@ -562,6 +562,8 @@ If the proxy is running on a host other than localhost, access on that host.
562562
| `cipherstash_proxy_statements_session_duration_seconds_sum` | Count | Total time CipherStash Proxy spent processing SQL statements |
563563
| `cipherstash_proxy_statements_encrypted_total` | Counter | Number of SQL statements that required encryption |
564564
| `cipherstash_proxy_statements_passthrough_total` | Counter | Number of SQL statements that did not require encryption |
565+
| `cipherstash_proxy_statements_passthrough_mapping_disabled_total` | Counter | Number of SQL statements passed through because mapping was disabled |
566+
| `cipherstash_proxy_slow_statements_total` | Counter | Number of SQL statements that exceeded the slow statement threshold |
565567
| `cipherstash_proxy_statements_total` | Counter | Total number of SQL statements processed by CipherStash Proxy |
566568
| `cipherstash_proxy_statements_unmappable_total` | Counter | Total number of unmappable SQL statements processed by CipherStash Proxy |
567569

@@ -629,9 +631,9 @@ rate(cipherstash_proxy_keyset_cipher_cache_hits_total[5m])
629631

630632
## Supported architectures
631633

632-
CipherStash Proxy is [available as a Docker container image](https://hub.docker.com/r/cipherstash/proxy) for `linux/arm64` architectures.
634+
CipherStash Proxy is [available as a Docker container image](https://hub.docker.com/r/cipherstash/proxy) for `linux/arm64` and `linux/amd64` architectures.
633635

634-
If you're interested in a Docker image for other architectures (like `linux/amd64`), upvote [this idea](https://github.com/cipherstash/proxy/discussions/214).
636+
For other architecture requests, see [this discussion](https://github.com/cipherstash/proxy/discussions/214).
635637

636638

637639

0 commit comments

Comments
 (0)