-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth Next changes in SDK #848
Conversation
6ab42da
to
e29ac27
Compare
6956c1d
to
4c3331a
Compare
The Address is meant to be used in place of the invoker/AccountId/Identifier etc. It also provides a way to call `require_auth` to perform authentication/authorization. This also has some other Env changes supporting the Host changes for Auth Next.
For now this just contains the context type definition that host passes to the account. This can be extended as needed, hence I'm using a separate library.
4c3331a
to
40b5b95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really nice. I have a few asks inline.
…-sdk into auth_next_impl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my suggestions were misunderstood in a couple places.
I think the main things left are:
-
Figuring out if we can keep network passphrase, or if we need to move to network id in the SDK. I agree network id should be used within the env.
-
Can we replace the verify_top_auth function.
It would be good to figure out (1) before merging so that we don't flip-flop the network passphrase code. But it's also fine to flip flop it if we can't figure it out.
I think we can fix (2) post-merge, but I think it is important we fix that before release, so maybe worth doing in this PR too.
… a token contract with a given admin. This makes the test setup simpler and also removes the redundant coverage of the built-in contract.
I would suggest merging this as is (given everything else looks ok) in order to unblock your changes or any other unrelated changes. I'll prioritize this to make sure it makes it into release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, +1 to following up with the remaining things.
Two things with cfgs stand out to me which I commented on inline, just because they look inconsistent with other code following the same pattern. I'll try changing them and if they work changed I'll merge. Otherwise I'll merge them as it is.
What
Adapt Soroban SDK to the host changes introduced in stellar/rs-soroban-env#645
Overview of the changes:
AccountId
,invoker
, andsoroban-auth
library with the singleAddress
type that supports host-based authentication and authorization.Why
Auth Next motivation is described in the env PR. From the SDK perspective the auth and testing are greatly simplified.
Known limitations
Some of the possible followups: