-
Notifications
You must be signed in to change notification settings - Fork 11
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: stricter regex for reserved keys #445
Conversation
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 work!
I see atsign-foundation/at_client_sdk#1161 which demonstrates that at_client has / is being tested against this PR - very good. (Note: should test all packages which use at_commons to ensure no breakages anywhere else.)
However, it looks like we have a breaking change; the at_client PR testing shows that the current at_client will fail if using this version of at_commons. Please can you see if there's a reasonable way to avoid a breaking change? if not then we need to bump the major version of at_commons to 4
The only way we could avoid a breaking change would be to have a secondary check using the old regex in addition to a check with the new one. This would preserve backward compatibility but at the same time undermine the new regex. What do you think @gkc ? |
Thanks @srieteja - I think we should bump the major version. |
@purnimavenkatasubbu and I have completed another round of testing with buzz and onboarding_cli; everything looks good with the new regex. Also, I have increased the version to 4.0.0 and updated the changelog as part of 6816bf9. |
# Conflicts: # packages/at_commons/CHANGELOG.md # packages/at_commons/pubspec.yaml
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.
LGTM - thank you @srieteja and @purnimavenkatasubbu
Closes #437
- What I did
- How I did it
These twogroups have their own regex and all these regexes are joined using an "OR" operator
Made sure that the visibility of each key (public/private/shared) is also explicitly mentioned in the regex
Introduced a new method 'isPartalMatch()' in class Regexutil that does not require a full string match (only for reserved keys). This is required as the public/private part of the key is a lookahead and will not be matched as part of the key
- How to verify it
- Description for the changelog
fix: stricter regex for reserved keys