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

Add Cacheable URLs for FeatureModFiles #638

Merged
merged 6 commits into from
Aug 13, 2022

Conversation

Sheikah45
Copy link
Member

This adds separation of the hmac token, param, and a cacheable url so that clients can send the hmac verification as a request header which allows caching of the request in cloudflare since there is no longer any query parameters

@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #638 (42b3281) into develop (436a4b0) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 42b3281 differs from pull request most recent head aa65114. Consider uploading reports for the commit aa65114 to get more accurate results

@@              Coverage Diff              @@
##             develop     #638      +/-   ##
=============================================
+ Coverage      76.19%   76.25%   +0.05%     
- Complexity      1162     1166       +4     
=============================================
  Files            244      245       +1     
  Lines           3684     3693       +9     
  Branches         232      232              
=============================================
+ Hits            2807     2816       +9     
  Misses           780      780              
  Partials          97       97              
Impacted Files Coverage Δ
...om/faforever/api/cloudflare/CloudflareService.java 100.00% <100.00%> (ø)
...om/faforever/api/featuredmods/FeaturedModFile.java 100.00% <100.00%> (ø)
...ever/api/featuredmods/FeaturedModFileEnricher.java 100.00% <100.00%> (ø)
...rever/api/featuredmods/FeaturedModsController.java 85.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 436a4b0...aa65114. Read the comment docs.

Comment on lines 45 to 46
Mac mac = Mac.getInstance(HMAC_SHA256);
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256));
Copy link
Member

Choose a reason for hiding this comment

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

this should be done on initializing the bean

Copy link
Member Author

Choose a reason for hiding this comment

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

ah good point

@Sheikah45
Copy link
Member Author

@Brutus5000 is this good now?

@Sheikah45 Sheikah45 merged commit e1b6edc into develop Aug 13, 2022
@Sheikah45 Sheikah45 deleted the feature/hmac-featured-mod-token branch August 13, 2022 18:08
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