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

fix: skip commit id and sync for signing keys #893

Merged
merged 6 commits into from
Sep 12, 2022
Merged

Conversation

murali-shris
Copy link
Member

- What I did

  • prevent commit id increment for signing keys
    - How I did it
  • modified at_commit_log.dart --> commit method to return -1 for public:signing_publickey and signing_privatekey
  • modified_isRegexMatches in commit_log_keystore.dart to remove signing private key
  • added unit tests to commit_log_test.dart
    - How to verify it
  • run the persistence unit tests

gkc
gkc previously requested changes Sep 5, 2022
key.startsWith(RegExp('private:|privatekey:|public:_'))) {
(key.startsWith(RegExp(
'private:|privatekey:|public:_|public:signing_publickey')) ||
key.contains(AT_SIGNING_PRIVATE_KEY))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use of contains seems potentially buggy. Why not an exact match?

Copy link
Member Author

Choose a reason for hiding this comment

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

format of the key is <current_atsign>:signing_privatekey<current_atsign>

Copy link
Member Author

Choose a reason for hiding this comment

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

key.startsWith(RegExp('@(?<sharedWith>.*):signing_privatekey@(?<sharedBy>.*)'))

is this fine?

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@@ -341,8 +341,7 @@ class CommitLogKeyStore
if ((RegExp(regex).hasMatch(atKey)) ||
atKey.contains(AT_ENCRYPTION_SHARED_KEY) ||
Copy link
Member

Choose a reason for hiding this comment

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

Should we refactor this to:

match = _isRegexMatches() || _isSpecialKey();

_isSpecialKey contains checking for special keys

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah..sounds good.i will make the changes

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.

None yet

3 participants