-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add helper functions to sign authorization entries. #537
Add helper functions to sign authorization entries. #537
Conversation
Hi @sreuland, let's include this PR in the new release. |
/** This class contains helper methods to sign {@link SorobanAuthorizationEntry}. */ | ||
public class Auth { | ||
/** | ||
* Actually authorizes an existing authorization entry using the given the credentials and |
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.
for consideration in a later pr, could remove this duplicated docs by using @see
instead:
/**
* @see Auth#authorizeEntry(String, KeyPair, Long, Network) authorizeEntry
*/
and maybe re-evaluate the overloaded signatures of authorizeEntry
and see if that can be narrowed?
} | ||
|
||
/** An interface for signing a {@link HashIDPreimage} to produce a signature. */ | ||
public interface Signer { |
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.
nice usage of functional interface!
} | ||
|
||
@Test | ||
public void testSignAuthorizeEntryWithBase64EntryAndFunctionSigner() throws IOException { |
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.
for consideration later, the duplicate test case variants for base64 and xdr object graph parameters could probably be reduced to just the base64 parameters, as that will by default exercise the xdr object path internally as well correct? would just. be less test code to maintain over time.
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.
Yes, I will remove it later.
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.
great work, lot of complexity to auth, looks clean.
Closes #489
The following is an example.