Skip to content

Commit 2685133

Browse files
committed
Add tests
1 parent e64cd84 commit 2685133

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

policies/client_registration/client_registration_test.rego

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ test_web_redirect_uri if {
215215
"redirect_uris": ["https://example.com/second/callback", "https://example.com/callback", "https://example.com/callback?query=value"],
216216
}
217217

218+
client_registration.allow with input.client_metadata as {
219+
"application_type": "web",
220+
"client_uri": "http://localhost:8080",
221+
"redirect_uris": ["http://localhost:8080/?no_universal_links=true"],
222+
}
223+
with client_registration.allow_insecure_uris as true
224+
218225
# HTTPS redirect_uri with non-standard port
219226
client_registration.allow with input.client_metadata as {
220227
"application_type": "web",
@@ -403,3 +410,13 @@ test_reverse_dns_match if {
403410
not client_registration.reverse_dns_match("example.com", "org.example")
404411
not client_registration.reverse_dns_match("test.com", "com.example")
405412
}
413+
414+
test_parse_uri if {
415+
client_uri_query := client_registration.parse_uri("https://example.com:8080/users?query=test")
416+
client_uri_query.authority == "example.com:8080"
417+
client_uri_query.host == "example.com"
418+
client_uri_query.path == "/users"
419+
client_uri_query.scheme == "https"
420+
client_uri_query.port == "8080"
421+
client_uri_query.query == "?query=test"
422+
}

0 commit comments

Comments
 (0)