Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from 90poe/fix/19-rule-name-regex
Browse files Browse the repository at this point in the history
Fix/19 rule name regex
  • Loading branch information
alexkappa authored Jun 11, 2018
2 parents 9ccc29f + 98a8083 commit 920318a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion auth0/resource_auth0_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func newRule() *schema.Resource {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[a-z|A-Z]+[a-z|A-Z\\-\\s]+[a-z|A-Z]+$"),
regexp.MustCompile("^[^\\s-][\\w-]+[^\\s-]$"),
"Can only contain alphanumeric characters, spaces and '-'. "+
"Can neither start nor end with '-' or spaces."),
},
Expand Down
4 changes: 2 additions & 2 deletions auth0/resource_auth0_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestAccRule(t *testing.T) {
resource.TestStep{
Config: testAccRule,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_rule.my_rule", "name", "Acceptance-Test-Rule"),
resource.TestCheckResourceAttr("auth0_rule.my_rule", "name", "auth0-authorization-extension"),
resource.TestCheckResourceAttr("auth0_rule.my_rule", "script", "function (user, context, callback) { callback(null, user, context); }"),
resource.TestCheckResourceAttr("auth0_rule.my_rule", "enabled", "true"),
),
Expand All @@ -30,7 +30,7 @@ const testAccRule = `
provider "auth0" {}
resource "auth0_rule" "my_rule" {
name = "Acceptance-Test-Rule"
name = "auth0-authorization-extension"
script = "function (user, context, callback) { callback(null, user, context); }"
enabled = true
}
Expand Down

0 comments on commit 920318a

Please sign in to comment.