Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge releases/1.55.0 #47

Merged
merged 14 commits into from
Dec 21, 2024
16 changes: 8 additions & 8 deletions build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<groupId>io.fusionauth</groupId>
<artifactId>fusionauth-java-client</artifactId>
<version>1.54.0</version>
<version>1.55.0</version>
<packaging>jar</packaging>

<name>FusionAuth Java Client Library</name>
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/io/fusionauth/domain/APIKey.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -32,6 +32,8 @@
* @author sanjay
*/
public class APIKey implements Buildable<APIKey> {
public ZonedDateTime expirationInstant;

public UUID id;

public ZonedDateTime insertInstant;
Expand Down Expand Up @@ -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) &&
Expand All @@ -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() {
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/io/fusionauth/domain/JWTConfiguration.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -40,6 +40,8 @@ public class JWTConfiguration extends Enableable implements Buildable<JWTConfigu

public RefreshTokenExpirationPolicy refreshTokenExpirationPolicy = RefreshTokenExpirationPolicy.Fixed;

public RefreshTokenOneTimeUseConfiguration refreshTokenOneTimeUseConfiguration = new RefreshTokenOneTimeUseConfiguration();

/**
* This can only be set at the tenant level.
*/
Expand Down Expand Up @@ -71,6 +73,7 @@ public JWTConfiguration(JWTConfiguration other) {
this.idTokenKeyId = other.idTokenKeyId;
this.refreshTokenExpirationPolicy = other.refreshTokenExpirationPolicy;
this.refreshTokenRevocationPolicy = new RefreshTokenRevocationPolicy(other.refreshTokenRevocationPolicy);
this.refreshTokenOneTimeUseConfiguration = new RefreshTokenOneTimeUseConfiguration(other.refreshTokenOneTimeUseConfiguration);
this.refreshTokenSlidingWindowConfiguration = new RefreshTokenSlidingWindowConfiguration(other.refreshTokenSlidingWindowConfiguration);
this.refreshTokenTimeToLiveInMinutes = other.refreshTokenTimeToLiveInMinutes;
this.refreshTokenUsagePolicy = other.refreshTokenUsagePolicy;
Expand All @@ -93,6 +96,7 @@ public boolean equals(Object o) {
Objects.equals(idTokenKeyId, that.idTokenKeyId) &&
refreshTokenExpirationPolicy == that.refreshTokenExpirationPolicy &&
Objects.equals(refreshTokenRevocationPolicy, that.refreshTokenRevocationPolicy) &&
Objects.equals(refreshTokenOneTimeUseConfiguration, that.refreshTokenOneTimeUseConfiguration) &&
Objects.equals(refreshTokenSlidingWindowConfiguration, that.refreshTokenSlidingWindowConfiguration) &&
refreshTokenTimeToLiveInMinutes == that.refreshTokenTimeToLiveInMinutes &&
refreshTokenUsagePolicy == that.refreshTokenUsagePolicy &&
Expand All @@ -106,6 +110,7 @@ public int hashCode() {
idTokenKeyId,
refreshTokenExpirationPolicy,
refreshTokenRevocationPolicy,
refreshTokenOneTimeUseConfiguration,
refreshTokenSlidingWindowConfiguration,
refreshTokenTimeToLiveInMinutes,
refreshTokenUsagePolicy,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* 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;
import com.inversoft.json.ToString;

/**
* Refresh token one-time use configuration. This configuration is utilized when the usage policy is
* configured for one-time use.
*
* @author Daniel DeGroff
*/
public class RefreshTokenOneTimeUseConfiguration implements Buildable<RefreshTokenOneTimeUseConfiguration> {
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);
}
}
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -28,6 +28,8 @@ public class RefreshTokenRevocationPolicy implements Buildable<RefreshTokenRevoc

public boolean onMultiFactorEnable;

public boolean onOneTimeTokenReuse;

public boolean onPasswordChanged;

@JacksonConstructor
Expand All @@ -38,6 +40,7 @@ public RefreshTokenRevocationPolicy(RefreshTokenRevocationPolicy other) {
this.onLoginPrevented = other.onLoginPrevented;
this.onMultiFactorEnable = other.onMultiFactorEnable;
this.onPasswordChanged = other.onPasswordChanged;
this.onOneTimeTokenReuse = other.onOneTimeTokenReuse;
}

public RefreshTokenRevocationPolicy(boolean onLoginPrevented, boolean onPasswordChanged) {
Expand All @@ -54,12 +57,12 @@ public boolean equals(Object o) {
return false;
}
RefreshTokenRevocationPolicy that = (RefreshTokenRevocationPolicy) o;
return onLoginPrevented == that.onLoginPrevented && onMultiFactorEnable == that.onMultiFactorEnable && onPasswordChanged == that.onPasswordChanged;
return onLoginPrevented == that.onLoginPrevented && onMultiFactorEnable == that.onMultiFactorEnable && onPasswordChanged == that.onPasswordChanged && onOneTimeTokenReuse == that.onOneTimeTokenReuse;
}

@Override
public int hashCode() {
return Objects.hash(onLoginPrevented, onMultiFactorEnable, onPasswordChanged);
return Objects.hash(onLoginPrevented, onMultiFactorEnable, onPasswordChanged, onOneTimeTokenReuse);
}

@Override
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/fusionauth/domain/SystemConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class SystemConfiguration implements Buildable<SystemConfiguration> {

public UIConfiguration uiConfiguration = new UIConfiguration();

public UsageDataConfiguration usageDataConfiguration = new UsageDataConfiguration();

public WebhookEventLogConfiguration webhookEventLogConfiguration = new WebhookEventLogConfiguration();

@JacksonConstructor
Expand All @@ -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);
}

Expand All @@ -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() {
Expand Down
58 changes: 58 additions & 0 deletions src/main/java/io/fusionauth/domain/UsageDataConfiguration.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
4 changes: 2 additions & 2 deletions src/main/java/io/fusionauth/domain/WebhookEventResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public enum WebhookEventResult {
* @return Return all available results in displayable order.
*/
public static List<WebhookEventResult> allResults() {
return Arrays.asList(WebhookEventResult.Failed,
return Arrays.asList(WebhookEventResult.Succeeded,
WebhookEventResult.Running,
WebhookEventResult.Succeeded);
WebhookEventResult.Failed);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,6 +30,8 @@
public class RegistrationResponse {
public String refreshToken;

public UUID refreshTokenId;

public UserRegistration registration;

public String registrationVerificationId;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/fusionauth/domain/jwt/RefreshToken.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -11,6 +23,8 @@
* @author Lyle Schemmerling
*/
public abstract class BaseSAMLv2IdentityProvider<D extends BaseIdentityProviderApplicationConfiguration> extends BaseIdentityProvider<D> {
public SAMLv2AssertionDecryptionConfiguration assertionDecryptionConfiguration = new SAMLv2AssertionDecryptionConfiguration();

public String emailClaim;

/**
Expand All @@ -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);
}
}
Loading