-
Notifications
You must be signed in to change notification settings - Fork 176
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
Refactor how native token authentication is verified #2761
Draft
jvff
wants to merge
15
commits into
linera-io:main
Choose a base branch
from
jvff:refactor-native-token-authentication
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+204
−70
Conversation
This file contains 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
Represent an `AccountOwner` that has been authenticated to move funds.
Add an `AuthenticatedAccountOwner` constructor meant to be called from a user application's execution runtime.
Create an `AuthenticatedAccountOwner` to be passed along to the system application later.
Require authentication to be performed while still in the runtime thread.
Add an `AuthenticatedAccountOwner` constructor meant to be called from the system application's execution of an operation.
Perform authentication earlier in the code, preparing to pass along a type that indicates authentication was performed.
Change the function signature so that it expects a source account that has already been authenticated.
The authenticated version of `Account`.
Add an `AuthenticatedAccount` constructor meant to be called from a user application's execution runtime.
Create an `AuthenticatedAccount` to be passed along to the system application later.
Require authentication to be performed while still in the runtime thread.
It's a bug if the authentication is not correctly checked and sent by the system application.
Add an `AuthenticatedAccount` constructor meant to be called from the system application's execution of an operation.
Perform authentication earlier in the code, preparing to pass along a type that indicates authentication was performed.
Change the function signature so that it expects a source account that has already been authenticated.
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.
Motivation
The rules for authentication to access native tokens will be changed soon to make them stricter, preventing access to the chain's balance shared by owners to be transferred by incoming messages. With the goal of making that change simpler and hopefully easier to audit, the authentication for native tokens can be centralized in a single location of the code before it is changed.
Proposal
Create new
AuthenticatedAccount
andAuthenticatedAccountOwner
types that represent in compile time when anAccount
andOption<Owner>
have been successfully authorized to move native tokens.Test Plan
CI should catch any regressions.
Release Plan
Links