Skip to content

Commit

Permalink
Update Access applications and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin-Holmes committed Mar 30, 2022
1 parent 7fa2f29 commit 8fbcbb8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cloudflare/resource_cloudflare_access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func resourceCloudflareAccessApplicationCreate(d *schema.ResourceData, meta inte
LogoURL: d.Get("logo_url").(string),
SkipInterstitial: d.Get("skip_interstitial").(bool),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
ServiceAuth401Redirect: d.Get("service_auth_401_redirect").(bool),
}

if len(allowedIDPList) > 0 {
Expand Down Expand Up @@ -118,6 +119,7 @@ func resourceCloudflareAccessApplicationRead(d *schema.ResourceData, meta interf
d.Set("skip_interstitial", accessApplication.SkipInterstitial)
d.Set("logo_url", accessApplication.LogoURL)
d.Set("app_launcher_visible", accessApplication.AppLauncherVisible)
d.Set("service_auth_401_redirect", accessApplication.ServiceAuth401Redirect)

corsConfig := convertCORSStructToSchema(d, accessApplication.CorsHeaders)
if corsConfigErr := d.Set("cors_headers", corsConfig); corsConfigErr != nil {
Expand Down Expand Up @@ -148,6 +150,7 @@ func resourceCloudflareAccessApplicationUpdate(d *schema.ResourceData, meta inte
LogoURL: d.Get("logo_url").(string),
SkipInterstitial: d.Get("skip_interstitial").(bool),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
ServiceAuth401Redirect: d.Get("service_auth_401_redirect").(bool),
}

if len(allowedIDPList) > 0 {
Expand Down
5 changes: 5 additions & 0 deletions cloudflare/schema_cloudflare_access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ func resourceCloudflareAccessApplicationSchema() map[string]*schema.Schema {
Optional: true,
Default: true,
},
"service_auth_401_redirect": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
}
}

Expand Down
23 changes: 16 additions & 7 deletions website/docs/r/access_application.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ The following arguments are supported:
* `cors_headers` - (Optional) CORS configuration for the Access Application. See
below for reference structure.
* `allowed_idps` - (Optional) The identity providers selected for the application.
* `auto_redirect_to_identity` - (Optional) Option to skip identity provider
selection if only one is configured in allowed_idps. Defaults to `false`
(disabled).
* `enable_binding_cookie` - (Optional) Option to provide increased security against compromised authorization tokens and CSRF attacks by requiring an additional "binding" cookie on requests. Defaults to `false`.
* `custom_deny_message` - (Optional) Option that returns a custom error message when a user is denied access to the application.
* `custom_deny_url` - (Optional) Option that redirects to a custom URL when a user is denied access to the application.
* `app_launcher_visible` - (Optional) Option to show/hide applications in App Launcher. Defaults to `true`.
* `skip_interstitial` - (Optional) Option to skip the authorization interstitial
when using the CLI.
* `logo_url` - (Optional) Image URL for the logo shown in the app launcher
dashboard.
* `same_site_cookie_attribute` - (Optional) Defines the same-site cookie setting
for access tokens. Valid values are `none`, `lax`, and `strict`.
* `http_only_cookie_attribute` - (Optional) Option to add the `HttpOnly` cookie flag to access tokens.
* `service_auth_401_redirect` - (Optional) Option to return a 401 status code in
service authentication rules on failed requests.

**cors_headers** allows the following:

Expand All @@ -76,13 +92,6 @@ The following arguments are supported:
requests.
* `max_age` - (Optional) Integer representing the maximum time a preflight
request will be cached.
* `auto_redirect_to_identity` - (Optional) Option to skip identity provider
selection if only one is configured in allowed_idps. Defaults to `false`
(disabled).
* `enable_binding_cookie` - (Optional) Option to provide increased security against compromised authorization tokens and CSRF attacks by requiring an additional "binding" cookie on requests. Defaults to `false`.
* `custom_deny_message` - (Optional) Option that returns a custom error message when a user is denied access to the application.
* `custom_deny_url` - (Optional) Option that redirects to a custom URL when a user is denied access to the application.
* `app_launcher_visible` - (Optional) Option to show/hide applications in App Launcher. Defaults to `true`.

## Attributes Reference

Expand Down

0 comments on commit 8fbcbb8

Please sign in to comment.