Repository: cloudflare/cloudflare-go
Pull request #2793 (2024-07-29 14:36:54)

feat: add flag to skip the app launcher landing pg
<!-- 
Provide a general summary of your changes in the title above. You should
remove this overview, any sections and any section descriptions you
don't need below before submitting. There isn't a strict requirement to
use this template if you can structure your description and still cover
these points. 
-->

## Description

A new flag, `skip_app_launcher_login_page`, is now available which can be toggled to skip the App Launcher landing page a.k.a. the page that is shown to users when they visit their auth. domain i.e. `<team>.cloudflareaccess.com`.

This flag is documented for an app of the type `App Launcher App` at https://developers.cloudflare.com/api/operations/access-applications-add-an-application: 

> ![image](https://github.com/user-attachments/assets/3ee829d7-9250-4012-89d1-d8a64eb2947b)

This flag is a part of Access and is an App Launcher customization property.

<!--
Describe your changes in detail through motivation and context. Why is
this change required? What problem does it solve? If it fixes an open
issue, link to the issue using GitHub's closing issues keywords[1].
-->
## Has your change been tested?

The unit test to test the creation of an App Launcher application has been updated to include the `skip_app_launcher_login_page` flag.

<!--
Explain how the change has been tested and what you ran to confirm your
change affects other parts of the code. Automated tests are generally
expected and changes without tests should explain why they aren't
required.
-->

## Screenshots (if appropriate):

Screenshots N/A. 

## 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 in [cloudflare/api-schemas](https://github.com/cloudflare/api-schemas) 
      and relies on stable APIs.

[1]: https://help.github.com/articles/closing-issues-using-keywords/


github-actions[bot]: Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example: 

~~~
```release-note:TYPE
Release note
```
~~~

If you do not require a release note to be included, please add the `workflow/skip-changelog-entry` label.

Patch:
diff --git a/.changelog/2793.txt b/.changelog/2793.txt
new file mode 100644
index 000000000..af48c2452
--- /dev/null
+++ b/.changelog/2793.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+access_application: add `skip_app_launcher_login_page` flag to skip the App Launcher landing page
+```
diff --git a/access_application.go b/access_application.go
index bdeaf79cd..ec1dfcc62 100644
--- a/access_application.go
+++ b/access_application.go
@@ -250,11 +250,12 @@ type SaasApplication struct {
 }
 
 type AccessAppLauncherCustomization struct {
-	LandingPageDesign     AccessLandingPageDesign `json:"landing_page_design"`
-	LogoURL               string                  `json:"app_launcher_logo_url"`
-	HeaderBackgroundColor string                  `json:"header_bg_color"`
-	BackgroundColor       string                  `json:"bg_color"`
-	FooterLinks           []AccessFooterLink      `json:"footer_links"`
+	LandingPageDesign        AccessLandingPageDesign `json:"landing_page_design"`
+	LogoURL                  string                  `json:"app_launcher_logo_url"`
+	HeaderBackgroundColor    string                  `json:"header_bg_color"`
+	BackgroundColor          string                  `json:"bg_color"`
+	FooterLinks              []AccessFooterLink      `json:"footer_links"`
+	SkipAppLauncherLoginPage *bool                   `json:"skip_app_launcher_login_page,omitempty"`
 }
 
 type AccessFooterLink struct {


Test patch:
diff --git a/access_application_test.go b/access_application_test.go
index 178386395..d43085608 100644
--- a/access_application_test.go
+++ b/access_application_test.go
@@ -1292,7 +1292,8 @@ func TestCreateApplicationWithAccessAppLauncherCustomization(t *testing.T) {
 						"url": "https://somesite.com",
 						"name": "bug"
 					}
-				]
+				],
+				"skip_app_launcher_login_page": true
 			}
 		}
 		`)
@@ -1332,6 +1333,7 @@ func TestCreateApplicationWithAccessAppLauncherCustomization(t *testing.T) {
 					Name: "bug",
 				},
 			},
+			SkipAppLauncherLoginPage: BoolPtr(true),
 		},
 	}
 
@@ -1357,6 +1359,7 @@ func TestCreateApplicationWithAccessAppLauncherCustomization(t *testing.T) {
 					Name: "bug",
 				},
 			},
+			SkipAppLauncherLoginPage: BoolPtr(true),
 		},
 	})