Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
260bd5b
feat(storage): let a vector search carry an item filter
mdeepth Nov 17, 2026
fb47454
feat(core): parse the extended SearchConditionExpression grammar
mdeepth Nov 17, 2026
6506ece
feat(engine): serve the extended search grammar to enabled accounts
mdeepth Nov 17, 2026
a3402e2
test(storage): run the extended search grammar on SQLite and PostgreSQL
mdeepth Nov 17, 2026
e1b10cf
test: cover SearchVectors inequality filters over the wire
mdeepth Nov 17, 2026
3e26169
fix(engine): check the SearchVectors expression maps as the service does
mdeepth Nov 21, 2026
2336a97
fix(core): compare SearchVectors inline filter numbers as binary64
mdeepth Nov 21, 2026
cd5d7cf
test(search): pin the expression maps, binary64 numbers, both grammars
mdeepth Nov 21, 2026
1ea4a1d
test(engine): cover the SearchVectors projection and unused-name wiring
mdeepth Nov 21, 2026
8f98069
test(core): pin exact number comparison in condition expressions
mdeepth Nov 21, 2026
3c15323
fix(core): parse and check search conditions without recursion
mdeepth Nov 23, 2026
9974769
fix(core): reject a search condition name that starts with an underscore
mdeepth Nov 23, 2026
7322ed5
fix(core): accept a parenthesised operand in a search condition
mdeepth Nov 23, 2026
30488c7
fix(core): check search condition function operands by type
mdeepth Nov 23, 2026
856a314
test(core): pin the exact BETWEEN bound check of the search grammar
mdeepth Nov 23, 2026
87b9c2c
refactor(engine): move the search condition dispatch into its own module
mdeepth Nov 23, 2026
f78cd31
fix(engine): read the search filter setting per server, cached, bounded
mdeepth Nov 23, 2026
2787d20
fix(engine): keep equality-only search conditions as equality pairs
mdeepth Nov 23, 2026
a066209
test(engine): pin the search map checks ahead of table and vector checks
mdeepth Nov 23, 2026
3ca3985
fix(storage-postgres): read a filtered vector search in bounded pages
mdeepth Nov 23, 2026
245bca8
test(storage-postgres): pin the paged filtered vector search
mdeepth Nov 23, 2026
0ff1440
test(search): read the grammar setting instead of writing it
mdeepth Nov 23, 2026
cc2850a
ci: build, lint and test the search-inequality-filters feature
mdeepth Nov 23, 2026
81967c4
fix(storage-postgres): cancel an abandoned search in its own transaction
mdeepth Nov 23, 2026
65f496a
fix(engine): send one read of the search filter setting at a time
mdeepth Nov 23, 2026
aac73cb
fix(storage-postgres): bound a settings read on the server
mdeepth Nov 23, 2026
e0da15b
test(engine): read the search filter setting through poisoned locks
mdeepth Nov 23, 2026
e4d2674
test(search): pin the exact BETWEEN bound check on the wire
mdeepth Nov 23, 2026
a866bee
test(search): pin the empty map answer ahead of a missing table
mdeepth Nov 23, 2026
44d2d89
test(search): send deeply nested search conditions on the wire
mdeepth Nov 23, 2026
734e7af
test(search): date the search condition measurements
mdeepth Nov 23, 2026
efae1b7
feat(engine): serve the extended search grammar by default
mdeepth Nov 24, 2026
b65c23f
docs(search): describe the extended grammar as the service serves it
mdeepth Nov 24, 2026
c477e00
test(server): pin SearchVectors dynamodb:Attributes and names map checks
LeeroyHannigan Nov 21, 2026
501ff42
docs(upgrade): record the SearchVectors grammar and map checks of 1.1.0
mdeepth Nov 24, 2026
120d0b1
test(search): pin a bad name ahead of a bad key in the names map
mdeepth Nov 24, 2026
e9f5747
refactor(engine): move the SearchVectors request checks to a module
mdeepth Nov 24, 2026
fda5e7d
fix(engine): use the last read search filter setting through a fault
mdeepth Nov 24, 2026
474a8a1
fix(engine): enable no account for a malformed search filter setting
mdeepth Nov 24, 2026
aa9d69e
fix(app): show the default of the search filter setting
mdeepth Nov 24, 2026
c3320b2
fix(engine): skip the search filter setting when both grammars agree
mdeepth Nov 24, 2026
95c32f4
fix(server): set no dynamodb:Attributes value on SearchVectors
mdeepth Nov 24, 2026
a2196c6
fix(server): check a SearchVectors request before the policy decision
mdeepth Nov 24, 2026
b3f7f54
ci: build and wire-test the search grammar compiled out
mdeepth Nov 24, 2026
514105a
docs(search): correct the condition count and describe setting reads
mdeepth Nov 24, 2026
f73cad8
test(core): pin a too-large attribute name ahead of a bad names key
mdeepth Nov 24, 2026
00aeea2
Merge main into feat/search-inequality-filters
mdeepth Nov 25, 2026
37ae360
refactor(core): check SearchVectors map keys with the shared key check
mdeepth Nov 25, 2026
054ae77
fix(core): share the BETWEEN bound check and show Binary bounds in ba…
mdeepth Nov 25, 2026
81af51b
refactor(core): list unused SearchVectors map keys with one function
mdeepth Nov 25, 2026
4ea1ca3
fix(core): read the SearchVectors size limits from the limits keys
mdeepth Nov 25, 2026
2c1a9d0
test(core): pin the combined size of a search condition at one mebibyte
mdeepth Nov 25, 2026
5be9fca
test(search): pin the doubled name marker and the combined size limit
mdeepth Nov 25, 2026
fa19720
perf(core): size each search condition substitution once
mdeepth Nov 25, 2026
3d8339f
refactor(core): drop the table owner from the search filter setting
mdeepth Nov 25, 2026
646579d
refactor(core): keep the parsed search conditions inside the grammar
mdeepth Nov 25, 2026
0f9943e
refactor(core): define each search schema message once for both grammars
mdeepth Nov 25, 2026
32fa112
docs(core): state what reaches a vector search backend and what recurses
mdeepth Nov 25, 2026
888f75d
fix(auth): match a bare negated operator on SearchVectors attributes
mdeepth Nov 25, 2026
144b338
test(server): name what the deny(null) order rows rest on
mdeepth Nov 25, 2026
e017fba
docs(search): state the check order served and where the grammar was …
mdeepth Nov 25, 2026
06dcace
fix(wasm): serve the extended search grammar in the browser build
mdeepth Nov 25, 2026
2604245
fix(devtools): edit no manifest when the compile-out count is wrong
mdeepth Nov 25, 2026
fc8dbf8
ci: check the search grammar feature state of the browser build
mdeepth Nov 25, 2026
896f02c
ci: run the vector wire tests with the search setting as an account list
mdeepth Nov 25, 2026
8d5d7c2
test(wasm): run the search grammar corpus cases only with the grammar
mdeepth Nov 25, 2026
55da96d
docs(adr): record the search condition grammar, its seam and its gate
mdeepth Nov 25, 2026
096ba91
test(engine): build the unit test engine and context in one place
mdeepth Nov 25, 2026
462aa71
refactor(engine): drop the unused vector search argument of the parse
mdeepth Nov 25, 2026
8d69380
test(engine): move the poisoned lock and log tests of the setting
mdeepth Nov 25, 2026
f88a7d6
fix(engine): send one read of the search filter setting through a change
mdeepth Nov 25, 2026
39c58e1
test(engine): poison the last value lock of the search filter setting
mdeepth Nov 25, 2026
350a0af
fix(storage): bound only the SearchVectors read of a setting
mdeepth Nov 25, 2026
117f63c
fix(engine): send the attribute a parenthesised equality names
mdeepth Nov 25, 2026
e850461
test(core): pin the function and bound messages of a search condition
mdeepth Nov 25, 2026
464f7c4
refactor(core): keep the number precision of the evaluator in the crate
mdeepth Nov 25, 2026
23bceb9
docs(core): state how the service and the FilterExpression parser rea…
mdeepth Nov 25, 2026
d9f8aa2
docs(engine): name the ServiceUnavailable wire type in the setting co…
mdeepth Nov 25, 2026
fd1c06b
fix(engine): wait on a read of the search filter setting only once
mdeepth Nov 25, 2026
62627a8
test(engine): pin the one and two seconds of the search filter setting
mdeepth Nov 25, 2026
e4068ef
test(server): pin that a change of the search filter setting applies …
mdeepth Nov 25, 2026
35f89c8
refactor(storage-postgres): move the bounded setting read to its own …
mdeepth Nov 25, 2026
ee5c63a
fix(storage-postgres): leave a caller's transaction open in a bounded…
mdeepth Nov 25, 2026
f160978
test(storage-postgres): read the session state of the transaction tes…
mdeepth Nov 25, 2026
3f8bc6b
test(storage-postgres): fail the vector search tests without a server…
mdeepth Nov 25, 2026
4cce288
docs(storage-postgres): state what the cancel check of a dropped vect…
mdeepth Nov 25, 2026
eb8564d
fix(build): turn the engine's search grammar off with the server's fe…
mdeepth Nov 25, 2026
cc39a31
fix(devtools): check the browser build's feature state for wasm32 too
mdeepth Nov 25, 2026
f1f902f
docs(devtools): state what run-tests does with the search setting uns…
mdeepth Nov 25, 2026
3abd4be
perf(search): check a SearchVectors request once
mdeepth Nov 25, 2026
e0de13e
fix(server): record the latency segments of a SearchVectors that fail…
mdeepth Nov 25, 2026
242a587
docs(storage): state where each backend applies the search item filter
mdeepth Nov 25, 2026
d508647
docs(search): list every SearchVectors answer the grammar change moves
mdeepth Nov 25, 2026
a56efa8
test(server): read the SearchVectors segments of a new account when i…
mdeepth Nov 25, 2026
df895be
docs(adr): number the search condition grammar decision 0031
mdeepth Nov 25, 2026
bc19a59
docs(upgrade): list the unused-name answer to a parenthesised name
mdeepth Nov 25, 2026
7e6c4b2
Merge main into feat/search-inequality-filters
mdeepth Nov 25, 2026
d1b8b31
fix(server): record a failed SearchVectors check into the bucketed se…
mdeepth Nov 25, 2026
85cca82
test(core): count a substituted name at each of its uses in the searc…
mdeepth Nov 25, 2026
a3a9533
fix(core): saturate the combined size of a search condition
mdeepth Nov 25, 2026
1316c01
docs(core): drop a stray line from the between_bounds_fault comment
mdeepth Nov 25, 2026
148d209
test(engine): run the per-use size row only with the extended grammar
mdeepth Nov 25, 2026
511389f
Merge main into feat/search-inequality-filters
mdeepth Nov 25, 2026
2a57abc
Merge main into feat/search-inequality-filters
mdeepth Nov 26, 2026
8620a60
fix(storage-postgres): pass the filtered search SQL to sqlx 0.9 in As…
mdeepth Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ jobs:
EXTENDDB_ADMIN_PASSWORD: ${{ steps.init.outputs.admin_password }}
EXTENDDB_TEST_PG_ADMIN_CONNECTION_STRING: postgresql://postgres:devpass@127.0.0.1:5432
EXTENDDB_TEST_BACKUP_STORE: filesystem
# pgvector is present, so the SearchVectors suites fail rather than
# skip when the backend refuses vector indexes. The
# search_inequality_filters setting is absent, so they run under the
# extended grammar.
EXTENDDB_EXPECT_VECTORS: "1"
run: devtools/run-tests --extenddb --pytest --comprehensive --terraform --parallel

# run-tests restarts the server daemonized to apply the import/export
Expand Down Expand Up @@ -456,6 +461,11 @@ jobs:
# A file-backed SQLite server without [backup.store] writes to the
# defaulted root beside the database file.
EXTENDDB_TEST_BACKUP_STORE: filesystem
# SQLite serves vector search, so the SearchVectors suites fail
# rather than skip when the backend refuses vector indexes. The
# search_inequality_filters setting is absent, so they run under the
# extended grammar.
EXTENDDB_EXPECT_VECTORS: "1"
run: devtools/run-tests --extenddb --pytest --comprehensive --terraform --parallel

# Same rationale as the postgres job: the daemonized server logs to
Expand Down
168 changes: 168 additions & 0 deletions .github/workflows/search-inequality-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Search inequality filters
on:
pull_request:
merge_group:
push:
branches: [main]

permissions:
contents: read

# Same grouping as the other workflows: a new push to a pull request
# supersedes its in-flight run, and every other run has a group of its own.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

# The search-inequality-filters Cargo feature is on by default, so the other
# workflows build, lint and test it, and their wire tests run with the
# search_inequality_filters setting absent, which gives every account the
# extended grammar. These jobs cover what they do not: the workspace built,
# linted and tested with the feature compiled out, the feature state of the
# browser build, and the vector wire tests with the setting written as `off`
# and as a list of accounts, and against the build with the feature compiled
# out.
#
# The storage crates and core are taken with their default features, so no
# cargo command line compiles the feature out. The workspace takes
# extenddb-engine and extenddb-server with their default features off: the
# server's feature turns on the engine's, the app's turns on the server's,
# and extenddb-wasm-adapter, the browser build, names the feature for the
# engine, core and the SQLite backend itself. devtools/compile-out-search-inequality-filters removes the
# feature from the default list of every crate that declares it, which
# compiles it out of the workspace, and checks that nothing enables it; with
# `--check on` it checks that the browser build enables it on all three.
jobs:
compiled-out:
runs-on: extenddb_ubuntu-2404_4-core
timeout-minutes: 40
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: 1.97.0
components: clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check that the browser build enables the feature on the engine, core and SQLite
run: devtools/compile-out-search-inequality-filters --check on
- name: Compile the feature out
run: devtools/compile-out-search-inequality-filters
- name: Lint the workspace with the feature compiled out
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Unit tests with the feature compiled out
run: |
cargo test --locked --no-fail-fast -p extenddb-core -p extenddb-engine \
-p extenddb-server -p extenddb-app --lib

