diff --git a/build.savant b/build.savant index b8dbe0bb..d4e1b008 100644 --- a/build.savant +++ b/build.savant @@ -21,7 +21,7 @@ javaErrorVersion = "2.2.3" restifyVersion = "4.2.1" testngVersion = "7.5.1" -project(group: "io.fusionauth", name: "fusionauth-java-client", version: "1.54.0", licenses: ["ApacheV2_0"]) { +project(group: "io.fusionauth", name: "fusionauth-java-client", version: "1.55.0", licenses: ["ApacheV2_0"]) { workflow { fetch { cache() @@ -58,13 +58,13 @@ project(group: "io.fusionauth", name: "fusionauth-java-client", version: "1.54.0 } // Plugins -dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:2.0.0-RC.7") -java = loadPlugin(id: "org.savantbuild.plugin:java:2.0.0-RC.6") -javaTestNG = loadPlugin(id: "org.savantbuild.plugin:java-testng:2.0.0-RC.6") -file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0-RC.7") -idea = loadPlugin(id: "org.savantbuild.plugin:idea:2.0.0-RC.7") -pom = loadPlugin(id: "org.savantbuild.plugin:pom:2.0.0-RC.6") -release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0-RC.6") +dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:2.0.0") +java = loadPlugin(id: "org.savantbuild.plugin:java:2.0.0") +javaTestNG = loadPlugin(id: "org.savantbuild.plugin:java-testng:2.0.0") +file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0") +idea = loadPlugin(id: "org.savantbuild.plugin:idea:2.0.0") +pom = loadPlugin(id: "org.savantbuild.plugin:pom:2.0.0") +release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0") // Plugin settings java.settings.javaVersion = "1.8" diff --git a/pom.xml b/pom.xml index 3a60db50..5899fd8b 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ io.fusionauth fusionauth-java-client - 1.54.0 + 1.55.0 jar FusionAuth Java Client Library diff --git a/src/main/java/io/fusionauth/domain/APIKey.java b/src/main/java/io/fusionauth/domain/APIKey.java index 05db7e3b..24a87a65 100644 --- a/src/main/java/io/fusionauth/domain/APIKey.java +++ b/src/main/java/io/fusionauth/domain/APIKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, FusionAuth, All Rights Reserved + * Copyright (c) 2021-2024, FusionAuth, All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,8 @@ * @author sanjay */ public class APIKey implements Buildable { + public ZonedDateTime expirationInstant; + public UUID id; public ZonedDateTime insertInstant; @@ -68,6 +70,7 @@ public boolean equals(Object o) { } APIKey apiKey = (APIKey) o; return keyManager == apiKey.keyManager && + Objects.equals(expirationInstant, apiKey.expirationInstant) && Objects.equals(id, apiKey.id) && Objects.equals(insertInstant, apiKey.insertInstant) && Objects.equals(ipAccessControlListId, apiKey.ipAccessControlListId) && @@ -80,7 +83,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, insertInstant, ipAccessControlListId, key, keyManager, lastUpdateInstant, metaData, permissions, tenantId); + return Objects.hash(expirationInstant, id, insertInstant, ipAccessControlListId, key, keyManager, lastUpdateInstant, metaData, permissions, tenantId); } public void normalize() { diff --git a/src/main/java/io/fusionauth/domain/JWTConfiguration.java b/src/main/java/io/fusionauth/domain/JWTConfiguration.java index 3227928d..00634fa7 100644 --- a/src/main/java/io/fusionauth/domain/JWTConfiguration.java +++ b/src/main/java/io/fusionauth/domain/JWTConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, FusionAuth, All Rights Reserved + * Copyright (c) 2019-2024, FusionAuth, All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,8 @@ public class JWTConfiguration extends Enableable implements Buildable { + public int gracePeriodInSeconds; + + @JacksonConstructor + public RefreshTokenOneTimeUseConfiguration() { + } + + public RefreshTokenOneTimeUseConfiguration(RefreshTokenOneTimeUseConfiguration other) { + this.gracePeriodInSeconds = other.gracePeriodInSeconds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefreshTokenOneTimeUseConfiguration that = (RefreshTokenOneTimeUseConfiguration) o; + return gracePeriodInSeconds == that.gracePeriodInSeconds; + } + + @Override + public int hashCode() { + return Objects.hash(gracePeriodInSeconds); + } + + @Override + public String toString() { + return ToString.toString(this); + } +} diff --git a/src/main/java/io/fusionauth/domain/RefreshTokenRevocationPolicy.java b/src/main/java/io/fusionauth/domain/RefreshTokenRevocationPolicy.java index 59e437b0..03c00b60 100644 --- a/src/main/java/io/fusionauth/domain/RefreshTokenRevocationPolicy.java +++ b/src/main/java/io/fusionauth/domain/RefreshTokenRevocationPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, FusionAuth, All Rights Reserved + * Copyright (c) 2020-2024, FusionAuth, All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ public class RefreshTokenRevocationPolicy implements Buildable { public UIConfiguration uiConfiguration = new UIConfiguration(); + public UsageDataConfiguration usageDataConfiguration = new UsageDataConfiguration(); + public WebhookEventLogConfiguration webhookEventLogConfiguration = new WebhookEventLogConfiguration(); @JacksonConstructor @@ -74,6 +76,7 @@ public SystemConfiguration(SystemConfiguration other) { this.reportTimezone = other.reportTimezone; this.trustedProxyConfiguration = new SystemTrustedProxyConfiguration(other.trustedProxyConfiguration); this.uiConfiguration = new UIConfiguration(other.uiConfiguration); + this.usageDataConfiguration = new UsageDataConfiguration(other.usageDataConfiguration); this.webhookEventLogConfiguration = new WebhookEventLogConfiguration(other.webhookEventLogConfiguration); } @@ -97,12 +100,13 @@ public boolean equals(Object o) { Objects.equals(trustedProxyConfiguration, that.trustedProxyConfiguration) && Objects.equals(reportTimezone, that.reportTimezone) && Objects.equals(uiConfiguration, that.uiConfiguration) && + Objects.equals(usageDataConfiguration, that.usageDataConfiguration) && Objects.equals(webhookEventLogConfiguration, that.webhookEventLogConfiguration); } @Override public int hashCode() { - return Objects.hash(auditLogConfiguration, cookieEncryptionKey, corsConfiguration, data, eventLogConfiguration, insertInstant, lastUpdateInstant, loginRecordConfiguration, reportTimezone, trustedProxyConfiguration, uiConfiguration, webhookEventLogConfiguration); + return Objects.hash(auditLogConfiguration, cookieEncryptionKey, corsConfiguration, data, eventLogConfiguration, insertInstant, lastUpdateInstant, loginRecordConfiguration, reportTimezone, trustedProxyConfiguration, uiConfiguration, usageDataConfiguration, webhookEventLogConfiguration); } public void normalize() { diff --git a/src/main/java/io/fusionauth/domain/UsageDataConfiguration.java b/src/main/java/io/fusionauth/domain/UsageDataConfiguration.java new file mode 100644 index 00000000..73fe3b94 --- /dev/null +++ b/src/main/java/io/fusionauth/domain/UsageDataConfiguration.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024, FusionAuth, All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ +package io.fusionauth.domain; + +import java.util.Objects; + +import com.inversoft.json.JacksonConstructor; + +/** + * Config for Usage Data / Stats + * + * @author Lyle Schemmerling + */ +public class UsageDataConfiguration extends Enableable { + public int numberOfDaysToRetain = 366; + + @JacksonConstructor + public UsageDataConfiguration() { + } + + public UsageDataConfiguration(UsageDataConfiguration other) { + this.enabled = other.enabled; + this.numberOfDaysToRetain = other.numberOfDaysToRetain; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + UsageDataConfiguration that = (UsageDataConfiguration) o; + return numberOfDaysToRetain == that.numberOfDaysToRetain; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), numberOfDaysToRetain); + } +} diff --git a/src/main/java/io/fusionauth/domain/WebhookEventResult.java b/src/main/java/io/fusionauth/domain/WebhookEventResult.java index 4a2054d7..0fcb081a 100644 --- a/src/main/java/io/fusionauth/domain/WebhookEventResult.java +++ b/src/main/java/io/fusionauth/domain/WebhookEventResult.java @@ -33,9 +33,9 @@ public enum WebhookEventResult { * @return Return all available results in displayable order. */ public static List allResults() { - return Arrays.asList(WebhookEventResult.Failed, + return Arrays.asList(WebhookEventResult.Succeeded, WebhookEventResult.Running, - WebhookEventResult.Succeeded); + WebhookEventResult.Failed); } } diff --git a/src/main/java/io/fusionauth/domain/api/user/RegistrationResponse.java b/src/main/java/io/fusionauth/domain/api/user/RegistrationResponse.java index fe8207c5..da1a87bb 100644 --- a/src/main/java/io/fusionauth/domain/api/user/RegistrationResponse.java +++ b/src/main/java/io/fusionauth/domain/api/user/RegistrationResponse.java @@ -16,6 +16,7 @@ package io.fusionauth.domain.api.user; import java.time.ZonedDateTime; +import java.util.UUID; import com.inversoft.json.JacksonConstructor; import io.fusionauth.domain.User; @@ -29,6 +30,8 @@ public class RegistrationResponse { public String refreshToken; + public UUID refreshTokenId; + public UserRegistration registration; public String registrationVerificationId; diff --git a/src/main/java/io/fusionauth/domain/jwt/RefreshToken.java b/src/main/java/io/fusionauth/domain/jwt/RefreshToken.java index 0201bbca..7678d01c 100644 --- a/src/main/java/io/fusionauth/domain/jwt/RefreshToken.java +++ b/src/main/java/io/fusionauth/domain/jwt/RefreshToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, FusionAuth, All Rights Reserved + * Copyright (c) 2018-2024, FusionAuth, All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if (!(o instanceof RefreshToken)) { return false; } RefreshToken that = (RefreshToken) o; diff --git a/src/main/java/io/fusionauth/domain/provider/BaseSAMLv2IdentityProvider.java b/src/main/java/io/fusionauth/domain/provider/BaseSAMLv2IdentityProvider.java index f5b0af09..83df0869 100644 --- a/src/main/java/io/fusionauth/domain/provider/BaseSAMLv2IdentityProvider.java +++ b/src/main/java/io/fusionauth/domain/provider/BaseSAMLv2IdentityProvider.java @@ -1,5 +1,17 @@ /* - * Copyright (c) 2023, FusionAuth, All Rights Reserved + * Copyright (c) 2023-2024, FusionAuth, All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ package io.fusionauth.domain.provider; @@ -11,6 +23,8 @@ * @author Lyle Schemmerling */ public abstract class BaseSAMLv2IdentityProvider extends BaseIdentityProvider { + public SAMLv2AssertionDecryptionConfiguration assertionDecryptionConfiguration = new SAMLv2AssertionDecryptionConfiguration(); + public String emailClaim; /** @@ -36,15 +50,16 @@ public boolean equals(Object o) { return false; } BaseSAMLv2IdentityProvider that = (BaseSAMLv2IdentityProvider) o; - return useNameIdForEmail == that.useNameIdForEmail + return Objects.equals(assertionDecryptionConfiguration, that.assertionDecryptionConfiguration) && Objects.equals(emailClaim, that.emailClaim) && Objects.equals(keyId, that.keyId) && Objects.equals(uniqueIdClaim, that.uniqueIdClaim) + && useNameIdForEmail == that.useNameIdForEmail && Objects.equals(usernameClaim, that.usernameClaim); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), emailClaim, keyId, uniqueIdClaim, useNameIdForEmail, usernameClaim); + return Objects.hash(super.hashCode(), assertionDecryptionConfiguration, emailClaim, keyId, uniqueIdClaim, useNameIdForEmail, usernameClaim); } } diff --git a/src/main/java/io/fusionauth/domain/provider/SAMLv2AssertionDecryptionConfiguration.java b/src/main/java/io/fusionauth/domain/provider/SAMLv2AssertionDecryptionConfiguration.java new file mode 100644 index 00000000..6b6ea34d --- /dev/null +++ b/src/main/java/io/fusionauth/domain/provider/SAMLv2AssertionDecryptionConfiguration.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024, FusionAuth, All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ +package io.fusionauth.domain.provider; + +import java.util.Objects; +import java.util.UUID; + +import com.inversoft.json.ToString; +import io.fusionauth.domain.Enableable; + +/** + * Configuration for encrypted assertions when acting as SAML Service Provider + * + * @author Jaret Hendrickson + */ +public class SAMLv2AssertionDecryptionConfiguration extends Enableable { + public UUID keyTransportDecryptionKeyId; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SAMLv2AssertionDecryptionConfiguration)) { + return false; + } + if (!super.equals(o)) { + return false; + } + SAMLv2AssertionDecryptionConfiguration that = (SAMLv2AssertionDecryptionConfiguration) o; + return Objects.equals(keyTransportDecryptionKeyId, that.keyTransportDecryptionKeyId); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), keyTransportDecryptionKeyId); + } + + @Override + public String toString() { + return ToString.toString(this); + } +} diff --git a/src/main/java/io/fusionauth/domain/search/GroupMemberSearchCriteria.java b/src/main/java/io/fusionauth/domain/search/GroupMemberSearchCriteria.java index 09fd557c..3addc3d8 100644 --- a/src/main/java/io/fusionauth/domain/search/GroupMemberSearchCriteria.java +++ b/src/main/java/io/fusionauth/domain/search/GroupMemberSearchCriteria.java @@ -20,6 +20,7 @@ import java.util.Set; import java.util.UUID; +import io.fusionauth.domain.Buildable; import static io.fusionauth.domain.util.SQLTools.normalizeOrderBy; /** @@ -27,7 +28,7 @@ * * @author Daniel DeGroff */ -public class GroupMemberSearchCriteria extends BaseSearchCriteria { +public class GroupMemberSearchCriteria extends BaseSearchCriteria implements Buildable { public static final Map SortableFields = new LinkedHashMap<>(); public UUID groupId;