atsign-foundation / at_libraries

Support libraries & dependencies for Atsign's technology
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
38 stars 11 forks source link

fix: save enrollment details to local keystore #599

Closed murali-shris closed 1 month ago

murali-shris commented 2 months ago

Closes https://github.com/atsign-foundation/at_libraries/issues/556 Enroll details are needed in local storage for at_client to perform enrollment authorization checks for local secondary verbs. While we started implementing authorization checks in at_client, we wanted to use enroll:fetch instead of local key to get enrollment details. But enroll:fetch approach will not work for 1) offline at_client 2) every verb operation will result in remote call. So we decided to store a local key for enrollment details

- What I did

- How to verify it

- Description for the changelog

fix: save enrollment details to local keystore

srieteja commented 1 month ago

waiting for https://github.com/atsign-foundation/at_libraries/pull/606 to be merged into this branch.

gkc commented 1 month ago

waiting for #606 to be merged into this branch.

606 has been merged to trunk

gkc commented 1 month ago

waiting for #606 to be merged into this branch.

606 has been merged to trunk

@srieteja I'll resolve the merge conflicts and merge trunk into this branch

srieteja commented 1 month ago

@gkc once the conflicts are resolved, functional tests will fail as a result of changes. Working on updating them

gkc commented 1 month ago

@gkc once the conflicts are resolved, functional tests will fail as a result of changes. Working on updating them

I've fixed all the ripple effects and pushed to the branch

murali-shris commented 1 month ago
  1. The PR description explains what has been done, but not why. Please add an explanation of the problem that is being addressed here (or link to a ticket which has that explanation).
  2. This PR handles writing to the keystore ... is the intent that there will be code elsewhere which reads this information from the keystore?
  3. The information is currently written to '${enrollmentResponse.enrollmentId}.new.enrollments.__manage${atClient!.getCurrentAtSign()}'
  • Given that this is purely for local client-side use, we should use a local key
  • And we should not be using the __manage namespace

1) added to the PR description 2) the local key which stores the enrollment details will be read from LocalSecondary --> isEnrollmentAuthorizedForOperation(..) in at_client 3) agreed. Will make the change