wire:
runs-on: extenddb_ubuntu-2404_4-core
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
backend: [sqlite, postgres]
# `listed` writes the setting as the test account, which
# devtools/provision-test-credentials creates, and an account the
# tests do not use, so the tests expect the extended grammar from the
# list. The absent setting, which gives every account the grammar, is
# what integration.yml runs.
setting: ["off", listed, compiled-out]
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_PASSWORD: devpass
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
- 127.0.0.1:5432:5432
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Compile the feature out
if: matrix.setting == 'compiled-out'
run: devtools/compile-out-search-inequality-filters

- name: Build release
run: cargo build --locked --release -p extenddb --no-default-features --features ${{ matrix.backend }}

- name: Initialize ExtendDB
id: init
run: |
if [ "${{ matrix.backend }}" = sqlite ]; then
output=$(./target/release/extenddb init --backend sqlite --config extenddb.toml 2>&1)
else
output=$(./target/release/extenddb init --config extenddb.toml \
--pg-host 127.0.0.1 --pg-port 5432 --pg-user postgres --pg-pass devpass 2>&1)
fi
echo "$output"
password=$(echo "$output" | grep -oP 'Password: \K\S+')
echo "admin_password=$password" >> "$GITHUB_OUTPUT"

- name: Start ExtendDB
run: |
# --write-pid-file so devtools/run-tests can restart the server with
# 'extenddb stop' when it needs to apply a config change.
./target/release/extenddb serve --config extenddb.toml --foreground --write-pid-file &
for _ in $(seq 1 30); do
if curl -sfk https://127.0.0.1:18443/health > /dev/null; then
echo "Server ready"
exit 0
fi
sleep 1
done
echo "Server failed to start"
exit 1

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"

