Repository navigation
fix(auth): read a role session's policy and tags by its access key - #1523
Conversation
AssumeRole stores a new session for every call, so one role can hold several sessions with the same session name at once. A request signed with one of them must be authorized with that session's own session policy, session tags and issue time (aws:TokenIssueTime). tests/test_session_name_reuse.py assumes one role twice under one session name, with different session data on the two calls, and checks a GetItem and a PutItem of each session: - session policies that allow only GetItem and only PutItem; - session tags that a role policy's aws:PrincipalTag conditions read; - a Deny of every action to sessions issued before a cut-off that falls between the two issue times. Each test checks both sessions, so a server that reads one session's data for both fails it whichever session's data it reads. The issue time test compares a cut-off taken from this host's clock with the server's issue times, 1.2 seconds from each; the file's docstring says so. These tests fail before the next commits: the authorization path reads a role session's data by account, role and session name.
A role session's policy, tags and issue time were read by account, role and session name. AssumeRole stores a row for every call, so once a session name had been used more than once, which row was read could depend on row order. They are now read by the session's own access key. - AuthIdentity::RoleSession carries access_key_id, the key the request was signed with; BuiltinAuthProvider sets it from the Authorization header's credential, the key the credential lookup matched. - AuthorizationStore::fetch_session_data takes that access key ID in place of the account, role and session name. The four backends select the session by access_key_id: a UNIQUE column on SQLite and PostgreSQL, a unique index on MongoDB, and on Cassandra the column the session credential lookup already filters on. - The read returns the session's row whether or not it has expired. Authentication refuses a request signed with an expired session's key before authorization reads the session's data: ExpiredTokenException on the credential cache's hit and miss paths, or UnrecognizedClientException once neither the cache nor the store holds the key (MongoDB's TTL index deletes expired sessions). SQLite and MongoDB compared the expiry again on the server's clock, and PostgreSQL with now() on the database's. - CachedAuthzStore keys session data by (account, role, access key ID). Deleting a role still drops the entries under its account and name, and deleting an account the entries under its id. The account and the role only place an entry; the loader reads by the key alone. - check_authorization passes the access key ID to the helper that reads the session data and lays the session tags over the role's. The helper is renamed fetch_session_data_and_tags_by_key: its last argument keeps the type &str, so a caller written for the session name would still compile under the old name. - AssumeRole no longer invalidates session data under the role and session name: a new session's key has signed no request, so nothing is cached under it. AuthzCacheInvalidator::invalidate_session, AuthCacheRegistry::invalidate_session and CachedAuthzStore::invalidate_session had no other caller and are removed. The comment that said a second AssumeRole overwrote a session is rewritten, and the doc of the request's session_name no longer says that the name identifies a session.
extenddb_storage::session_data_conformance (behind test-util, as iam_leftovers_conformance is) stores four sessions of one role, each with its own session policy and session tags: under one session name an expired session and then a live one, under another two live sessions. It first checks that its sessions are these two pairs, grouped by name in the order it stores them, and that no two of them share a policy or tags. It stores the two sessions of a name at least 1.2 s apart: it pauses 1.3 s between them, and before it reads, it checks that the later session of each name started at least 1.2 s after the earlier one's store call returned, pairing the sessions by name. The pause is timed on the monotonic clock and checked on the wall clock; the extra 100 ms lets the wall clock be set back that far while the pause runs. It then reads each session's data by its access key with AuthorizationStore::fetch_session_data and checks that each read is that session's own policy and tags, with an issue time inside the window of the session's store_session call, and that a key no session holds reads None. The window runs from 100 ms before the call started, rounded down to the whole second (the Cassandra store reads an issue time in whole seconds), to 100 ms after the call returned. The PostgreSQL and Cassandra stores take the issue time from the database's clock; the margin lets that clock run up to 100 ms ahead of or behind the clock of the host that runs the check. The 1.2 s is a second and twice that margin: the earlier session of each name is read at least that long after its store call returned, so a store that answers the time of the read fails the check, even one that reads whole seconds on a clock 100 ms behind, and so does a store that answers the other session's issue time. Three unit tests pin the window: - it holds an issue time taken when the call started or when it returned, on a clock up to 100 ms ahead or behind, to the millisecond and in whole seconds; - it refuses one from a clock 101 ms ahead taken when the call returned, and one from a clock 101 ms behind taken when a call that starts 100 ms into a second started; - it refuses one taken 1.2 s before the call started or after it returned, on a clock up to 100 ms ahead or behind. The expired session's key reads its own data as well. MongoDB's TTL index on iam_sessions.expires_at deletes expired sessions in the background, so its test passes Expectations::deletes_expired_sessions, which lets that one read be None; there the check cannot tell this read from one that skips expired sessions. Each backend runs the check against its own store: SQLite on the in-memory catalog that the management store's tests build (crates/storage-sqlite/src/authorization_store.rs), PostgreSQL on the catalog of a migrations_support scratch pair, which is dropped after a failed check too (tests/session_data.rs), MongoDB on EXTENDDB_TEST_MONGODB_URI's replica set (tests/session_data.rs), and Cassandra beside the other authorization store tests (tests/direct/authorization_store.rs). The SQLite and PostgreSQL stores hold an encryption key, without which they write no session. The check builds its role's trust policy and its session policies with iam_leftovers_conformance's helpers. The test-util comment in crates/storage/Cargo.toml names the checks that the feature compiles.
crates/server/src/authorization/session_data_tests.rs stores sessions of one role under one session name in an in-memory SQLite catalog and authorizes a GetItem and a PutItem with each live session's key through check_authorization and the authorization cache: - a live session stored after an expired one of its name is judged by its own session policy; - two live sessions are each judged by their own session policy, the second after the first's data is cached; - two live sessions are each judged by their own session tags; - two live sessions with issue times set on either side of a cut-off, under a Deny of every action to sessions issued before it, are judged by their own aws:TokenIssueTime. In authz_cache.rs, a second session's key misses the cache that holds the first session's data and reads its own, and invalidate_account drops the session data of every role session in the account and keeps another account's. In the auth crate, an authenticated role session's identity carries the access key the request was signed with.
The authorization cache design (docs/design/12-auth-authz-cache.md) keyed role-session data by account, role and session name, and listed AssumeRole as invalidating that entry. Session data is keyed by account, role and access key ID now, and AssumeRole drops only the credential cache's entry for the new key, which has signed no request. The cached value is an Option<Arc<CachedSessionData>>, whose session policy the loader parses; the design's diagram said SessionData, and its list of keys and values Option<SessionData>, with no parsing. The upgrade manual's Behavior Changes by Release gains an entry: a request signed with a role session's credentials is authorized with the session policy, session tags and issue time of the session whose access key signed it, where earlier releases read them by account, role and session name. It also names SQLite, PostgreSQL and MongoDB deployments that read a role session's data from the store for a request authenticated just before the session expired: on those backends the read compared the session's expiry again, on PostgreSQL with the database's clock. In docs/manuals/12-extending-extenddb-storage.md, the backend authors' guide says how fetch_session_data selects a session and names the check that each backend's tests run, session_data_conformance.
demohan
left a comment
There was a problem hiding this comment.
A role session is authorized with its own data at 078fecf. On SQLite, PostgreSQL 16, MongoDB 7 and Cassandra 4.1, sessions sharing a session name each get their own session policy, tags and issue time: eight sessions of one name gave 48 of 48 correct answers, a session whose data was cached before the others existed keeps its own, and BatchGetItem, Query, PartiQL SELECT and INSERT, BatchWriteItem and TransactWriteItems follow the same policy. On main 3 of 4 same-name sessions answer as another session, among them a GetItem-only session allowed PutItem and a session without tags given another's tag grant. 25,600 requests from 16 to 32 threads, with warm and cold caches, gave no mismatch; sessions written by main and served by this head answer correctly; across the expiry instant 0 of 15,241 requests were allowed, where main allowed 2 of 14,775 without the session policy; an expired session answers ExpiredTokenException, as the service does; and a key that differs in case or by a space, or the key of a deleted and recreated role, answers UnrecognizedClientException.
tests/test_session_name_reuse.py passes 3 of 3 here and fails 3 of 3 on main, and reading by name, reading the newest row, skipping expired rows, or returning the read time as the issue time each fails a test on its backend. fmt, clippy with both feature sets and the 1.94.0 check are clean. CI's 1.94.0 leg stops at the secmem memlock test, which main has since fixed, and the fail-fast cancel means the SQLite store's new test has not run there; a merge of main and a rerun would show it, and would resolve the upgrade manual's conflict with main's v1.1.0 entries.
| interprets existing data or configuration. Review these before upgrading a live | ||
| deployment, even when no catalog migration is required. | ||
|
|
||
| ### IAM: a role session's policy, tags and issue time are read by its access key |
There was a problem hiding this comment.
Optional. The other entries carry a release prefix (### v1.1.0: ...). Under "Who is affected" (:395), "could depend on row order" undersells it: on main a session could be authorized with another session's session policy or with none, and a GetItem-only session was allowed PutItem on SQLite and PostgreSQL. One sentence saying a session could get more access than its own policy grants would tell a reader whether to look at their logs.
demohan
left a comment
There was a problem hiding this comment.
cf39127 merges main and changes nothing of this PR's own: in its files, the merge brings in main's vector_filter lines in crates/storage/src/lib.rs and main's two v1.1.0 SearchVectors entries in the upgrade manual, and this PR's entry is as approved. run-tests now passes on stable and 1.94.0 with the secmem fix from main, and a_session_reads_its_own_data_by_its_access_key runs and passes in both. The four red jobs at this head were cancelled before running.
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone.
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone. docs/troubleshooting.md: the bus error entry names 1.0.0 as the release that has the bug, so its line carries a version-literal-ok marker.
* chore(release): bump version to 1.1.0 Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone. docs/troubleshooting.md: the bus error entry names 1.0.0 as the release that has the bug, so its line carries a version-literal-ok marker. * docs(upgrade): add the v1.1.0 entry of #1290, put #1349's in order #1290 merged after this branch was rebased. It changes the answer to a request with no Authorization header, so it gets a v1.1.0 entry. The merge of main put the #1349 entry after the #1523 entry. It moves to the place of its number, beside the new #1290 entry. --------- Co-authored-by: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com>
Resolve the Cargo.toml and Cargo.lock merge conflicts with main (v1.1.0) and adapt the Cloud Bigtable storage backend to upstream changes: - Align workspace Cargo.toml and Cargo.lock with ExtendDB v1.1.0 (ExtendDB#1514), MSRV 1.94.0 and sqlx 0.9.1 (ExtendDB#1166), and extenddb-server default-features = false (ExtendDB#1449), bumping extenddb-storage-bigtable to =1.1.0. - Adapt AuthorizationStore::fetch_session_data (ExtendDB#1523) to look up role session policy, tags, and RFC 3339 created_at in O(1) by access_key_id via iam_session_ak:<access_key_id> -> iam_session:<session_token> without re-checking session expiry, with symmetric 4 KiB row-key and non-empty token guards across fetch_session_data and lookup_credential. - Decide StreamSpecification transitions in BigtableEngine::update_table ahead of companion table fields and GSI updates (ExtendDB#963) so a refused disable/enable writes no other table member while still closing any open shards left behind by a prior disable. - Update docs/bigtable-setup.md for Rust 1.94.0 and the exact v1.1.0 extenddb version output. - Add unit and live cbtemulator integration tests covering session_data_conformance::run, expired/deleted/oversized session-data and credential lookups, write_bootstrap_rows admin environment-variable combinations and idempotent re-runs (ExtendDB#1349), ClientRequestToken NUL/backslash/ UTF-8 escaped stored tokens (ExtendDB#1375), and refused stream disable/enable preceding companion edits (ExtendDB#963).
Merge upstream main (ExtendDB v1.1.0) into rfc/bigtable-backend and reverse-sync docs/rfcs/0000-bigtable-backend.md with the v1.1.0 trait surface and conformance coverage: - Update ExtendDB binary version literals to v1.1.0 (ExtendDB#1514). - Document O(1) access-key-indexed AuthorizationStore::fetch_session_data (including expired sessions), symmetric 4 KiB key-length bounds, and session_data_conformance::run (ExtendDB#1523). - Document escaped ClientRequestToken stored tokens (ExtendDB#1375), pre-companion StreamSpecification refusal in TableEngine::update_table (ExtendDB#963), default SettingsStore::get_setting_bounded (ExtendDB#1449), and write_bootstrap_rows admin environment-variable handling (ExtendDB#1349).
What
A role session's policy, tags and issue time were read by account, role and session name. AssumeRole stores a row for every call, so once a session name had been used more than once, which row was read could depend on row order. They are now read by the session's own access key.
AuthIdentity::RoleSessionhas a new field,access_key_id: the access key ID that the request was signed with.BuiltinAuthProvidersets it from the request's credential, the key that the credential lookup matched.AuthorizationStore::fetch_session_datatakes that access key ID in place of the account ID, role name and session name. Each backend selects the session byaccess_key_id: aUNIQUEcolumn on SQLite and PostgreSQL, a unique index on MongoDB, and on Cassandra the column that the session credential lookup filters on.ExpiredTokenExceptionon the credential cache's hit and miss paths, or withUnrecognizedClientExceptiononce neither the cache nor the store holds the key (MongoDB's TTL index oniam_sessions.expires_atdeletes expired sessions). Before this change SQLite and MongoDB compared the expiry again on the server's clock and PostgreSQL withnow()on the database's; Cassandra did not compare it.CachedAuthzStorekeys session data by account ID, role name and access key ID. The account and the role only place an entry; the loader reads by the access key alone. Deleting a role still drops the cached data of the role's sessions, and deleting an account that of the account's sessions.check_authorizationpasses the access key ID, throughcheck_role_authorization, to the private helper that reads the session data and lays the session tags over the role's, renamed fromfetch_session_data_and_tagstofetch_session_data_and_tags_by_key.AuthzCacheInvalidator::invalidate_session,AuthCacheRegistry::invalidate_sessionandCachedAuthzStore::invalidate_sessionhad no other caller and are removed. The comment ingenerate_and_store_sessionthat said a second AssumeRole overwrote a session now says that every call stores a new one, and the doc of the request'ssession_nameno longer says that the name identifies a session.docs/design/12-auth-authz-cache.mdgives the new cache key and the cached value's type. The upgrade manual's Behavior Changes by Release has an entry. The backend authors' guide (docs/manuals/12-extending-extenddb-storage.md) says howfetch_session_dataselects a session and names the check that each backend's tests run.Why
Each AssumeRole call stores a new session, with its own access key, session policy, session tags and issue time, also when the role already has a session with that name. The authorization path read the session data by name, so it did not tell such sessions apart.
Testing done
The branch has five commits on
mainatd9c587d0.e23dac98adds the end-to-end tests before the fix,b5be849ais the fix,de4e62faand4d3e42aeadd the storage and server tests, and078fecf5the docs. Every run below is local, at078fecf5unless it names another commit, exceptmain's own Test runs at77460433and708821b9.tests/test_session_name_reuse.py, 3 tests. Each assumes one role twice under one session name, with different session data, and sends a GetItem and a PutItem with each session: session policies that allow one action each, session tags that the role policy'saws:PrincipalTagconditions read, and a Deny of every action to sessions whoseaws:TokenIssueTimeis before a time between the two issues. Against a SQLite server and a PostgreSQL 16 server built atd9c587d0, all 3 fail at the second session, which gets the first session's answers. At078fecf5all 3 pass against a SQLite server and against a PostgreSQL 16 server.extenddb_storage::session_data_conformance, behind thetest-utilfeature asiam_leftovers_conformanceis. It stores four sessions of one role (under one name an expired session and then a live one, under another two live sessions, the two of a name at least 1.2 s apart), each with its own policy and tags. It first checks that its sessions are these two pairs, grouped by name, and that no two of them share a policy or tags. Before it reads, it checks that the later session of each name started at least 1.2 s after the earlier one'sstore_sessioncall returned. It pauses 1.3 s between the two sessions of a name, timed on the monotonic clock, so that this check still passes a correct store when the wall clock is set back by up to 100 ms during the pause. Reading each session by its access key must give its own policy and tags, and an issue time no earlier than 100 ms before itsstore_sessioncall started, rounded down to the whole second, and no later than 100 ms after the call returned. The PostgreSQL and Cassandra stores take the issue time from the database's clock, and the margin lets that clock run up to 100 ms ahead of or behind the clock of the host that runs the test. A key that no session holds must readNone. Three unit tests in the module pin that window: it holds an issue time from a clock up to 100 ms ahead or behind, taken when the call started or when it returned; it does not hold one from a clock 101 ms ahead taken when the call returned, nor one from a clock 101 ms behind taken when a call that starts 100 ms into a second started; and it does not hold one taken 1.2 s before the call started or after it returned. MongoDB's TTL index oniam_sessions.expires_atdeletes expired sessions in the background, so that backend's test lets the expired session readNone, and there the check does not show that an expired session's data is read. Each backend runs the check from one test:crates/storage-sqlite/src/authorization_store.rs(in-memory),crates/storage-postgres/tests/session_data.rs(in the scratch databases oftests/migrations_support, which are dropped after a failed check too),crates/storage-mongodb/tests/session_data.rsandcrates/storage-cassandra/tests/direct/authorization_store.rs. All four pass, against PostgreSQL 16, MongoDB 7 (a one-node replica set) and Cassandra 4.1.crates/server/src/authorization/session_data_tests.rs, 4 tests: requests throughcheck_authorizationand the authorization cache over an in-memory SQLite catalog, for a session stored after an expired one of its name, and for two live sessions of one name by session policy, by session tags and by issue time.authz_cachegainsa_session_is_never_served_another_sessions_cached_dataandinvalidate_account_drops_the_accounts_session_data;invalidate_role_sessions_drops_all_sessions_for_roleandsession_data_round_tripnow key by access key. In the auth crate,session_key_with_matching_token_authenticateschecks the identity's access key, andis_principal_ofin thesigv4_differentialharness requires a session identity's access key ID to be the ID of the session key that signed the request.d9c587d0. Negative controls, each one edit of078fecf5, and the tests that then fail; without the edit, each of these tests passes. For an edit of the SQLite store the tests run are the library tests ofextenddb-storage-sqliteandextenddb-server; for an edit of the server crate, those ofextenddb-server; for the auth crate, all of its tests but thesecmemtest named below; for another backend, its conformance test, and on Cassandra also its otherauthorization_storeandaccess_keystests:d9c587d0did: the SQLite conformance test and the 4 server tests. The same without the expiry check: the same 5 tests.expires_at > now(), asd9c587d0did: the PostgreSQL conformance test.strftime(…, 'now')on SQLite,clock_timestamp()on PostgreSQL, the server's clock on MongoDB,toTimestamp(now())on Cassandra): that backend's conformance test, and on SQLite alsolive_sessions_of_one_name_each_have_their_own_issue_time.live_sessions_of_one_name_each_have_their_own_issue_time.CachedAuthzStore::fetch_session_datakeys and loads session data with an empty access key: the 4 server tests and 3authz_cachetests.BuiltinAuthProviderleaves the identity'saccess_key_idempty:session_key_with_matching_token_authenticatesand 9sigv4_differentialtests.cargo +1.97.0 fmt --all -- --check: clean.cargo +1.97.0 clippy --all-targets -- -D warnings, with each of the two feature sets ofclippy.yml: no warnings.cargo test --workspace --no-fail-fast(1.100.0): 5472 passed, 1 failed, 99 ignored. The first test step oftest.yml's 1.94.0 leg, run with--no-fail-fastadded (cargo +1.94.0 test --locked --workspace --exclude extenddb-backup-store --no-fail-fast): 5304 passed, 1 failed, 99 ignored. Both failures aresecmem::tests::init_refuses_under_a_low_memlock_limit_then_starts_unlocked, which fails the same way on this machine atd9c587d0, and failed inmain's own Test runs at77460433(1.94.0) and708821b9(stable).cargo package --workspace --no-verify --lockedanddevtools/check-crate-packages: ok. The license notices--checkruns (default,--backend mongodb,--backend cassandra, dev): current.packaging/npm/test/launcher.test.jsagainstlauncher.yml's build: 11 scenarios passed.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
cargo test --workspacehas the one failure above.cargo +1.97.0 clippy -- -W clippy::pedanticreports 2434 warnings in the workspace, the same 2434 by file and lint as atd9c587d0.ADR / RFC: n/a. The change fixes which stored session the authorization path reads. For that it changes a backend storage trait,
AuthorizationStore:fetch_session_dataselects a session by its access key ID in place of the account ID, role name and session name, andAuthIdentity::RoleSessioncarries that key. How a session policy, session tags and an issue time take part in a decision is unchanged.docs/versioning.md("Not covered") puts the APIs of the Rust crates, theStoragetrait among them, outside the compatibility promise.Breaking changes
For code built on the published crates:
extenddb-auth:AuthIdentity::RoleSessionhas a new field,access_key_id.AuthzCacheInvalidator::invalidate_sessionandAuthCacheRegistry::invalidate_sessionare removed.extenddb-storage:AuthorizationStore::fetch_session_datatakes one argument, the access key ID, in place of the account ID, role name and session name.extenddb-server: the third argument ofCachedAuthzStore::fetch_session_datais the access key ID, where it was the session name. Its type is unchanged, so a caller that still passes the session name compiles, looks the name up as an access key ID, and must be changed by hand.CachedAuthzStore::invalidate_sessionis removed.Open pull requests that use a changed item, and so do not compile once merged with this branch:
crates/server/src/console/test_catalog.rsimplementsfetch_session_datawith three arguments.crates/server/src/authorization/full_action.rspasses a session name tofetch_session_data_and_tags, and callscheck_role_authorizationincrates/server/src/authorization.rswithout the access key ID that this branch adds to that function's parameters.crates/server/src/bulk_authorizer.rscallsAuthorizationStore::fetch_session_datawith an account ID, a role name and a session name. Its test stores incrates/server/src/bulk_authorization_tests/implementfetch_session_datawith three arguments, andfull_action.rs,bulk_authorizer.rs,crates/server/src/request_helpers/bulk.rsandbulk_authorization_tests/s3_actions.rsbuild or matchAuthIdentity::RoleSessionwithoutaccess_key_idand without...crates/storage-mongodb/tests/authorization_store.rscallsfetch_session_datawith three arguments.fetch_session_datatakes an account ID, a role name and a session name and selects the session by them:crates/storage-bigtable/src/catalog_store.rs,crates/storage-duckdb/src/authorization_store.rsandcrates/storage-tidb/src/authorization_store.rs.No catalog migration and no configuration change.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.