-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: wildcard support #390
Conversation
Unit Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 8a8e202 |
src/main/java/com/aws/greengrass/clientdevices/auth/PermissionEvaluationUtils.java
Outdated
Show resolved
Hide resolved
cec82af
to
b376566
Compare
...eengrass/integrationtests/deviceauth/EvaluateClientDeviceActionsWithPolicyVariablesTest.java
Outdated
Show resolved
Hide resolved
...integrationtests/java/com/aws/greengrass/integrationtests/deviceauth/PolicyWildcardTest.java
Outdated
Show resolved
Hide resolved
d4d920a
to
611f7c9
Compare
src/integrationtests/java/com/aws/greengrass/integrationtests/policy/PolicyTest.java
Dismissed
Show dismissed
Hide dismissed
Code Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 50fc7c1 |
Benchmark Results
|
Can you do a profile and see if there's anything you can do about the performance? This is significantly slower than the non wildcard tests according to the benchmark. |
Does this change work with the policy variables too, can you mix both? |
src/main/java/com/aws/greengrass/clientdevices/auth/PermissionEvaluationUtils.java
Outdated
Show resolved
Hide resolved
yep there's an integ test for it. would like to add more coverage, but wanted to do some refactoring of existing unit tests first in separate change |
noticed that trie is using a synchronized map, can explore if using non synchronized would have significant impact |
Where do you see any synchronized? WildcardTrie uses a concurrent hashmap which is nearly lock free. |
ah, intellij profile shows constructino of WildcardTrie is what's eating up the time, initializing children map |
saw concurrent and assumed locks 😓 |
src/main/java/com/aws/greengrass/clientdevices/auth/util/WildcardTrie.java
Outdated
Show resolved
Hide resolved
src/main/java/com/aws/greengrass/clientdevices/auth/util/WildcardTrie.java
Outdated
Show resolved
Hide resolved
src/main/java/com/aws/greengrass/clientdevices/auth/util/WildcardTrie.java
Outdated
Show resolved
Hide resolved
other hotspots include
|
And marking down previous ops/s before comment gets overwritten: 174675 |
src/main/java/com/aws/greengrass/clientdevices/auth/PermissionEvaluationUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/com/aws/greengrass/clientdevices/auth/util/WildcardTrie.java
Outdated
Show resolved
Hide resolved
af4ddfe
to
11cefdc
Compare
Issue #, if available:
Description of changes:
Allow policy resources with wildcards, such as "mqtt:topic:my*". Matching is done via
WildcardTrie
.Also refactored policy-related integration tests
Why is this change necessary:
How was this change tested:
Integration tests
Any additional information or context required to review the change:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.