Skip to content

Commit 1a2ddb4

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 a771603 commit 1a2ddb4

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

src/FusionAuth/FusionAuthClient.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,22 @@ public function deleteWebAuthnCredential($id)
18181818
->go();
18191819
}
18201820

1821+
/**
1822+
* Deletes all of the WebAuthn credentials for the given User Id.
1823+
*
1824+
* @param string $userId The unique Id of the User to delete WebAuthn passkeys for.
1825+
*
1826+
* @return ClientResponse The ClientResponse.
1827+
* @throws \Exception
1828+
*/
1829+
public function deleteWebAuthnCredentialsForUser($userId)
1830+
{
1831+
return $this->start()->uri("/api/webauthn")
1832+
->urlParameter("userId", $userId)
1833+
->delete()
1834+
->go();
1835+
}
1836+
18211837
/**
18221838
* Deletes the webhook for the given Id.
18231839
*
@@ -2603,7 +2619,7 @@ public function logoutWithRequest($request)
26032619
}
26042620

26052621
/**
2606-
* Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
2622+
* Retrieves any global identity providers for the given domain. A 200 response code indicates the domain is managed
26072623
* by a registered identity provider. A 404 indicates the domain is not managed.
26082624
*
26092625
* @param string $domain The domain or email address to lookup.
@@ -2619,6 +2635,26 @@ public function lookupIdentityProvider($domain)
26192635
->go();
26202636
}
26212637

2638+
/**
2639+
* Retrieves the identity provider for the given domain and tenantId. A 200 response code indicates the domain is managed
2640+
* by a registered identity provider. A 404 indicates the domain is not managed.
2641+
*
2642+
* @param string $domain The domain or email address to lookup.
2643+
* @param string $tenantId If provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain.
2644+
* If no result is found, the API then searches for global identity providers.
2645+
*
2646+
* @return ClientResponse The ClientResponse.
2647+
* @throws \Exception
2648+
*/
2649+
public function lookupIdentityProviderByTenantId($domain, $tenantId)
2650+
{
2651+
return $this->start()->uri("/api/identity-provider/lookup")
2652+
->urlParameter("domain", $domain)
2653+
->urlParameter("tenantId", $tenantId)
2654+
->get()
2655+
->go();
2656+
}
2657+
26222658
/**
26232659
* Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
26242660
* action.

0 commit comments

Comments
 (0)