Cotal TypeScript packages
    Preparing search index...

    Function replaceSpaceAccountAuth

    • Replace ONE space's existing account record through the seam: the record a data signing-key rotation, or the rollback of one, changes. It puts spaceAccountKey and no other key. The broker record is read to verify the chain and is never written, so a change made for one space cannot touch the trust every space on the broker shares. putSpaceAuth writes both records and stays the provisioning writer.

      It replaces; it does not provision or repair. Both split records must already be in the store and validate together (validateSpaceAccountAuth). A missing broker or account record, the legacy monolith on its own, a blank broker record, a corrupt generation and an existing record outside this broker's chain all refuse. The replacement must name the same space and be the same account (public key and seed), carry a claim this broker's operator issued for that account, and hold a signing seed that claim trusts. Every refusal comes before the put.

      A replacement that is byte-equal to the stored record is not written again, which makes a retry after an unknown outcome safe. After a put the record is read back and must equal what was written, and the broker record must still be the one the replacement was validated against.

      NOT atomic across keys and not a compare-and-swap: a SecretStore promises whole-value puts and nothing more. The host must exclude every other writer of this space's account record and of the broker record for the whole call. The read-back reports a writer it can see; it prevents none. Errors name store keys and the caller's own space label, never stored bytes.

      Parameters

      Returns Promise<void>