Skip to content

Commit dc972cc

Browse files
author
FusionAuth Automation
committed
Sync from monorepo 797cf4b8ea23
1 parent 827b407 commit dc972cc

31 files changed

Lines changed: 888 additions & 54 deletions

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

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@
189189
import io.fusionauth.domain.api.identity.verify.VerifyStartRequest;
190190
import io.fusionauth.domain.api.identity.verify.VerifyStartResponse;
191191
import io.fusionauth.domain.api.identity.verify.VerifySendRequest;
192+
import io.fusionauth.domain.api.identityProvider.IdentityProviderConnectionTestRequest;
193+
import io.fusionauth.domain.api.identityProvider.IdentityProviderConnectionTestResponse;
192194
import io.fusionauth.domain.api.identityProvider.IdentityProviderLinkRequest;
193195
import io.fusionauth.domain.api.identityProvider.IdentityProviderLinkResponse;
194196
import io.fusionauth.domain.api.identityProvider.IdentityProviderLoginRequest;
@@ -213,6 +215,10 @@
213215
import io.fusionauth.domain.api.report.MonthlyActiveUserReportResponse;
214216
import io.fusionauth.domain.api.report.RegistrationReportResponse;
215217
import io.fusionauth.domain.api.report.TotalsReportResponse;
218+
import io.fusionauth.domain.api.tenantManager.TenantManagerConfigurationRequest;
219+
import io.fusionauth.domain.api.tenantManager.TenantManagerConfigurationResponse;
220+
import io.fusionauth.domain.api.tenantManager.TenantManagerIdentityProviderTypeConfigurationRequest;
221+
import io.fusionauth.domain.api.tenantManager.TenantManagerIdentityProviderTypeConfigurationResponse;
216222
import io.fusionauth.domain.api.twoFactor.SecretResponse;
217223
import io.fusionauth.domain.api.twoFactor.TwoFactorLoginRequest;
218224
import io.fusionauth.domain.api.twoFactor.TwoFactorSendRequest;
@@ -1186,6 +1192,22 @@ public ClientResponse<TenantResponse, Errors> createTenant(UUID tenantId, Tenant
11861192
.go();
11871193
}
11881194

