-
Notifications
You must be signed in to change notification settings - Fork 221
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
Add validator to check consistency of resource name used for IamResource #1819
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtdowling
requested changes
Jun 14, 2023
...raits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator
Outdated
Show resolved
Hide resolved
...iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/IamResourceValidatorTest.java
Outdated
Show resolved
Hide resolved
...am-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java
Outdated
Show resolved
Hide resolved
...am-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java
Outdated
Show resolved
Hide resolved
...am-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java
Outdated
Show resolved
Hide resolved
...am-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java
Outdated
Show resolved
Hide resolved
...am-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java
Outdated
Show resolved
Hide resolved
…/iam/traits/IamResourceTraitValidator.java Co-authored-by: Michael Dowling <[email protected]>
…/iam/traits/IamResourceTraitValidator.java Co-authored-by: Michael Dowling <[email protected]>
This reverts commit 3753ac2.
srchase
approved these changes
Jun 20, 2023
jvschneid
added a commit
to jvschneid/smithy
that referenced
this pull request
Jun 22, 2023
…IamResource (smithy-lang#1819)" This reverts commit 436942e.
syall
pushed a commit
to Xtansia/smithy
that referenced
this pull request
Aug 11, 2023
…rce (smithy-lang#1819) * Add validator to check consistency of resource name used for IamResource * Update arn parsing method to be private * Update smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java Co-authored-by: Michael Dowling <[email protected]> * Update smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/IamResourceTraitValidator.java Co-authored-by: Michael Dowling <[email protected]> * Address PR comments * Add errorfiles test runner * Revert "Address PR comments" This reverts commit 3753ac2. * Re-add changes without accidentally popped stashed changes * Update to use orElseGet * Re-add change that was accidentally removed * Add newline at end of file --------- Co-authored-by: Michael Dowling <[email protected]>
syall
pushed a commit
to Xtansia/smithy
that referenced
this pull request
Aug 11, 2023
…IamResource (smithy-lang#1819)" This reverts commit 436942e.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The
IamResource
trait indicates properties of a Smithy resource in AWS IAM. If noname
parameter is provided to theIamResource
trait then a shape's IamResource name is assumed to just be the resource's name, otherwise thename
parameter is used.The name of an IamResource is expected to match the name of the resource in the resource's ARN. For examples if the resource has an arn trait of
@arn(template: "my-shape")
then theIamResource
name should be"my-shape"
for that resource.Description of changes:
IamResource
trait is consistent with the resource name in the resource's ARN templateNote: This validator throws a DANGER event instead of an ERROR so that the validation event can be suppressed if needed for backwards compatibility.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.