Skip to content
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

Walletlib: Multi Account Auth Repo #753

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

Funkatronics
Copy link
Contributor

@Funkatronics Funkatronics commented Mar 20, 2024

This PR addresses what should be the final refactor update to support multi-account through the entire MWA SDK stack. (#44 & #438)

The walletlib sdk authentication repository has been updated to support multiple authorized accounts (publickeys) per AuthRecord. The rest of the SDK stack was previously updated to support a list of accounts for each auth request.

Note: sample apps still need to be updated to demonstrate the use of multiple accounts in a session

Copy link
Contributor

@Michaelsulistio Michaelsulistio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding, summarizing the changes:

  • Add the parentId field to an Account
  • Add DB migration code for version 5/6
  • Add multi account to AuthRepo
  • Add multi account API to onComplete methods

Changes look good and make sense to me from a high level.Thorough testing with an example app would help reveal any issues.

@Nullable String[] chains, @Nullable String[] features);

// @Nullable
// List<AccountRecord> query(int parentId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentionally commented out?

// migrate to multi account structure
Log.w(TAG, "Old database schema detected; pre-v2.1.0, migrating to multi account structure");

// try (final Cursor cursor = db.rawQuery("SELECT " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally left commented?

/* package */ class AccountRecord {
@IntRange(from = 1)
final int id;

@IntRange(from = 1)
final int parentId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, the parentId of an account will always be the id of the "authRecord" that the account is associated with, correct?

Curios, why its called parentId instead of authRecordId? Is there another possible value it can be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to align with the schema. Parent id is used to indicate that this is a subtable

@Funkatronics Funkatronics merged commit 31055cc into main Mar 27, 2024
5 checks passed
@Funkatronics Funkatronics deleted the auth-repo-multi-account branch March 27, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants