-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix: Update the error message and add skip commit for enrollment key deletion #2117
Conversation
|
@gkc : Yes, when we add the enrollments we have a skipCommit set to true. Attaching the code snippet below from the "EnrollmentManager.dart" . As for point # 2, Correct, I meant that there should be no syncing between the client and server Future<void> put(String enrollmentId, AtData atData) async {
String enrollmentKey = buildEnrollmentKey(enrollmentId);
await _keyStore.put(enrollmentKey, atData, skipCommit: true);
} |
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.
Thanks @sitaram-kalluri
Please add unit test(s) which check commit log state after the various enrollment operations
Sure, @gkc |
// public:appName.deviceName.pkam.__pkams.__public_keys@atSign key. Therefore, | ||
// commit log has an entry. | ||
expect( | ||
itr.current.key.contains('pkam.__pkams.__public_keys$alice'), true); |
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.
please do a more precise check including the appName and deviceName being used
} | ||
// Ensure there are no other keys in the commit log. | ||
expect(itr.moveNext(), false); | ||
expect(itr!.moveNext(), false); |
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.
The EnrollVerbHandler is not requesting to skip the commit when storing this key. So in theory this test is required - but I believe the commit log is not currently being updated because of this #2115
So - we should probably explicitly change the EnrollVerbHandler so that it skips the commit log when storing this public key also, since these are not things that need to be synced to clients and, indeed, currently are not synced - but would start syncing if #2115 were merged
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.
Specifically add skipCommit: true
to the calls to keyStore.put which are being made on lines 257 and 362 in enroll_verb_handler.dart
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.
- Set skipCommit to true and modified unit and functional tests accordingly.
- Also did a round of manual testing with at_onboarding_cli to approve the enrollment request and use the new apkam keys authenticate the connection.
@@ -121,7 +121,7 @@ void main() { | |||
expect( | |||
int.parse( | |||
jsonDecode(statsResponse.replaceAll('data:', ''))[0]['value']), | |||
lastCommitIdBeforeUpdate + 4); | |||
lastCommitIdBeforeUpdate + 3); |
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.
Since akamPublicKeys are not logged into the commit log, reduced value to 3.
- What I did
- How to verify it