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

Feature/improve arn parsing and IAM Policy testability #1080

Merged
merged 4 commits into from
Oct 23, 2022

Conversation

PeterKneale
Copy link
Contributor

  • I noticed SnsPolicy.cs was using regex to parse the source ARN instead of using Amazons supplied ARN.Parse(..) method.
  • Before changing this I separated the two responsibilities of generating and applying the policy
  • This allowed me to add an approval test against the IAM policy generated
  • Then I made the actual change and introduced ARN.Parse(..) and observed no regressions.
  • I also added a mechanism to validate the ARN I saw elsewhere.

@PeterKneale PeterKneale requested a review from a team as a code owner October 23, 2022 16:39
@PeterKneale
Copy link
Contributor Author

Is this sort of small improvement okay to add without a ticket - Please let me know if I overstep :)

@codecov
Copy link

codecov bot commented Oct 23, 2022

Codecov Report

Merging #1080 (967198c) into main (e74693d) will increase coverage by 1.30%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##             main    #1080      +/-   ##
==========================================
+ Coverage   84.80%   86.11%   +1.30%     
==========================================
  Files         135      136       +1     
  Lines        3298     3299       +1     
==========================================
+ Hits         2797     2841      +44     
+ Misses        501      458      -43     
Flag Coverage Δ
linux 86.11% <97.50%> (+1.30%) ⬆️
macos 52.58% <97.50%> (+0.86%) ⬆️
windows 52.95% <97.50%> (+1.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/JustSaying/AwsTools/MessageHandling/SnsPolicy.cs 0.00% <0.00%> (ø)
...aying/AwsTools/MessageHandling/SnsPolicyBuilder.cs 100.00% <100.00%> (ø)
...ng/Middleware/ExactlyOnce/ExactlyOnceMiddleware.cs 77.77% <0.00%> (-14.82%) ⬇️
src/JustSaying/JustSayingBus.cs 95.80% <0.00%> (ø)
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs 83.72% <0.00%> (ø)
...rc/JustSaying/Fluent/TopicSubscriptionBuilder`1.cs 86.56% <0.00%> (ø)
...ing/AwsTools/QueueCreation/ServerSideEncryption.cs 100.00% <0.00%> (ø)
...AwsTools/MessageHandling/Dispatch/MiddlewareMap.cs 85.18% <0.00%> (ø)
...nt/PublishConfig/StaticPublicationConfiguration.cs 95.23% <0.00%> (ø)
...t/PublishConfig/DynamicPublicationConfiguration.cs 100.00% <0.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@PeterKneale
Copy link
Contributor Author

I can do the same for SqsPolicy if desired

Copy link
Member

@slang25 slang25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@slang25
Copy link
Member

slang25 commented Oct 23, 2022

Thanks for this @PeterKneale, these improvements are always appreciated 🙂. We don't mind skipping issues when there isn't a design discussion to be had.

@slang25 slang25 merged commit 3fe82a5 into justeattakeaway:main Oct 23, 2022
@PeterKneale PeterKneale deleted the feature/Improve_arn_parsing branch October 23, 2022 21:55
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