Skip to content

Commit

Permalink
AUTH-6000 added options_preflight_bypass to access_applications
Browse files Browse the repository at this point in the history
  • Loading branch information
rkernscloudflaretest committed Apr 15, 2024
1 parent 6ba12b6 commit ac90af4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/1745.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
access_application: support options_preflight_bypass for access_application
```
3 changes: 3 additions & 0 deletions access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type AccessApplication struct {
ServiceAuth401Redirect *bool `json:"service_auth_401_redirect,omitempty"`
PathCookieAttribute *bool `json:"path_cookie_attribute,omitempty"`
AllowAuthenticateViaWarp *bool `json:"allow_authenticate_via_warp,omitempty"`
OptionsPreflightBypass *bool `json:"options_preflight_bypass,omitempty"`
CustomPages []string `json:"custom_pages,omitempty"`
Tags []string `json:"tags,omitempty"`
AccessAppLauncherCustomization
Expand Down Expand Up @@ -181,6 +182,7 @@ type CreateAccessApplicationParams struct {
ServiceAuth401Redirect *bool `json:"service_auth_401_redirect,omitempty"`
SessionDuration string `json:"session_duration,omitempty"`
SkipInterstitial *bool `json:"skip_interstitial,omitempty"`
OptionsPreflightBypass *bool `json:"options_preflight_bypass,omitempty"`
Type AccessApplicationType `json:"type,omitempty"`
AllowAuthenticateViaWarp *bool `json:"allow_authenticate_via_warp,omitempty"`
CustomPages []string `json:"custom_pages,omitempty"`
Expand Down Expand Up @@ -214,6 +216,7 @@ type UpdateAccessApplicationParams struct {
SkipInterstitial *bool `json:"skip_interstitial,omitempty"`
Type AccessApplicationType `json:"type,omitempty"`
AllowAuthenticateViaWarp *bool `json:"allow_authenticate_via_warp,omitempty"`
OptionsPreflightBypass *bool `json:"options_preflight_bypass,omitempty"`
CustomPages []string `json:"custom_pages,omitempty"`
Tags []string `json:"tags,omitempty"`
AccessAppLauncherCustomization
Expand Down
18 changes: 14 additions & 4 deletions access_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func TestAccessApplications(t *testing.T) {
"path_cookie_attribute": true,
"custom_pages": ["480f4f69-1a28-4fdd-9240-1ed29f0ac1dc"],
"tags": ["engineers"],
"allow_authenticate_via_warp": true
"allow_authenticate_via_warp": true,
"options_preflight_bypass": false
}
],
"result_info": {
Expand Down Expand Up @@ -91,6 +92,7 @@ func TestAccessApplications(t *testing.T) {
Tags: []string{"engineers"},
CustomNonIdentityDenyURL: "https://blocked.com",
AllowAuthenticateViaWarp: BoolPtr(true),
OptionsPreflightBypass: BoolPtr(false),
}}

mux.HandleFunc("/accounts/"+testAccountID+"/access/apps", handler)
Expand Down Expand Up @@ -143,7 +145,8 @@ func TestAccessApplication(t *testing.T) {
"service_auth_401_redirect": true,
"http_only_cookie_attribute": false,
"path_cookie_attribute": false,
"allow_authenticate_via_warp": false
"allow_authenticate_via_warp": false,
"options_preflight_bypass": false
}
}
`)
Expand Down Expand Up @@ -175,6 +178,7 @@ func TestAccessApplication(t *testing.T) {
PathCookieAttribute: BoolPtr(false),
CustomNonIdentityDenyURL: "https://blocked.com",
AllowAuthenticateViaWarp: BoolPtr(false),
OptionsPreflightBypass: BoolPtr(false),
}

mux.HandleFunc("/accounts/"+testAccountID+"/access/apps/480f4f69-1a28-4fdd-9240-1ed29f0ac1db", handler)
Expand Down Expand Up @@ -226,7 +230,8 @@ func TestCreateAccessApplications(t *testing.T) {
"app_launcher_visible": true,
"service_auth_401_redirect": true,
"tags": ["engineers"],
"allow_authenticate_via_warp": false
"allow_authenticate_via_warp": false,
"options_preflight_bypass": true
}
}
`)
Expand Down Expand Up @@ -256,6 +261,7 @@ func TestCreateAccessApplications(t *testing.T) {
CustomNonIdentityDenyURL: "https://blocked.com",
Tags: []string{"engineers"},
AllowAuthenticateViaWarp: BoolPtr(false),
OptionsPreflightBypass: BoolPtr(true),
}

mux.HandleFunc("/accounts/"+testAccountID+"/access/apps", handler)
Expand Down Expand Up @@ -315,7 +321,8 @@ func TestUpdateAccessApplication(t *testing.T) {
"app_launcher_visible": true,
"service_auth_401_redirect": true,
"tags": ["engineers"],
"allow_authenticate_via_warp": true
"allow_authenticate_via_warp": true,
"options_preflight_bypass": true
}
}
`)
Expand All @@ -341,6 +348,7 @@ func TestUpdateAccessApplication(t *testing.T) {
Tags: []string{"engineers"},
SkipInterstitial: BoolPtr(true),
AllowAuthenticateViaWarp: BoolPtr(true),
OptionsPreflightBypass: BoolPtr(true),
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
}
Expand All @@ -365,6 +373,7 @@ func TestUpdateAccessApplication(t *testing.T) {
CustomNonIdentityDenyURL: "https://blocked.com",
Tags: []string{"engineers"},
AllowAuthenticateViaWarp: BoolPtr(true),
OptionsPreflightBypass: BoolPtr(true),
}

mux.HandleFunc("/accounts/"+testAccountID+"/access/apps/480f4f69-1a28-4fdd-9240-1ed29f0ac1db", handler)
Expand Down Expand Up @@ -395,6 +404,7 @@ func TestUpdateAccessApplication(t *testing.T) {
LogoURL: "https://www.example.com/example.png",
SkipInterstitial: BoolPtr(true),
CustomNonIdentityDenyURL: "https://blocked.com",
OptionsPreflightBypass: BoolPtr(true),
})

if assert.NoError(t, err) {
Expand Down

0 comments on commit ac90af4

Please sign in to comment.