Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added display_name field to the okta_auth_server_scope resource #433

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/okta_auth_server_scope/basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "okta_auth_server_scope" "test" {
consent = "REQUIRED"
description = "test"
name = "test:something"
display_name = "test"
auth_server_id = okta_auth_server.test.id
}

Expand Down
1 change: 1 addition & 0 deletions examples/okta_auth_server_scope/basic_updated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "okta_auth_server_scope" "test" {
consent = "REQUIRED"
description = "test_updated"
name = "test:something"
display_name = "test_updated"
auth_server_id = okta_auth_server.test.id
}

Expand Down
5 changes: 5 additions & 0 deletions okta/data_source_okta_auth_server_scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func dataSourceAuthServerScopes() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"display_name": {
Type: schema.TypeString,
Computed: true,
},
"consent": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -80,6 +84,7 @@ func flattenScope(s *okta.OAuth2Scope) map[string]interface{} {
"id": s.Id,
"name": s.Name,
"description": s.Description,
"display_name": s.DisplayName,
"consent": s.Consent,
"metadata_publish": s.MetadataPublish,
"default": s.Default,
Expand Down
7 changes: 7 additions & 0 deletions okta/resource_okta_auth_server_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ func resourceAuthServerScope() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"display_name": {
Type: schema.TypeString,
Optional: true,
Description: "Name of the end user displayed in a consent dialog box",
},
"consent": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -74,6 +79,7 @@ func resourceAuthServerScopeRead(ctx context.Context, d *schema.ResourceData, m
}
_ = d.Set("name", scope.Name)
_ = d.Set("description", scope.Description)
_ = d.Set("display_name", scope.DisplayName)
_ = d.Set("metadata_publish", scope.MetadataPublish)
_ = d.Set("default", scope.Default)
if scope.Consent != "" {
Expand Down Expand Up @@ -105,6 +111,7 @@ func buildAuthServerScope(d *schema.ResourceData) okta.OAuth2Scope {
Description: d.Get("description").(string),
MetadataPublish: d.Get("metadata_publish").(string),
Name: d.Get("name").(string),
DisplayName: d.Get("display_name").(string),
Default: boolPtr(d.Get("default").(bool)),
}
}
2 changes: 2 additions & 0 deletions okta/resource_okta_auth_server_scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccOktaAuthServerScope_crud(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "consent", "REQUIRED"),
resource.TestCheckResourceAttr(resourceName, "name", "test:something"),
resource.TestCheckResourceAttr(resourceName, "description", "test"),
resource.TestCheckResourceAttr(resourceName, "display_name", "test"),
),
},
{
Expand All @@ -34,6 +35,7 @@ func TestAccOktaAuthServerScope_crud(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "consent", "REQUIRED"),
resource.TestCheckResourceAttr(resourceName, "name", "test:something"),
resource.TestCheckResourceAttr(resourceName, "description", "test_updated"),
resource.TestCheckResourceAttr(resourceName, "display_name", "test_updated"),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/auth_server_scopes.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data "okta_auth_server_scopes" "test" {
- `id` - ID of the Scope
- `name` - Name of the Scope
- `description` - Description of the Scope
- `display_name` - Name of the end user displayed in a consent dialog box
- `consent` - Indicates whether a consent dialog is needed for the Scope
- `metadata_publish` - Whether the Scope should be included in the metadata
- `default` - Whether the Scope is a default Scope
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/auth_server_scope.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The following arguments are supported:

- `description` - (Optional) Description of the Auth Server Scope.

- `display_name` - (Optional) Name of the end user displayed in a consent dialog box.

- `consent` - (Optional) Indicates whether a consent dialog is needed for the scope. It can be set to `"REQUIRED"` or `"IMPLICIT"`.

- `metadata_publish` - (Optional) Whether to publish metadata or not. It can be set to `"ALL_CLIENTS"` or `"NO_CLIENTS"`.
Expand Down