Why: Account disable could be followed by late Backend business writes, API key creation could implicitly create users, account bootstrap locks could invert, and directory cursors were process-local or leaked out-of-scope changes. Evidence: Local go test ./... and isolated PostgreSQL package suites passed on the staged candidate; exact committed-head SELF replay and stage 6 human review remain pending. Impact: Adds final account transactions and external-effect checks across HTTP, Host, Bus and run manager; tightens API key issuance and persists versioned cursor signing. Delegated RDM rename still needs the separately proposed real-operator contract, so A1 and stage 6 are not complete. Refs: Documents U3 r1, approved A1-A4 amendment fb3a821, pending delegated-projection amendment 5783940, Dev feature/iam-u3-account-directory-recovery.
18 lines
447 B
Go
18 lines
447 B
Go
package server
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"agent-system-backend/internal/store"
|
|
)
|
|
|
|
// createLegacyAPIKeyFixture creates the historical integration identity
|
|
// explicitly before exercising the formal, non-creating key issuance path.
|
|
func createLegacyAPIKeyFixture(t *testing.T, st *store.Store, owner, name string) (string, error) {
|
|
t.Helper()
|
|
if err := st.EnsureUser(owner, ""); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return st.CreateAPIKey(owner, name)
|
|
}
|