Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Revert "Merge pull request #295 from articulate/feature/user-schema-p…
Browse files Browse the repository at this point in the history
…attern"

This reverts commit b77db1b, reversing
changes made to d975caf.
  • Loading branch information
quantumew committed Oct 4, 2019
1 parent b77db1b commit 8c6bec0
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 42 deletions.
9 changes: 0 additions & 9 deletions examples/okta_user_base_schema/username.tf

This file was deleted.

7 changes: 3 additions & 4 deletions okta/resource_okta_app_user_base_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ func resourceAppUserBaseSchemaDelete(d *schema.ResourceData, m interface{}) erro
// create or modify a subschema
func updateAppUserBaseSubschema(d *schema.ResourceData, m interface{}) error {
schema := &sdk.UserSubSchema{
Master: getNullableMaster(d),
Title: d.Get("title").(string),
Type: d.Get("type").(string),
Pattern: d.Get("pattern").(string),
Master: getNullableMaster(d),
Title: d.Get("title").(string),
Type: d.Get("type").(string),
Permissions: []*sdk.UserSchemaPermission{
{
Action: d.Get("permissions").(string),
Expand Down
7 changes: 3 additions & 4 deletions okta/resource_okta_user_base_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ func resourceUserBaseSchemaDelete(d *schema.ResourceData, m interface{}) error {
// create or modify a subschema
func updateBaseSubschema(d *schema.ResourceData, m interface{}) error {
schema := &sdk.UserSubSchema{
Master: getNullableMaster(d),
Title: d.Get("title").(string),
Type: d.Get("type").(string),
Pattern: d.Get("pattern").(string),
Master: getNullableMaster(d),
Title: d.Get("title").(string),
Type: d.Get("type").(string),
Permissions: []*sdk.UserSchemaPermission{
{
Action: d.Get("permissions").(string),
Expand Down
14 changes: 0 additions & 14 deletions okta/resource_okta_user_base_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ func TestAccOktaUserBaseSchema_crud(t *testing.T) {
mgr := newFixtureManager(userBaseSchema)
config := mgr.GetFixtures("basic.tf", ri, t)
updated := mgr.GetFixtures("updated.tf", ri, t)
usernamePattern := mgr.GetFixtures("username.tf", ri, t)
resourceName := fmt.Sprintf("%s.%s", userBaseSchema, baseTestProp)
loginResourceName := fmt.Sprintf("%s.login", userBaseSchema)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -69,18 +67,6 @@ func TestAccOktaUserBaseSchema_crud(t *testing.T) {
return nil
},
},
{
Config: usernamePattern,
Check: resource.ComposeTestCheckFunc(
testOktaUserBaseSchemasExists(loginResourceName),
resource.TestCheckResourceAttr(loginResourceName, "index", "login"),
resource.TestCheckResourceAttr(loginResourceName, "title", "Username"),
resource.TestCheckResourceAttr(loginResourceName, "type", "string"),
resource.TestCheckResourceAttr(loginResourceName, "required", "true"),
resource.TestCheckResourceAttr(loginResourceName, "permissions", "READ_ONLY"),
resource.TestCheckResourceAttr(loginResourceName, "pattern", "[a-z0-9]+"),
),
},
},
})
}
Expand Down
6 changes: 0 additions & 6 deletions okta/user_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ var (
Description: "Subschema type: string, boolean, number, integer, array, or object",
ForceNew: true,
},
"pattern": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Restrict the username schema property to a particular regex pattern. Unlike the UI you must use a regex here.",
},
"permissions": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -225,7 +220,6 @@ func syncBaseUserSchema(d *schema.ResourceData, subschema *sdk.UserSubSchema) {
d.Set("title", subschema.Title)
d.Set("type", subschema.Type)
d.Set("required", subschema.Required)
d.Set("pattern", subschema.Pattern)

if subschema.Master != nil {
d.Set("master", subschema.Master.Type)
Expand Down
1 change: 0 additions & 1 deletion sdk/user_schema_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type (
MinLength *int `json:"minLength,omitempty"`
Mutability string `json:"mutability,omitempty"`
OneOf []*UserSchemaEnum `json:"oneOf,omitempty"`
Pattern string `json:"pattern,omitempty"`
Permissions []*UserSchemaPermission `json:"permissions,omitempty"`
Required *bool `json:"required,omitempty"`
Scope string `json:"scope,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/app_user_base_schema.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ The following arguments are supported:

* `required` - (Optional) Whether the property is required for this application's users.

* `pattern` - (Optional) Restrict `login` schema property to a particular regex.

* `permissions` - (Optional) Access control permissions for the property. It can be set to `"READ_WRITE"`, `"READ_ONLY"`, `"HIDE"`.

* `master` - (Optional) Master priority for the user schema property. It can be set to `"PROFILE_MASTER"` or `"OKTA"`.
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/user_base_schema.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ The following arguments are supported:

* `required` - (Optional) Whether the property is required for this application's users.

* `pattern` - (Optional) Restrict `login` schema property to a particular regex.

* `permissions` - (Optional) Access control permissions for the property. It can be set to `"READ_WRITE"`, `"READ_ONLY"`, `"HIDE"`.

* `master` - (Optional) Master priority for the user schema property. It can be set to `"PROFILE_MASTER"` or `"OKTA"`.
Expand Down

0 comments on commit 8c6bec0

Please sign in to comment.