Repository: cloudflare/cloudflare-go
Pull request #1223 (2023-02-28 15:06:09)

Adds new attr to Access App model - path_cookie_attribute
## Description

Adds path_cookie_attribute to Access Applications

## Types of changes

What sort of change does your code introduce/modify?

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

[1]: https://help.github.com/articles/closing-issues-using-keywords/



Patch:
diff --git a/.changelog/1223.txt b/.changelog/1223.txt
new file mode 100644
index 000000000..e046c338b
--- /dev/null
+++ b/.changelog/1223.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+access_application: Add `path_cookie_attribute` app setting
+```
\ No newline at end of file
diff --git a/access_application.go b/access_application.go
index 9b5a6aac9..e627fca27 100644
--- a/access_application.go
+++ b/access_application.go
@@ -48,6 +48,7 @@ type AccessApplication struct {
 	EnableBindingCookie     *bool                          `json:"enable_binding_cookie,omitempty"`
 	HttpOnlyCookieAttribute *bool                          `json:"http_only_cookie_attribute,omitempty"`
 	ServiceAuth401Redirect  *bool                          `json:"service_auth_401_redirect,omitempty"`
+	PathCookieAttribute     *bool                          `json:"path_cookie_attribute,omitempty"`
 }
 
 type AccessApplicationGatewayRule struct {


Test patch:
diff --git a/access_application_test.go b/access_application_test.go
index 608bd77e4..ce488347d 100644
--- a/access_application_test.go
+++ b/access_application_test.go
@@ -41,7 +41,8 @@ func TestAccessApplications(t *testing.T) {
 					"logo_url": "https://www.example.com/example.png",
 					"skip_interstitial": true,
 					"app_launcher_visible": true,
-					"service_auth_401_redirect": true
+					"service_auth_401_redirect": true,
+					"path_cookie_attribute": true
 				}
 			],
 			"result_info": {
@@ -77,6 +78,7 @@ func TestAccessApplications(t *testing.T) {
 		HttpOnlyCookieAttribute: BoolPtr(true),
 		LogoURL:                 "https://www.example.com/example.png",
 		SkipInterstitial:        BoolPtr(true),
+		PathCookieAttribute:     BoolPtr(true),
 	}}
 
 	mux.HandleFunc("/accounts/"+testAccountID+"/access/apps", handler)
@@ -125,7 +127,8 @@ func TestAccessApplication(t *testing.T) {
 				"skip_interstitial": true,
 				"app_launcher_visible": true,
 				"service_auth_401_redirect": true,
-				"http_only_cookie_attribute": false
+				"http_only_cookie_attribute": false,
+				"path_cookie_attribute": false
 			}
 		}
 		`)
@@ -153,6 +156,7 @@ func TestAccessApplication(t *testing.T) {
 		LogoURL:                 "https://www.example.com/example.png",
 		SkipInterstitial:        BoolPtr(true),
 		HttpOnlyCookieAttribute: BoolPtr(false),
+		PathCookieAttribute:     BoolPtr(false),
 	}
 
 	mux.HandleFunc("/accounts/"+testAccountID+"/access/apps/480f4f69-1a28-4fdd-9240-1ed29f0ac1db", handler)