Skip to content

Commit 7d5b75f

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 ee1ed14 commit 7d5b75f

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

lib/fusionauth/fusionauth_client.rb

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,18 @@ def delete_web_authn_credential(id)
14121412
.go
14131413
end
14141414

1415+
#
1416+
# Deletes all of the WebAuthn credentials for the given User Id.
1417+
#
1418+
# @param user_id [string] The unique Id of the User to delete WebAuthn passkeys for.
1419+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
1420+
def delete_web_authn_credentials_for_user(user_id)
1421+
start.uri('/api/webauthn')
1422+
.url_parameter('userId', user_id)
1423+
.delete
1424+
.go
1425+
end
1426+
14151427
#
14161428
# Deletes the webhook for the given Id.
14171429
#
@@ -2049,7 +2061,7 @@ def logout_with_request(request)
20492061
end
20502062

20512063
#
2052-
# Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
2064+
# Retrieves any global identity providers for the given domain. A 200 response code indicates the domain is managed
20532065
# by a registered identity provider. A 404 indicates the domain is not managed.
20542066
#
20552067
# @param domain [string] The domain or email address to lookup.
@@ -2061,6 +2073,22 @@ def lookup_identity_provider(domain)
20612073
.go
20622074
end
20632075

2076+
#
2077+
# Retrieves the identity provider for the given domain and tenantId. A 200 response code indicates the domain is managed
2078+
# by a registered identity provider. A 404 indicates the domain is not managed.
2079+
#
2080+
# @param domain [string] The domain or email address to lookup.
2081+
# @param tenant_id [string] If provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain.
2082+
# If no result is found, the API then searches for global identity providers.
2083+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
2084+
def lookup_identity_provider_by_tenant_id(domain, tenant_id)
2085+
start.uri('/api/identity-provider/lookup')
2086+
.url_parameter('domain', domain)
2087+
.url_parameter('tenantId', tenant_id)
2088+
.get
2089+
.go
2090+
end
2091+
20642092
#
20652093
# Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
20662094
# action.

0 commit comments

Comments
 (0)