Skip to content

Commit a5c8b05

Browse files
authored
ENG-3831 - Add missing client method lookups and test harness (#1244)
Problem: 1. We were missing tenantId on lookupIdentityProvider 2. We were missing deleteWebAuthnCredentialsByUser Solution: 1. Add lookupIdentityProviderByTenantId to go with lookupIdentityProvider 2. Add a new deleteWebAuthnCredentialsForUser to go with deleteWebAuthnCredentials 3. Surface some PMVC route printing code to deterministically get all of our routes and action classes. 4. Add an AI written test that looks for missing parameters.
1 parent fbcb9ca commit a5c8b05

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

src/main/java/io/fusionauth/client/FusionAuthClient.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,20 @@ public ClientResponse<Void, Errors> deleteWebAuthnCredential(UUID id) {
19111911
.go();
19121912
}
19131913

1914+
/**
1915+
* Deletes all of the WebAuthn credentials for the given User Id.
1916+
*
1917+
* @param userId The unique Id of the User to delete WebAuthn passkeys for.
1918+
* @return The ClientResponse object.
1919+
*/
1920+
public ClientResponse<Void, Errors> deleteWebAuthnCredentialsForUser(UUID userId) {
1921+
return start(Void.TYPE, Errors.class)
1922+
.uri("/api/webauthn")
1923+
.urlParameter("userId", userId)
1924+
.delete()
1925+
.go();
1926+
}
1927+
19141928
/**
19151929
* Deletes the webhook for the given Id.
19161930
*
@@ -2614,7 +2628,7 @@ public ClientResponse<Void, Void> logoutWithRequest(LogoutRequest request) {
26142628
}
26152629

26162630
/**
2617-
* Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
2631+
* Retrieves any global identity providers for the given domain. A 200 response code indicates the domain is managed
26182632
* by a registered identity provider. A 404 indicates the domain is not managed.
26192633
*
26202634
* @param domain The domain or email address to lookup.
@@ -2628,6 +2642,24 @@ public ClientResponse<LookupResponse, Void> lookupIdentityProvider(String domain
26282642
.go();
26292643
}
26302644

2645+
/**
2646+
* Retrieves the identity provider for the given domain and tenantId. A 200 response code indicates the domain is managed
2647+
* by a registered identity provider. A 404 indicates the domain is not managed.
2648+
*
2649+
* @param domain The domain or email address to lookup.
2650+
* @param tenantId If provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain.
2651+
* If no result is found, the API then searches for global identity providers.
2652+
* @return The ClientResponse object.
2653+
*/
2654+
public ClientResponse<LookupResponse, Void> lookupIdentityProviderByTenantId(String domain, UUID tenantId) {
2655+
return start(LookupResponse.class, Void.TYPE)
2656+
.uri("/api/identity-provider/lookup")
2657+
.urlParameter("domain", domain)
2658+
.urlParameter("tenantId", tenantId)
2659+
.get()
2660+
.go();
2661+
}
2662+
26312663
/**
26322664
* Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
26332665
* action.

0 commit comments

Comments
 (0)