@@ -153,6 +153,13 @@ func TestValidatorCases(t *testing.T) {
153153 email: "foo.bar@example0.com",
154154 expectedAuthZ: false,
155155 },
156+ {
157+ name: "EmailNotInCorrect1stSubDomainsNotInEmailsWildcard",
158+ allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
159+ allowedDomains: []string{"*.example0.com", "*.example1.com"},
160+ email: "foo.bar@example0.com",
161+ expectedAuthZ: false,
162+ },
156163 {
157164 name: "EmailInFirstDomain",
158165 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -160,6 +167,13 @@ func TestValidatorCases(t *testing.T) {
160167 email: "foo@bar.example0.com",
161168 expectedAuthZ: true,
162169 },
170+ {
171+ name: "EmailInFirstDomainWildcard",
172+ allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
173+ allowedDomains: []string{"*.example0.com", "*.example1.com"},
174+ email: "foo@bar.example0.com",
175+ expectedAuthZ: true,
176+ },
163177 {
164178 name: "EmailNotInCorrect2ndSubDomainsNotInEmails",
165179 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -174,6 +188,13 @@ func TestValidatorCases(t *testing.T) {
174188 email: "baz@quux.example1.com",
175189 expectedAuthZ: true,
176190 },
191+ {
192+ name: "EmailInSecondDomainWildcard",
193+ allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
194+ allowedDomains: []string{"*.example0.com", "*.example1.com"},
195+ email: "baz@quux.example1.com",
196+ expectedAuthZ: true,
197+ },
177198 {
178199 name: "EmailInFirstEmailList",
179200 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -181,6 +202,13 @@ func TestValidatorCases(t *testing.T) {
181202 email: "xyzzy@example.com",
182203 expectedAuthZ: true,
183204 },
205+ {
206+ name: "EmailInFirstEmailListWildcard",
207+ allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
208+ allowedDomains: []string{"*.example0.com", "*.example1.com"},
209+ email: "xyzzy@example.com",
210+ expectedAuthZ: true,
211+ },
184212 {
185213 name: "EmailNotInDomainsNotInEmails",
186214 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -370,6 +398,13 @@ func TestValidatorCases(t *testing.T) {
370398 allowedDomains: []string{"company.com"},
371399 expectedAuthZ: false,
372400 },
401+ {
402+ name: "CheckForEqualityNotSuffixWildcard",
403+ email: "foo@evilcompany.com",
404+ allowedEmails: []string(nil),
405+ allowedDomains: []string{"*.company.com"},
406+ expectedAuthZ: false,
407+ },
373408 }
374409
375410 for _, tc := range testCases {