Skip to content

Commit 0e0f8e1

Browse files
Tenant manager updates (#127)
* update clients * trimmed universal config (#120) * trimmed universal config * cleanup * domain update (#126) * add universal config
1 parent 0b9c8fe commit 0e0f8e1

File tree

7 files changed

+122
-9
lines changed

7 files changed

+122
-9
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2024, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2019-2025, 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.
@@ -104,6 +104,8 @@ public class Application implements Buildable<Application>, Tenantable {
104104

105105
public UUID themeId;
106106

107+
public UniversalApplicationConfiguration universalConfiguration = new UniversalApplicationConfiguration();
108+
107109
public RegistrationUnverifiedOptions unverified = new RegistrationUnverifiedOptions();
108110

109111
public UUID verificationEmailTemplateId;
@@ -147,6 +149,7 @@ public Application(Application other) {
147149
this.state = other.state;
148150
this.tenantId = other.tenantId;
149151
this.themeId = other.themeId;
152+
this.universalConfiguration = new UniversalApplicationConfiguration(other.universalConfiguration);
150153
this.unverified = new RegistrationUnverifiedOptions(other.unverified);
151154
this.verificationEmailTemplateId = other.verificationEmailTemplateId;
152155
this.verificationStrategy = other.verificationStrategy;
@@ -213,6 +216,7 @@ public boolean equals(Object o) {
213216
state == that.state &&
214217
Objects.equals(tenantId, that.tenantId) &&
215218
Objects.equals(themeId, that.themeId) &&
219+
Objects.equals(universalConfiguration, that.universalConfiguration) &&
216220
Objects.equals(unverified, that.unverified) &&
217221
Objects.equals(verificationEmailTemplateId, that.verificationEmailTemplateId) &&
218222
Objects.equals(webAuthnConfiguration, that.webAuthnConfiguration) &&
@@ -256,7 +260,7 @@ public boolean hasDefaultRole() {
256260
@Override
257261
public int hashCode() {
258262
// active is omitted
259-
return Objects.hash(accessControlConfiguration, authenticationTokenConfiguration, cleanSpeakConfiguration, data, emailConfiguration, externalIdentifierConfiguration, formConfiguration, id, insertInstant, jwtConfiguration, lambdaConfiguration, lastUpdateInstant, loginConfiguration, multiFactorConfiguration, name, oauthConfiguration, passwordlessConfiguration, registrationConfiguration, registrationDeletePolicy, roles, samlv2Configuration, scopes, state, tenantId, themeId, unverified, verificationEmailTemplateId, verificationStrategy, verifyRegistration, webAuthnConfiguration);
263+
return Objects.hash(accessControlConfiguration, authenticationTokenConfiguration, cleanSpeakConfiguration, data, emailConfiguration, externalIdentifierConfiguration, formConfiguration, id, insertInstant, jwtConfiguration, lambdaConfiguration, lastUpdateInstant, loginConfiguration, multiFactorConfiguration, name, oauthConfiguration, passwordlessConfiguration, registrationConfiguration, registrationDeletePolicy, roles, samlv2Configuration, scopes, state, tenantId, themeId, universalConfiguration, unverified, verificationEmailTemplateId, verificationStrategy, verifyRegistration, webAuthnConfiguration);
260264
}
261265

262266
public void normalize() {
@@ -885,4 +889,5 @@ public String toString() {
885889
}
886890
}
887891
}
892+
888893
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2025, FusionAuth, All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing,
11+
* software distributed under the License is distributed on an
12+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13+
* either express or implied. See the License for the specific
14+
* language governing permissions and limitations under the License.
15+
*/
16+
package io.fusionauth.domain;
17+
18+
import java.util.Objects;
19+
20+
import com.inversoft.json.JacksonConstructor;
21+
22+
/**
23+
* @author Lyle Schemmerling
24+
*/
25+
public class UniversalApplicationConfiguration {
26+
public boolean universal;
27+
28+
@JacksonConstructor
29+
public UniversalApplicationConfiguration() {}
30+
31+
public UniversalApplicationConfiguration(boolean universal) {
32+
this.universal = universal;
33+
}
34+
35+
public UniversalApplicationConfiguration(UniversalApplicationConfiguration other) {
36+
this.universal = other.universal;
37+
}
38+
39+
@Override
40+
public boolean equals(Object o) {
41+
if (o == null || getClass() != o.getClass()) {
42+
return false;
43+
}
44+
UniversalApplicationConfiguration that = (UniversalApplicationConfiguration) o;
45+
return universal == that.universal;
46+
}
47+
48+
@Override
49+
public int hashCode() {
50+
return Objects.hashCode(universal);
51+
}
52+
}

src/main/java/io/fusionauth/domain/form/FormField.java

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
/*
2-
* Copyright (c) 2020-2022, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2020-2025, FusionAuth, All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing,
11+
* software distributed under the License is distributed on an
12+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13+
* either express or implied. See the License for the specific
14+
* language governing permissions and limitations under the License.
315
*/
416
package io.fusionauth.domain.form;
517

@@ -48,6 +60,31 @@ public class FormField implements Buildable<FormField> {
4860

4961
public FormFieldValidator validator = new FormFieldValidator();
5062

63+
public FormField() {
64+
// Default constructor
65+
}
66+
67+
public FormField(FormField formField) {
68+
this.confirm = formField.confirm;
69+
this.consentId = formField.consentId;
70+
this.control = formField.control;
71+
this.data = new LinkedHashMap<>(formField.data);
72+
this.description = formField.description;
73+
this.id = formField.id;
74+
this.insertInstant = formField.insertInstant;
75+
this.key = formField.key;
76+
this.lastUpdateInstant = formField.lastUpdateInstant;
77+
this.name = formField.name;
78+
this.options = new ArrayList<>(formField.options);
79+
this.required = formField.required;
80+
this.type = formField.type;
81+
if (formField.validator != null) {
82+
this.validator = new FormFieldValidator();
83+
this.validator.expression = formField.validator.expression;
84+
this.validator.enabled = formField.validator.enabled;
85+
}
86+
}
87+
5188
@Override
5289
public boolean equals(Object o) {
5390
if (this == o) {

src/main/java/io/fusionauth/domain/jwt/RefreshToken.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, 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.
@@ -121,7 +121,9 @@ public boolean isExpired(Tenant tenant, Application application) {
121121
return startInstant.plusSeconds(tenant.httpSessionMaxInactiveInterval).isBefore(now);
122122
} else {
123123
// Refresh Token
124-
JWTConfiguration jwtConfiguration = tenant.lookupJWTConfiguration(application);
124+
JWTConfiguration jwtConfiguration = application != null && application.jwtConfiguration != null && application.jwtConfiguration.enabled
125+
? application.jwtConfiguration
126+
: tenant.jwtConfiguration;
125127

126128
// if the rt expired, we're done here.
127129
if (startInstant.plusMinutes(jwtConfiguration.refreshTokenTimeToLiveInMinutes).isBefore(now)) {

src/main/java/io/fusionauth/domain/oauth2/OAuthError.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, 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.
@@ -99,6 +99,7 @@ public enum OAuthErrorReason {
9999
invalid_target_entity_scope,
100100
invalid_entity_permission_scope,
101101
invalid_user_id,
102+
invalid_tenant_id,
102103

103104
// Grant disabled
104105
grant_type_disabled,
@@ -118,6 +119,7 @@ public enum OAuthErrorReason {
118119
missing_user_code,
119120
missing_user_id,
120121
missing_verification_uri,
122+
missing_tenant_id,
121123

122124
login_prevented,
123125
not_licensed,

src/main/java/io/fusionauth/domain/reactor/ReactorStatus.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021-2024, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2021-2025, 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.
@@ -59,8 +59,12 @@ public class ReactorStatus {
5959

6060
public ReactorFeatureStatus scimServer = ReactorFeatureStatus.UNKNOWN;
6161

62+
public ReactorFeatureStatus tenantManagerApplication = ReactorFeatureStatus.UNKNOWN;
63+
6264
public ReactorFeatureStatus threatDetection = ReactorFeatureStatus.UNKNOWN;
6365

66+
public ReactorFeatureStatus universalApplication = ReactorFeatureStatus.UNKNOWN;
67+
6468
public ReactorFeatureStatus webAuthn = ReactorFeatureStatus.UNKNOWN;
6569

6670
public ReactorFeatureStatus webAuthnPlatformAuthenticators = ReactorFeatureStatus.UNKNOWN;
@@ -87,8 +91,10 @@ public ReactorStatus(ReactorStatus other) {
8791
expiration = other.expiration;
8892
licenseAttributes.putAll(other.licenseAttributes);
8993
licensed = other.licensed;
94+
tenantManagerApplication = other.tenantManagerApplication;
9095
scimServer = other.scimServer;
9196
threatDetection = other.threatDetection;
97+
universalApplication = other.universalApplication;
9298
webAuthn = other.webAuthn;
9399
webAuthnPlatformAuthenticators = other.webAuthnPlatformAuthenticators;
94100
webAuthnRoamingAuthenticators = other.webAuthnRoamingAuthenticators;
@@ -118,8 +124,10 @@ public boolean equals(Object o) {
118124
Objects.equals(expiration, that.expiration) &&
119125
licensed == that.licensed &&
120126
Objects.equals(licenseAttributes, that.licenseAttributes) &&
127+
tenantManagerApplication == that.tenantManagerApplication &&
121128
scimServer == that.scimServer &&
122129
threatDetection == that.threatDetection &&
130+
universalApplication == that.universalApplication &&
123131
webAuthn == that.webAuthn &&
124132
webAuthnPlatformAuthenticators == that.webAuthnPlatformAuthenticators &&
125133
webAuthnRoamingAuthenticators == that.webAuthnRoamingAuthenticators;
@@ -142,8 +150,10 @@ public int hashCode() {
142150
expiration,
143151
licensed,
144152
licenseAttributes,
153+
tenantManagerApplication,
145154
scimServer,
146155
threatDetection,
156+
universalApplication,
147157
webAuthn,
148158
webAuthnPlatformAuthenticators,
149159
webAuthnRoamingAuthenticators);

src/main/java/io/fusionauth/domain/search/ApplicationSearchCriteria.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2023, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2023-2025, 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.
@@ -15,6 +15,7 @@
1515
*/
1616
package io.fusionauth.domain.search;
1717

18+
import java.util.HashSet;
1819
import java.util.LinkedHashMap;
1920
import java.util.Map;
2021
import java.util.Set;
@@ -31,6 +32,8 @@
3132
* @author Spencer Witt
3233
*/
3334
public class ApplicationSearchCriteria extends BaseSearchCriteria implements Buildable<ApplicationSearchCriteria> {
35+
public static final Set<String> NullableFields = new HashSet<>();
36+
3437
public static final Map<String, String> SortableFields = new LinkedHashMap<>();
3538

3639
public String name;
@@ -45,7 +48,7 @@ public ApplicationSearchCriteria prepare() {
4548
orderBy = defaultOrderBy();
4649
}
4750

48-
orderBy = normalizeOrderBy(orderBy, SortableFields);
51+
orderBy = normalizeOrderBy(orderBy, SortableFields, NullableFields);
4952
name = toSearchString(name);
5053
return this;
5154
}
@@ -61,6 +64,8 @@ protected String defaultOrderBy() {
6164
}
6265

6366
static {
67+
NullableFields.add("tenant");
68+
6469
SortableFields.put("id", "a.id");
6570
SortableFields.put("insertInstant", "a.insert_instant");
6671
SortableFields.put("name", "a.name");

0 commit comments

Comments
 (0)