aws-greengrass / aws-greengrass-client-device-auth

Apache License 2.0
2 stars 3 forks source link

feat: single character wildcard matching #437

Open jcosentino11 opened 3 weeks ago

jcosentino11 commented 3 weeks ago

Issue #, if available:

Description of changes:

⚠️ WIP: still ironing out bugs

Adds new configuration option enableSingleCharacterWildcardMatching to allow ? matching in CDA policy resources. ? will match any single character, similar to how IoT Core handles it (https://docs.aws.amazon.com/iot/latest/developerguide/pub-sub-policy.html#pub-sub-policy-cert). Reason for flag is to ensure CDA version upgrade doesn't make policies already containing a ? more permissive than originally intended.

Why is this change necessary:

To maintain feature parity with IoT Core

How was this change tested:

Unit and 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.

github-actions[bot] commented 3 weeks ago

Benchmark Results

Benchmark Score
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_thing_name_variable_WHEN_auth_request_THEN_successful_auth 1265720.93 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_wildcards_WHEN_auth_request_THEN_successful_auth 160693.88 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_single_group_permission_WHEN_simple_auth_request_THEN_successful_auth 2503156.18 ops/s