- name: Install Python dependencies
run: pip install -r requirements.txt

# Every wire test with "vector" in its file or test name, in parallel by
# file, except the CLI catalog migration file, which builds catalogs of
# its own and does not depend on the feature. devtools/run-tests writes
# the setting before the suite starts; the modules read it and fail when
# the server serves the other grammar. Under `listed` they expect the
# extended grammar, because the list names the test account. Under
# `off`, and against the build with the feature compiled out, which has
# no such setting, the tests of the extended grammar skip.
- name: Run the vector wire tests
env:
EXTENDDB_TEST_ENDPOINT: https://127.0.0.1:18443
EXTENDDB_ADMIN_USER: admin
EXTENDDB_ADMIN_PASSWORD: ${{ steps.init.outputs.admin_password }}
EXTENDDB_TEST_BACKUP_STORE: ${{ matrix.backend == 'sqlite' && 'filesystem' || 'none' }}
EXTENDDB_TEST_SEARCH_INEQUALITY_FILTERS: ${{ matrix.setting == 'listed' && '123456789012,210987654321' || matrix.setting != 'compiled-out' && matrix.setting || '' }}
EXTENDDB_EXPECT_VECTORS: "1"
run: devtools/run-tests --extenddb --pytest --parallel --filter "vector and not test_cli"

- name: Dump server syslog on failure
if: failure()
run: sudo journalctl -t extenddb --no-pager -n 500 || true

search-inequality-filters:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job is not among the checks main requires: test, fmt, clippy, integration, mongodb-integration, notices-current and cassandra-integration. The wire tests under off and every test of the compiled-out build run only in this workflow, so a later PR can break either and merge green.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The search-inequality-filters summary check needs to be added to the required checks of main; that is a repository setting, not something this PR can change.

