Repository navigation
feat(rust): add hosted authorization-lock support - #79
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the missing Rust hosted authorization-lock API: typed add/remove preparation, current-slot lock reads, and decoding the existing role permission. This is stacked on #66, which contains TypeScript and Python support.
The expiry enum makes callers choose duration or absolute expiry. Requests preserve u64 values as decimal strings; reads validate integer widths, activity, ordering, and lock counters. Preparations preserve signature requests and ParticipantSet approval plans and recognize the current wire kinds 10/11.
Native k1 signing handles the hosted lock API's exact EIP-191 prefix at the 88/16-byte instruction offsets. Raw k1 SignV2 behavior is preserved. Real k1/r1 tests reconstruct the canonical message from serialized arguments, account flags and replay fields, verify signatures, and reject changed lock arguments. Lock permission grants remain in the Protocol SDK because the current hosted add-role contract does not accept that permission.
Draft only, as requested. No CI changes, merges, package publication, or deployment. The existing Rust workflow runs formatting, tests, Clippy, and package verification; its configuration is unchanged. These hosted APIs require portal #1170 and the auth-lock program, but do not depend on Rust Protocol SDK publication.
Validation:
cargo +1.96.1 clippy --workspace --all-targets --locked -- -D warningsand formatting passed.cde0173found no remaining blockers and independently passed 31 focused tests.