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

feat: add thing attribute variable support #434

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jcosentino11
Copy link
Member

@jcosentino11 jcosentino11 commented Jun 27, 2024

Issue #, if available:

#433

Description of changes:

Adds support for ${iot:Connection.Thing.Attributes[MyAttribute]} resource policy variables, similar to our existing ${iot:Connection.Thing.ThingName}.

Attributes are fetched from cloud on startup (and periodically) and are cached. Policy evaluation uses cached attributes.

TODO:

  • remove persisted data for unassociated things
  • error message to suggest increasing startup timeout if unable to fetch device descriptions in time

Why is this change necessary:

How was this change tested:

Integration tests, UATs to follow to actually test cloud interactions.

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.

Copy link

github-actions bot commented Jun 27, 2024

Benchmark Results

Benchmark Score
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_thing_name_variable_WHEN_auth_request_THEN_successful_auth 1080583.99 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_wildcards_WHEN_auth_request_THEN_successful_auth 207529.14 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_single_group_permission_WHEN_simple_auth_request_THEN_successful_auth 2465261.96 ops/s

@jcosentino11 jcosentino11 force-pushed the thing-attr-var-support branch 3 times, most recently from b54a027 to 84cc9ff Compare June 27, 2024 21:58
Copy link

github-actions bot commented Jun 28, 2024

Code Coverage Report

File Coverage
All files 73%

Minimum allowed coverage is 50%

Generated by 🐒 cobertura-action against 3642a32

@jcosentino11 jcosentino11 force-pushed the thing-attr-var-support branch 3 times, most recently from 3749ce4 to f974da4 Compare June 28, 2024 20:51
@jcosentino11 jcosentino11 marked this pull request as ready for review June 28, 2024 23:22
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.

2 participants