runs-on: extenddb_ubuntu-2404_4-core
timeout-minutes: 5
needs: [compiled-out, wire]
if: always()
steps:
- run: |
if [ "${{ needs.compiled-out.result }}" != "success" ] \
|| [ "${{ needs.wire.result }}" != "success" ]; then
exit 1
fi
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extenddb-storage-mongodb = { path = "crates/storage-mongodb", version = "=1.0.0"
extenddb-storage-postgres = { path = "crates/storage-postgres", version = "=1.0.0" }
extenddb-storage-sqlite = { path = "crates/storage-sqlite", version = "=1.0.0" }
extenddb-auth = { path = "crates/auth", version = "=1.0.0" }
extenddb-server = { path = "crates/server", version = "=1.0.0" }
extenddb-server = { path = "crates/server", version = "=1.0.0", default-features = false }
extenddb-app = { path = "crates/app", version = "=1.0.0" }

# Serialization
Expand Down
10 changes: 10 additions & 0 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ repository.workspace = true
homepage.workspace = true

[features]
default = ["search-inequality-filters"]
# Developer mode: plain HTTP on loopback, open authorization (SigV4
# authentication still enforced), seeded dev credential. A build-time profile
# for local development and CI. The thin bin enforces that it is paired with the
# `sqlite` backend.
dev-mode = ["extenddb-config/dev-mode"]
mongodb-test-hooks = ["extenddb-server/mongodb-test-hooks"]
backup-test-hooks = ["extenddb-server/backup-test-hooks"]
# SearchVectors inequality filters: the extended SearchConditionExpression
# grammar (comparators, BETWEEN, IN, OR, NOT, attribute_exists and
# attribute_not_exists) for the accounts the `search_inequality_filters`
# runtime setting names, every account when it is absent. On by default.
# The workspace takes the server without its default features, so this
# feature decides the server's: with it off, the server and the engine are
# built without it, SearchVectors accepts only an AND of equalities, and
# `settings` has no `search_inequality_filters` key.
search-inequality-filters = ["extenddb-server/search-inequality-filters"]

[dependencies]
extenddb-auth = { workspace = true }
Expand Down
53 changes: 46 additions & 7 deletions crates/app/src/cmd_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
//! masks them: `extenddb_config::should_redact` picks the keys and
//! `extenddb_config::MASK` is the text printed; `get --show-secret` prints the
//! stored value. A key the catalog has no row for prints the storage
//! engine's default (`extenddb_storage::operations::setting_default`), as the
//! console does, so a fresh install, which seeds no settings rows, lists the
//! values the engine uses.
//! engine's default (`extenddb_storage::operations::setting_default`), or for
//! a key the server reads, the server's (`server_setting_default`), as the
//! console does. So a fresh install, which seeds no settings rows, lists the
//! values the server uses.

use clap::{Args, Subcommand};

Expand All @@ -21,7 +22,9 @@ use extenddb_storage::management_store::SettingsStore;
use extenddb_config::{self as config, MASK};

// Re-use validation constants from the ops layer.
use extenddb_server::management::ops_settings::{KNOWN_KEYS, READONLY_KEYS};
use extenddb_server::management::ops_settings::{
KNOWN_KEYS, READONLY_KEYS, server_setting_default,
};

#[derive(Args)]
pub struct SettingsArgs {
Expand Down Expand Up @@ -143,12 +146,18 @@ async fn stored_or_default(
Ok(default(current))
}

/// The value the server uses for `key` when the catalog has no row for it:
/// the storage engine's default, else the server's.
fn default_of(key: &str) -> Option<String> {
extenddb_storage::operations::setting_default(key).or_else(|| server_setting_default(key))
}

async fn list(store: &dyn SettingsStore) -> anyhow::Result<()> {
let rows = store
.list_settings()
.await
.map_err(|e| anyhow::anyhow!("Failed to list settings: {e:?}"))?;
let rows = with_defaults(rows, extenddb_storage::operations::setting_default);
let rows = with_defaults(rows, default_of);

if rows.is_empty() {
println!("No settings found.");
Expand All @@ -159,8 +168,7 @@ async fn list(store: &dyn SettingsStore) -> anyhow::Result<()> {
}

async fn get(store: &dyn SettingsStore, key: &str, show_secret: bool) -> anyhow::Result<()> {
let value =
stored_or_default(store, key, extenddb_storage::operations::setting_default).await?;
let value = stored_or_default(store, key, default_of).await?;

if let Some(v) = value {
println!("{}", display_value(key, &v, show_secret));
Expand Down Expand Up @@ -368,6 +376,37 @@ mod tests {
}
}

/// With no row, `search_inequality_filters` lists and gets the server's
/// default, and a stored row wins over it.
#[cfg(feature = "search-inequality-filters")]
#[tokio::test]
async fn the_search_filter_setting_shows_the_server_default() {
// Another test of this binary may install a storage backend, whose
// defaults `default_of` adds too; no backend reads this key.
let key = "search_inequality_filters";
let listed = with_defaults(rows(&[("log_level", "debug")]), default_of);
assert!(
listed.contains(&(key.to_owned(), "all".to_owned())),
"{listed:?}"
);
assert!(listed.contains(&("log_level".to_owned(), "debug".to_owned())));
let listed = with_defaults(rows(&[(key, "off")]), default_of);
assert!(
listed.contains(&(key.to_owned(), "off".to_owned())),
"{listed:?}"
);
assert!(
!listed.contains(&(key.to_owned(), "all".to_owned())),
"{listed:?}"
);
let fresh = Rows(Vec::new());
let value = stored_or_default(&fresh, key, default_of).await.unwrap();
assert_eq!(value.as_deref(), Some("all"));
let set = Rows(rows(&[(key, "off")]));
let value = stored_or_default(&set, key, default_of).await.unwrap();
assert_eq!(value.as_deref(), Some("off"));
}

/// `list` adds a row for each writable key with an engine default and
/// no row, in key order, and keeps a stored value over the default.
#[test]
Expand Down
6 changes: 4 additions & 2 deletions crates/auth/src/policy/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ pub fn evaluate_condition_with(
// requests the service does. ExtendDB leaves `dynamodb:LeadingKeys`
// absent on query shapes it cannot pin to a partition value, where
// the service populates it. It leaves `dynamodb:Attributes` absent
// only on a `SearchVectors` with no `ProjectionExpression` (#729)
// and, on a table that does not exist, on a `GetItem`,
// on every `SearchVectors`, as the service does (measured
// 2026-11-21), so there the absent-key answer is IAM's and a bare
// negated operator matches. It also leaves `dynamodb:Attributes`
// absent, on a table that does not exist, on a `GetItem`,
// transaction `Get` or `BatchGetItem` that names no attribute
// outside its keys, a `Query` whose key condition the key
// condition parser refuses and that names none elsewhere, and a
Expand Down
24 changes: 13 additions & 11 deletions crates/auth/src/policy/condition/tests/multivalued.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,17 +494,19 @@ fn bare_negated_op_absent_dynamodb_keys_do_not_match() {
// IAM matches a bare negated operator on absent dynamodb:Attributes and
// dynamodb:LeadingKeys too. ExtendDB leaves dynamodb:LeadingKeys absent on
// query shapes it cannot pin to a partition value, where the service
// populates it. It leaves dynamodb:Attributes absent only on a
// SearchVectors with no ProjectionExpression (#729) and, on a table that
// does not exist, on a GetItem, transaction Get or BatchGetItem that names
// no attribute outside its keys, a Query whose key condition the key
// condition parser refuses and that names none elsewhere, and a Scan that
// names none. On the service the key holds the table's key attributes on
// every item request measured, a Scan that names no attribute included,
// and an Allow gated on a bare StringNotEquals over it grants no Scan
// (measured 2026-11-01). Matching on those absent keys could grant an
// Allow the service refuses, so for these two keys an absent key keeps the
// no-match rule (BR-7085).
// populates it. Outside SearchVectors it leaves dynamodb:Attributes absent
// only on a table that does not exist, on a GetItem, transaction Get or
// BatchGetItem that names no attribute outside its keys, a Query whose key
// condition the key condition parser refuses and that names none
// elsewhere, and a Scan that names none. On the service the key holds the
// table's key attributes on every item request measured, a Scan that
// names no attribute included, and an Allow gated on a bare
// StringNotEquals over it grants no Scan (measured 2026-11-01). Matching
// on those absent keys could grant an Allow the service refuses, so a
// context that does not report the service's absence keeps the no-match
// rule for these two keys. On a SearchVectors, where the service sets no
// dynamodb:Attributes value, the request context reports it and the
// operator matches (see evaluator/tests/absent_attributes.rs).
let ctx = TestContext::new();
for key in ["dynamodb:Attributes", "dynamodb:LeadingKeys"] {
for op in [
Expand Down
Loading
Loading