1195+
/**
1196+
* Creates a tenant manager identity provider type configuration for the given identity provider type.
1197+
*
1198+
* @param type The type of the identity provider.
1199+
* @param request The request object that contains all the information used to create the tenant manager identity provider type configuration.
1200+
* @return The ClientResponse object.
1201+
*/
1202+
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> createTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, TenantManagerIdentityProviderTypeConfigurationRequest request) {
1203+
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
1204+
.uri("/api/tenant-manager/identity-provider")
1205+
.urlSegment(type)
1206+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
1207+
.post()
1208+
.go();
1209+
}
1210+
11891211
/**
11901212
* Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
11911213
*
@@ -1766,6 +1788,20 @@ public ClientResponse<Void, Errors> deleteTenantAsync(UUID tenantId) {
17661788
.go();
17671789
}
17681790

1791+
/**
1792+
* Deletes the tenant manager identity provider type configuration for the given identity provider type.
1793+
*
1794+
* @param type The type of the identity provider.
1795+
* @return The ClientResponse object.
1796+
*/
1797+
public ClientResponse<Void, Errors> deleteTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type) {
1798+
return start(Void.TYPE, Errors.class)
1799+
.uri("/api/tenant-manager/identity-provider")
1800+
.urlSegment(type)
1801+
.delete()
1802+
.go();
1803+
}
1804+
17691805
/**
17701806
* Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
17711807
* with the tenant and everything under the tenant (applications, users, etc).
@@ -3068,6 +3104,36 @@ public ClientResponse<TenantResponse, Errors> patchTenant(UUID tenantId, Map<Str
30683104
.go();
30693105
}
30703106

3107+
/**
3108+
* Updates, via PATCH, the Tenant Manager configuration.
3109+
*
3110+
* @param request The request that contains just the new Tenant Manager configuration information.
3111+
* @return The ClientResponse object.
3112+
*/
3113+
public ClientResponse<TenantManagerConfigurationResponse, Errors> patchTenantManagerConfiguration(Map<String, Object> request) {
3114+
return start(TenantManagerConfigurationResponse.class, Errors.class)
3115+
.uri("/api/tenant-manager")
3116+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
3117+
.patch()
3118+
.go();
3119+
}
3120+
3121+
/**
3122+
* Patches the tenant manager identity provider type configuration for the given identity provider type.
3123+
*
3124+
* @param type The type of the identity provider.
3125+
* @param request The request object that contains the new tenant manager identity provider type configuration information.
3126+
* @return The ClientResponse object.
3127+
*/
3128+
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> patchTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, Map<String, Object> request) {
3129+
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
3130+
.uri("/api/tenant-manager/identity-provider")
3131+
.urlSegment(type)
3132+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
3133+
.patch()
3134+
.go();
3135+
}
3136+
30713137
/**
30723138
* Updates, via PATCH, the theme with the given Id.
30733139
*
@@ -3816,6 +3882,20 @@ public ClientResponse<IdentityProviderResponse, Errors> retrieveIdentityProvider
38163882
.go();
38173883
}
38183884

3885+
/**
3886+
* Retrieves the results for an identity provider connection test.
3887+
*
3888+
* @param connectionTestId The connection test id to retrieve results for.
3889+
* @return The ClientResponse object.
3890+
*/
3891+
public ClientResponse<IdentityProviderConnectionTestResponse, Errors> retrieveIdentityProviderConnectionTestResults(String connectionTestId) {
3892+
return start(IdentityProviderConnectionTestResponse.class, Errors.class)
3893+
.uri("/api/identity-provider/test")
3894+
.urlParameter("connectionTestId", connectionTestId)
3895+
.get()
3896+
.go();
3897+
}
3898+
38193899
/**
38203900
* Retrieves all the identity providers.
38213901
*
@@ -4387,6 +4467,18 @@ public ClientResponse<TenantResponse, Errors> retrieveTenant(UUID tenantId) {
43874467
.go();
43884468
}
43894469

4470+
/**
4471+
* Retrieves the Tenant Manager configuration.
4472+
*
4473+
* @return The ClientResponse object.
4474+
*/
4475+
public ClientResponse<TenantManagerConfigurationResponse, Void> retrieveTenantManagerConfiguration() {
4476+
return start(TenantManagerConfigurationResponse.class, Void.TYPE)
4477+
.uri("/api/tenant-manager")
4478+
.get()
4479+
.go();
4480+
}
4481+
43904482
/**
43914483
* Retrieves all the tenants.
43924484
*
@@ -5635,6 +5727,20 @@ public ClientResponse<Void, Errors> sendVerifyIdentity(VerifySendRequest request
56355727
.go();
56365728
}
56375729

5730+
/**
5731+
* Begins an identity provider connection test.
5732+
*
5733+
* @param request The request that contains information on the connection test.
5734+
* @return The ClientResponse object.
5735+
*/
5736+
public ClientResponse<IdentityProviderConnectionTestResponse, Errors> startIdentityProviderConnectionTest(IdentityProviderConnectionTestRequest request) {
5737+
return start(IdentityProviderConnectionTestResponse.class, Errors.class)
5738+
.uri("/api/identity-provider/test")
5739+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
5740+
.post()
5741+
.go();
5742+
}
5743+
56385744
/**
56395745
* Begins a login request for a 3rd party login that requires user interaction such as HYPR.
56405746
*
@@ -6144,6 +6250,36 @@ public ClientResponse<TenantResponse, Errors> updateTenant(UUID tenantId, Tenant
61446250
.go();
61456251
}
61466252

6253+
/**
6254+
* Updates the Tenant Manager configuration.
6255+
*
6256+
* @param request The request that contains all the new Tenant Manager configuration information.
6257+
* @return The ClientResponse object.
6258+
*/
6259+
public ClientResponse<TenantManagerConfigurationResponse, Errors> updateTenantManagerConfiguration(TenantManagerConfigurationRequest request) {
6260+
return start(TenantManagerConfigurationResponse.class, Errors.class)
6261+
.uri("/api/tenant-manager")
6262+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
6263+
.put()
6264+
.go();
6265+
}
6266+
6267+
/**
6268+
* Updates the tenant manager identity provider type configuration for the given identity provider type.
6269+
*
6270+
* @param type The type of the identity provider.
6271+
* @param request The request object that contains the updated tenant manager identity provider type configuration.
6272+
* @return The ClientResponse object.
6273+
*/
6274+
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> updateTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, TenantManagerIdentityProviderTypeConfigurationRequest request) {
6275+
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
6276+
.uri("/api/tenant-manager/identity-provider")
6277+
.urlSegment(type)
6278+
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
6279+
.put()
6280+
.go();
6281+
}
6282+
61476283
/**
61486284
* Updates the theme with the given Id.
61496285
*

src/main/java/io/fusionauth/client/json/PreviewMessageTemplateResponseDeserializer.java

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
package io.fusionauth.client.json;
55

66
import java.io.IOException;
7-
import java.util.Arrays;
8-
import java.util.stream.Collectors;
97

108
import com.fasterxml.jackson.core.JsonParser;
119
import com.fasterxml.jackson.databind.DeserializationContext;
@@ -14,10 +12,7 @@
1412
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
1513
import com.inversoft.error.Errors;
1614
import io.fusionauth.domain.api.PreviewMessageTemplateResponse;
17-
import io.fusionauth.domain.message.Message;
18-
import io.fusionauth.domain.message.MessageType;
1915
import io.fusionauth.domain.message.sms.SMSMessage;
20-
import io.fusionauth.domain.message.voice.VoiceMessage;
2116

2217
/**
2318
* @author Daniel King
@@ -27,18 +22,6 @@ public PreviewMessageTemplateResponseDeserializer() {
2722
super(PreviewMessageTemplateResponse.class);
2823
}
2924

30-
private static MessageType extractType(DeserializationContext ctxt, JsonParser p, JsonNode messageNode) throws IOException {
31-
JsonNode node = messageNode.at("/type");
32-
MessageType type = MessageType.safeValueOf(node.asText());
33-
if (type == null) {
34-
String sorted = Arrays.stream(MessageType.values()).map(Enum::name).sorted().collect(Collectors.joining(", "));
35-
return (MessageType) ctxt.handleUnexpectedToken(Message.class, node.asToken(), p,
36-
"Expected the type field to be one of [" + sorted + "], but found [" + node.asText() + "]");
37-
}
38-
39-
return type;
40-
}
41-
4225
@Override
4326
public PreviewMessageTemplateResponse deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
4427
return deserialize(p, ctxt, new PreviewMessageTemplateResponse());
@@ -54,16 +37,16 @@ public PreviewMessageTemplateResponse deserialize(JsonParser p, DeserializationC
5437
response.errors = p.getCodec().treeToValue(errorsNode, Errors.class);
5538
}
5639

57-
JsonNode messageNode = node.at("/previewMessage");
58-
MessageType messageType = extractType(ctxt, p, messageNode);
59-
if (messageType == MessageType.Voice) {
60-
response.previewMessage = new VoiceMessage();
61-
} else {
62-
SMSMessage message = new SMSMessage();
63-
response.message = message;
64-
response.previewMessage = message;
40+
JsonNode previewNode = node.at("/previewMessage");
41+
if (!previewNode.isMissingNode()) {
42+
response.previewMessage = previewNode.asText();
43+
}
44+
45+
JsonNode messageNode = node.at("/message");
46+
if (!messageNode.isMissingNode()) {
47+
response.message = new SMSMessage();
48+
((ObjectMapper) p.getCodec()).readerForUpdating(response.message).readValue(messageNode);
6549
}
66-
((ObjectMapper) p.getCodec()).readerForUpdating(response.previewMessage).readValue(messageNode);
6750

6851
return response;
6952
}

src/main/java/io/fusionauth/domain/Application.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ public String toString() {
589589
public static class RegistrationConfiguration extends Enableable implements Buildable<RegistrationConfiguration> {
590590
public Requirable birthDate = new Requirable();
591591

592+
public boolean completeRegistration;
593+
592594
public boolean confirmPassword;
593595

594596
public Requirable firstName = new Requirable();
@@ -615,6 +617,7 @@ public RegistrationConfiguration() {
615617

616618
public RegistrationConfiguration(RegistrationConfiguration other) {
617619
this.birthDate = new Requirable(other.birthDate);
620+
this.completeRegistration = other.completeRegistration;
618621
this.confirmPassword = other.confirmPassword;
619622
this.enabled = other.enabled;
620623
this.firstName = new Requirable(other.firstName);
@@ -640,7 +643,8 @@ public boolean equals(Object o) {
640643
return false;
641644
}
642645
RegistrationConfiguration that = (RegistrationConfiguration) o;
643-
return confirmPassword == that.confirmPassword &&
646+
return completeRegistration == that.completeRegistration &&
647+
confirmPassword == that.confirmPassword &&
644648
Objects.equals(birthDate, that.birthDate) &&
645649
Objects.equals(firstName, that.firstName) &&
646650
Objects.equals(formId, that.formId) &&
@@ -655,7 +659,7 @@ public boolean equals(Object o) {
655659

656660
@Override
657661
public int hashCode() {
658-
return Objects.hash(super.hashCode(), birthDate, confirmPassword, firstName, formId, fullName, lastName, loginIdType, middleName, mobilePhone, preferredLanguages, type);
662+
return Objects.hash(super.hashCode(), birthDate, completeRegistration, confirmPassword, firstName, formId, fullName, lastName, loginIdType, middleName, mobilePhone, preferredLanguages, type);
659663
}
660664

661665
public String toString() {

src/main/java/io/fusionauth/domain/AuditLog.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2026, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.util.LinkedHashMap;
2020
import java.util.Map;
2121
import java.util.Objects;
22+
import java.util.UUID;
2223

2324
import com.inversoft.json.ToString;
2425
import io.fusionauth.domain.util.Normalizer;
@@ -45,6 +46,8 @@ public class AuditLog implements Buildable<AuditLog> {
4546

4647
public String reason;
4748

49+
public UUID tenantId;
50+
4851
public AuditLog() {
4952
}
5053

@@ -69,12 +72,13 @@ public boolean equals(Object o) {
6972
Objects.equals(message, auditLog.message) &&
7073
Objects.equals(newValue, auditLog.newValue) &&
7174
Objects.equals(oldValue, auditLog.oldValue) &&
72-
Objects.equals(reason, auditLog.reason);
75+
Objects.equals(reason, auditLog.reason) &&
76+
Objects.equals(tenantId, auditLog.tenantId);
7377
}
7478

7579
@Override
7680
public int hashCode() {
77-
return Objects.hash(data, id, insertInstant, insertUser, message, newValue, oldValue, reason);
81+
return Objects.hash(data, id, insertInstant, insertUser, message, newValue, oldValue, reason, tenantId);
7882
}
7983

8084
public void normalize() {

src/main/java/io/fusionauth/domain/ExternalIdentifierConfiguration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class ExternalIdentifierConfiguration implements Buildable<ExternalIdenti
4242

4343
public int externalAuthenticationIdTimeToLiveInSeconds = 300;
4444

45+
public int identityProviderConnectionTestTimeToLiveInSeconds = 1800;
46+
4547
public int loginIntentTimeToLiveInSeconds = 1800;
4648

4749
public int oneTimePasswordTimeToLiveInSeconds = 60;
@@ -102,6 +104,7 @@ public ExternalIdentifierConfiguration(ExternalIdentifierConfiguration other) {
102104
this.emailVerificationIdTimeToLiveInSeconds = other.emailVerificationIdTimeToLiveInSeconds;
103105
this.emailVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(other.emailVerificationOneTimeCodeGenerator);
104106
this.externalAuthenticationIdTimeToLiveInSeconds = other.externalAuthenticationIdTimeToLiveInSeconds;
107+
this.identityProviderConnectionTestTimeToLiveInSeconds = other.identityProviderConnectionTestTimeToLiveInSeconds;
105108
this.phoneVerificationIdGenerator = new SecureGeneratorConfiguration(other.phoneVerificationIdGenerator);
106109
this.phoneVerificationIdTimeToLiveInSeconds = other.phoneVerificationIdTimeToLiveInSeconds;
107110
this.phoneVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(other.phoneVerificationOneTimeCodeGenerator);
@@ -141,6 +144,7 @@ public boolean equals(Object o) {
141144
deviceCodeTimeToLiveInSeconds == that.deviceCodeTimeToLiveInSeconds &&
142145
emailVerificationIdTimeToLiveInSeconds == that.emailVerificationIdTimeToLiveInSeconds &&
143146
externalAuthenticationIdTimeToLiveInSeconds == that.externalAuthenticationIdTimeToLiveInSeconds &&
147+
identityProviderConnectionTestTimeToLiveInSeconds == that.identityProviderConnectionTestTimeToLiveInSeconds &&
144148
phoneVerificationIdTimeToLiveInSeconds == that.phoneVerificationIdTimeToLiveInSeconds &&
145149
loginIntentTimeToLiveInSeconds == that.loginIntentTimeToLiveInSeconds &&
146150
oneTimePasswordTimeToLiveInSeconds == that.oneTimePasswordTimeToLiveInSeconds &&
@@ -181,6 +185,7 @@ public int hashCode() {
181185
emailVerificationIdTimeToLiveInSeconds,
182186
emailVerificationOneTimeCodeGenerator,
183187
externalAuthenticationIdTimeToLiveInSeconds,
188+
identityProviderConnectionTestTimeToLiveInSeconds,
184189
phoneVerificationIdGenerator,
185190
phoneVerificationIdTimeToLiveInSeconds,
186191
phoneVerificationOneTimeCodeGenerator,

src/main/java/io/fusionauth/domain/Key.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2025, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2019-2026, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)