The account matrix
One row per operation of the engine (impl Accounts in src/engine.rs), one column per product, and the crate's own. A product's cell is either the call (file.rs::fn, in the product's repository) and the test that holds it (held by file.rs::test), or — and one line saying why the product does not call the operation. The edda cell names the crate's test that holds the operation (tests/file.rs::test). The accessors (new, id, directory, store, audit, clock, policy, into_parts, row) build an engine and read its parts back; they decide nothing and have no row.
tests/matrix.rs fails when the engine and this file part: an operation with no row, a row that names no operation, a row twice, a product cell with neither a call and its test nor a reason. It resolves every edda cell: the file is one of the crate's, the test is a #[test] in it, and the test calls the operation, so a stale cell fails. A product's cells name another repository: the test checks their shape and lists every name (cargo test -p edda-accounts --test matrix -- --nocapture), and resolves the names when EDDA_MATRIX_GUNNAR or EDDA_MATRIX_HOLGER names a checkout of the product (a file there ends with the path and defines the item), by hand: no CI sets them.
No product's CI resolves its own cells yet. Until a product has a test of its own that reads this file (it ships in the crate) and resolves its column against its code, the header marks the column (not checked by CI), and tests/matrix.rs holds the mark (its CHECKED_BY_CI names each product's test once there is one). Gunnar's xtask/tests/accounts_ratchet.rs holds which operations Gunnar calls (over the edda-accounts source cargo resolves, and xtask/accounts-unused.txt, which may only shrink), not the names in its cells.
The ledger
Where each column was read, and what its cells add up to (tests/matrix.rs counts them):
| product | read at | calls | — |
| Gunnar | master at b372e818 |
14 | 12 |
| Holger | h40 at fdcf7317 |
0 | 26 |
Gunnar calls 14 of the 26 operations, from gunnar-core (auth/account_engine.rs, behind its AuthTable). Holger calls none: Holger restarts as h40 (h38 and older are retired, so their cells and file names are gone), and h40 does not call the engine yet. Its column is filled when it does.
The operations
| operation | Gunnar (not checked by CI) | Holger (not checked by CI) | edda |
home |
— AuthTable::account_of_principal answers it from the same binding the engine reads (account_engine.rs::Facts), not through the engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::enrolling_a_new_member_binds_it_to_the_account |
is_account_admin |
crates/gunnar-core/src/auth/account_engine.rs::admin_of, asked by auth/operator_access.rs::AuthTable::is_account_admin (the account log, the operator's looks, the members listing), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::the_owner_makes_a_member_an_admin_who_then_decides_for_the_account |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::make_admin_and_drop_admin_keep_one_admin_and_the_owner |
may |
crates/gunnar-core/src/auth/account_engine.rs::verdict, asked first by auth.rs::AuthTable::may_in and ::may_namespace; in a person's account its refusal is the answer too, but for the operator's look (review S19), held by crates/gunnar-core/tests/gunnar_story.rs::anna_is_admin_at_every_level_in_her_own_account and crates/gunnar-core/tests/accounts_on_the_engine.rs::what_the_engine_refuses_in_a_persons_account_gunnar_refuses_the_crate_wins |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::may_answers_not_there_outside_and_forbidden_inside |
allowed |
— Gunnar asks may and reads its three answers |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::holger_keeps_the_wall_and_gunnar_does_not |
standing |
crates/gunnar-core/src/auth/account_engine.rs::standing_in, asked by auth/operator_access.rs::AuthTable::role_in_account (the role in an account's log and in WhoAmI), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_is_dropped_back_to_a_member_and_the_owner_never_is |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::the_standings_follow_gunnars_words |
found |
— a Gunnar account is founded with its person (AuthTable::add_principal, the namespace named after it); no account row is stored |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_person_with_an_account_founds_nothing |
found_for |
— Gunnar's operator founds no account for anybody: an account is founded with its person (AuthTable::add_principal, the namespace named after it) |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/found_for.rs::the_operator_founds_an_account_for_its_owner_and_the_trail_names_the_operator |
make_admin |
crates/gunnar-core/src/auth/account_engine.rs::appoint, run by auth.rs::AuthTable::make_admin_as (door Access.Grant Admin on the account's namespace), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::the_owner_makes_a_member_an_admin_who_then_decides_for_the_account and crates/gunnar-server/tests/enterprise.rs::the_account_admin_appoints_a_member_admin_on_the_shared_engine_and_drops_him |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::make_admin_and_drop_admin_keep_one_admin_and_the_owner |
drop_admin |
crates/gunnar-core/src/auth/account_engine.rs::dismiss, run by auth.rs::AuthTable::drop_admin_as (door Access.Revoke of an admin's namespace row), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_is_dropped_back_to_a_member_and_the_owner_never_is and crates/gunnar-server/tests/enterprise.rs::the_account_admin_appoints_a_member_admin_on_the_shared_engine_and_drops_him |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::make_admin_and_drop_admin_keep_one_admin_and_the_owner |
transfer_owner |
— not expressible in Gunnar: an account IS its person's namespace (<host>/<person>/<repo>, the owner's id is the account's id), so Rows::put_row refuses a row naming another owner |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::the_owner_hands_the_account_to_a_member_who_then_buys |
purge |
— the account purge is gunnar-server's account_purge job (lease, gate, the repositories on disk), not the engine's |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_purge_removes_the_members_first_then_the_account |
add_machine |
— Gunnar's machines are the estate's (deploy keys, the seller's key), made by Access.AddPrincipal; no account owns one |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_member_and_an_admin_and_an_owner_are_persons |
enroll |
— Gunnar enrols a member with its room out of a paid order (AuthTable::enroll_with_room): the engine's put_principal has no room or seat to carry, so the table keeps the write |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::an_existing_principal_never_becomes_a_member |
enroll_verified |
— SCIM provisioning and the first SSO login enrol through Gunnar's own SSO table (crates/gunnar-core/src/auth/sso_table.rs), not the engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::the_directory_hooks_make_members_and_never_take_somebody_elses |
import_members |
— the member import is Gunnar's own Sso.ImportUsers (crates/gunnar-grpc/src/service/sso.rs::import_users, a SCIM import job): each member takes a room and a seat, which the engine's enrolment does not carry |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_batch_import_is_all_or_nothing |
import_csv |
— gunnar-core takes edda-accounts without its csv feature; Sso.ImportUsers reads the CSV with the same parser (nornir-identity-directory) |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/csv_import.rs::a_csv_with_one_bad_row_writes_nothing |
remove_member |
crates/gunnar-core/src/auth/account_engine.rs::unbind, run by auth.rs::AuthTable::remove_member_as (door Access.RemovePrincipal of a member), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_removes_a_member_whole_and_the_operator_may_too and crates/gunnar-server/tests/enterprise.rs::the_account_admin_keeps_its_groups_and_removes_a_member_on_the_shared_engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::removing_a_member_removes_the_binding_and_its_rights |
remove_principal |
crates/gunnar-core/src/auth/account_engine.rs::drop_principal, run by auth.rs::AuthTable::remove_group_as (door Access.RemovePrincipal of an account group), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_makes_a_group_of_the_account_and_its_members_hold_its_rows |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_member_and_an_admin_and_an_owner_are_persons |
forget |
crates/gunnar-core/src/auth/account_engine.rs::forget_everywhere, run by auth.rs::AuthTable::remove_principal_at, held by crates/gunnar-core/tests/gunnar_story.rs::a_gone_principal_leaves_no_row_in_any_account_and_a_recreated_id_inherits_nothing |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::a_gone_outsider_is_forgotten_by_every_account_the_server_tells |
grant |
crates/gunnar-core/src/auth/account_engine.rs::give, run by auth.rs::AuthTable::grant_as (door Access.Grant, a person's or an account group's row inside a person's account), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_gives_a_member_write_on_a_repository_and_takes_it_away and crates/gunnar-core/tests/accounts_on_the_engine.rs::an_outsider_is_given_a_repository_and_never_the_whole_account_the_crate_wins |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::holger_keeps_the_wall_and_gunnar_does_not |
revoke |
crates/gunnar-core/src/auth/account_engine.rs::take, run by auth.rs::AuthTable::revoke_as (door Access.Revoke), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_gives_a_member_write_on_a_repository_and_takes_it_away |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::the_owners_admin_is_no_row_and_cannot_be_revoked |
create_group |
crates/gunnar-core/src/auth/account_engine.rs::found_group, run by auth.rs::AuthTable::create_group_as (door Access.AddPrincipal kind GROUP <account>/<local>), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_makes_a_group_of_the_account_and_its_members_hold_its_rows and crates/gunnar-server/tests/enterprise.rs::the_account_admin_keeps_its_groups_and_removes_a_member_on_the_shared_engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::grants_reach_group_members_transitively_and_a_group_is_not_a_caller |
add_to_group |
crates/gunnar-core/src/auth/account_engine.rs::join, run by auth.rs::AuthTable::add_to_group_as (door Access.AddGroupMember, the admin's signed event kept in the membership log), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_makes_a_group_of_the_account_and_its_members_hold_its_rows and crates/gunnar-server/tests/enterprise.rs::the_account_admin_keeps_its_groups_and_removes_a_member_on_the_shared_engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::grants_reach_group_members_transitively_and_a_group_is_not_a_caller |
remove_from_group |
crates/gunnar-core/src/auth/account_engine.rs::leave, run by auth.rs::AuthTable::remove_from_group_as (door Access.RemoveGroupMember, signed), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::an_admin_makes_a_group_of_the_account_and_its_members_hold_its_rows and crates/gunnar-server/tests/enterprise.rs::the_account_admin_keeps_its_groups_and_removes_a_member_on_the_shared_engine |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::grants_reach_group_members_transitively_and_a_group_is_not_a_caller |
set_visibility |
— a repository's visibility is the catalogue's row (RepoCatalog::set_visibility), not the engine's |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::the_account_admin_may_change_visibility_three_ways |
buy |
crates/gunnar-core/src/auth/account_engine.rs::ask_ticket, asked by auth.rs::AuthTable::buy_as (the Billing.MintActorTicket door, through ControlPlane::may_buy: the seller's machine, or the account's owner asking as a person), held by crates/gunnar-core/tests/accounts_on_the_engine.rs::the_owner_of_a_gated_account_buys_nothing_until_the_gate_is_lifted |
— Holger h40: not yet wired (h38 and older are retired; the column is filled when h40 calls the engine) | tests/model.rs::an_outsider_buys_nothing_for_an_account_and_the_owner_and_seller_do |