Skip to content

Commit

Permalink
Update version and cloudfront
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhpalp committed May 13, 2024
1 parent 2a23b7d commit 0257162
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.2.0</version>
<version>2.2.1</version>
<packaging>pom</packaging>
<name>wfnews-parent</name>
<modules>
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>wfnews-ear</artifactId>
<packaging>ear</packaging>
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>wfnews-war</artifactId>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
INFOPLIST_KEY_CFBundleDisplayName = "BC Wildfire";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = ca.bc.gov.WildfireInformation;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -389,7 +389,7 @@
INFOPLIST_KEY_CFBundleDisplayName = "BC Wildfire";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = ca.bc.gov.WildfireInformation;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-war/src/main/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wildfire",
"version": "2.2.0",
"version": "2.2.1",
"license": "MIT",
"engines": {
"node": "^14.20.0 || ^16.13.0 || ^18.10.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"application": {
"wfnewsApiKey": "fake-api-key",
"acronym": "WFNEWS",
"version": "2.2.0-SNAPSHOT",
"version": "2.2.1",
"buildNumber": ".0000",
"environment": "LOCAL",
"baseUrl": "http://localhost:6200/",
Expand Down
111 changes: 109 additions & 2 deletions terraform/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ resource "aws_cloudfront_distribution" "wfnews_openmaps_cache" {
}
}

response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers_no_auth_cors.id

viewer_protocol_policy = "redirect-to-https"
min_ttl = 0
Expand Down Expand Up @@ -1021,6 +1021,114 @@ output "wfnews_cloudfront_nginx_url" {

resource "aws_cloudfront_response_headers_policy" "cache_control_response_headers" {
name = "cache-control-response-headers-${var.target_env}"
custom_headers_config {
items {
header = "Cache-Control"
override = true
value = "stale-while-revalidate=600"
}
}

remove_headers_config {
items {
header = "X-Forwarded-Server"
}

items {
header = "X-Forwarded-Host"
}

items {
header = "X-Host"
}
}
}

resource "aws_cloudfront_response_headers_policy" "cache_control_response_headers_no_auth_cors" {
name = "cache-control-response-headers-no-auth-cors-${var.target_env}"
cors_config {
access_control_allow_credentials = false

access_control_allow_headers {
items = ["*"]
}

access_control_allow_methods {
items = ["GET", "POST", "PUT", "HEAD", "OPTIONS", "PATCH", "DELETE"]
}

access_control_allow_origins {
items = ["*"]
}

access_control_max_age_sec = 300

origin_override = true
}

custom_headers_config {
items {
header = "Cache-Control"
override = true
value = "stale-while-revalidate=600"
}
}

remove_headers_config {
items {
header = "X-Forwarded-Server"
}

items {
header = "X-Forwarded-Host"
}

items {
header = "X-Host"
}
}
}

resource "aws_cloudfront_response_headers_policy" "cache_control_response_headers_auth_cors" {
name = "cache-control-response-headers-auth-cors-${var.target_env}"
cors_config {
access_control_allow_credentials = true

access_control_allow_headers {
items = [
"Accept",
"Accept-Encoding",
"Accept-Language",
"Cache-Control",
"Origin",
"Pragma",
"Priority",
"Referer",
"Apikey",
"Authorization",
"Content-Type"
]
}

access_control_allow_methods {
items = ["GET", "POST", "PUT", "HEAD", "OPTIONS", "PATCH", "DELETE"]
}

access_control_allow_origins {
items = [
"capacitor://localhost",
"http://localhost",
"https://localhost",
"https://wfnews-client.dev.bcwildfireservices.com",
"https://wfnews-client.test.bcwildfireservices.com",
"https://wildfiresituation.nrs.gov.bc.ca"
]
}

access_control_max_age_sec = 300

origin_override = true
}

custom_headers_config {
items {
Expand Down Expand Up @@ -1062,4 +1170,3 @@ resource "aws_cloudfront_response_headers_policy" "strip-vulnerable-headers" {
}
}
}

0 comments on commit 0257162

Please sign in to comment.