Skip to content

Commit

Permalink
Merge pull request #979 from hashicorp/bugfix/group-mailnickname-period
Browse files Browse the repository at this point in the history
azuread_group: mail_nickname can contain a period (.)
  • Loading branch information
manicminer authored Jan 19, 2023
2 parents ddee84a + b02aaf1 commit 3029da1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/services/groups/group_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ resource "azuread_group" "test" {
description = "Please delete me as this is a.test.AD group!"
types = ["Unified"]
mail_enabled = true
mail_nickname = "acctestGroup-%[1]d"
mail_nickname = "acctest.Group-%[1]d"
security_enabled = true
theme = "Pink"
}
Expand Down Expand Up @@ -532,7 +532,7 @@ resource "azuread_group" "test" {
description = "Please delete me as this is a.test.AD group!"
types = ["Unified"]
mail_enabled = true
mail_nickname = "acctestGroup-%[1]d"
mail_nickname = "acctest.Group-%[1]d"
security_enabled = true
theme = "Pink"
Expand Down Expand Up @@ -563,7 +563,7 @@ resource "azuread_group" "test" {
display_name = "acctestGroup-complete-%[1]d"
types = ["Unified"]
mail_enabled = true
mail_nickname = "acctestGroup-%[1]d"
mail_nickname = "acctest.Group-%[1]d"
security_enabled = true
members = [azuread_user.test.object_id]
owners = [azuread_user.test.object_id]
Expand Down Expand Up @@ -607,7 +607,7 @@ resource "azuread_group" "test" {
description = "Please delete me as this is a.test.AD group!"
types = ["DynamicMembership", "Unified"]
mail_enabled = true
mail_nickname = "acctestGroup-%[1]d"
mail_nickname = "acctest.Group-%[1]d"
security_enabled = true
dynamic_membership {
Expand Down
4 changes: 2 additions & 2 deletions internal/validate/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ func MailNickname(i interface{}, path cty.Path) (ret diag.Diagnostics) {
return
}

if regexp.MustCompile(`[@()\\\[\]";:.<>, ]`).MatchString(v) {
if regexp.MustCompile(`[@()\\\[\]";:<>, ]`).MatchString(v) {
ret = append(ret, diag.Diagnostic{
Severity: diag.Error,
Summary: "Value cannot contain these characters: @()\\[]\";:.<>,SPACE",
Summary: "Value cannot contain these characters: @()\\[]\";:<>,SPACE",
AttributePath: path,
})
}
Expand Down

0 comments on commit 3029da1

Please sign in to comment.