@@ -153,6 +153,13 @@ func TestValidatorCases(t *testing.T) {
153 email: "foo.bar@example0.com",
153 email: "foo.bar@example0.com",
154 expectedAuthZ: false,
154 expectedAuthZ: false,
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,
157 name: "EmailInFirstDomain",
164 name: "EmailInFirstDomain",
158 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
165 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -160,6 +167,13 @@ func TestValidatorCases(t *testing.T) {
160 email: "foo@bar.example0.com",
167 email: "foo@bar.example0.com",
161 expectedAuthZ: true,
168 expectedAuthZ: true,
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,
164 name: "EmailNotInCorrect2ndSubDomainsNotInEmails",
178 name: "EmailNotInCorrect2ndSubDomainsNotInEmails",
165 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
179 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -174,6 +188,13 @@ func TestValidatorCases(t *testing.T) {
174 email: "baz@quux.example1.com",
188 email: "baz@quux.example1.com",
175 expectedAuthZ: true,
189 expectedAuthZ: true,
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,
178 name: "EmailInFirstEmailList",
199 name: "EmailInFirstEmailList",
179 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
200 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -181,6 +202,13 @@ func TestValidatorCases(t *testing.T) {
181 email: "xyzzy@example.com",
202 email: "xyzzy@example.com",
182 expectedAuthZ: true,
203 expectedAuthZ: true,
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,
185 name: "EmailNotInDomainsNotInEmails",
213 name: "EmailNotInDomainsNotInEmails",
186 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
214 allowedEmails: []string{"xyzzy@example.com", "plugh@example.com"},
@@ -370,6 +398,13 @@ func TestValidatorCases(t *testing.T) {
370 allowedDomains: []string{"company.com"},
398 allowedDomains: []string{"company.com"},
371 expectedAuthZ: false,
399 expectedAuthZ: false,
402+ name: "CheckForEqualityNotSuffixWildcard",
403+ email: "foo@evilcompany.com",
404+ allowedEmails: []string(nil),
405+ allowedDomains: []string{"*.company.com"},
406+ expectedAuthZ: false,
375 for _, tc := range testCases {
410 for _, tc := range testCases {