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

issue-1589 #28

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ guiceVersion = "5.1.0"
jacksonVersion = "2.13.2"
jackson5Version = "2.6.1"
javaErrorVersion = "2.2.3"
restifyVersion = "3.9.0"
restifyVersion = "3.9.1"
testngVersion = "7.3.0"

project(group: "io.fusionauth", name: "fusionauth-java-client", version: "1.35.1", licenses: ["ApacheV2_0"]) {
Expand Down
4 changes: 2 additions & 2 deletions fusionauth-java-client.iml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/inversoft/restify/3.9.0/restify-3.9.0.jar!/" />
<root url="jar://$USER_HOME$/.savant/cache/com/inversoft/restify/3.9.1/restify-3.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/inversoft/restify/3.9.0/restify-3.9.0-src.jar!/" />
<root url="jar://$USER_HOME$/.savant/cache/com/inversoft/restify/3.9.1/restify-3.9.1-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019, FusionAuth, All Rights Reserved
* Copyright (c) 2018-2022, FusionAuth, All Rights Reserved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have the wrong copyright here, can you update this to the Apache license.

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,11 +18,12 @@
import java.util.UUID;

import io.fusionauth.domain.Buildable;
import io.fusionauth.domain.api.BaseEventRequest;

/**
* @author Daniel DeGroff
*/
public class IdentityProviderLinkRequest implements Buildable<IdentityProviderLinkRequest> {
public class IdentityProviderLinkRequest extends BaseEventRequest implements Buildable<IdentityProviderLinkRequest> {
public String displayName;

public UUID identityProviderId;
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/io/fusionauth/domain/event/EventType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, FusionAuth, All Rights Reserved
* Copyright (c) 2018-2022, FusionAuth, All Rights Reserved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have the wrong copyright here, can you update this to the Apache license.

*
* 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 @@ -56,14 +56,18 @@ public enum EventType {

UserDeleteComplete("user.delete.complete"),

UserLoginIdDuplicateOnCreate("user.loginId.duplicate.create"),

UserLoginIdDuplicateOnUpdate("user.loginId.duplicate.update"),

UserEmailUpdate("user.email.update"),

UserEmailVerified("user.email.verified"),

UserIdentityProviderLink("user.identity-provider.link"),

UserIdentityProviderUnlink("user.identity-provider.unlink"),

UserLoginIdDuplicateOnCreate("user.loginId.duplicate.create"),

UserLoginIdDuplicateOnUpdate("user.loginId.duplicate.update"),

UserLoginFailed("user.login.failed"),

UserLoginNewDevice("user.login.new-device"),
Expand Down Expand Up @@ -135,6 +139,8 @@ public static List<EventType> allTypes() {
EventType.UserDeleteComplete,
EventType.UserEmailUpdate,
EventType.UserEmailVerified,
EventType.UserIdentityProviderLink,
EventType.UserIdentityProviderUnlink,
EventType.UserLoginIdDuplicateOnCreate,
EventType.UserLoginIdDuplicateOnUpdate,
EventType.UserLoginFailed,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (c) 2022, 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.event;

import java.util.Objects;

import com.inversoft.json.JacksonConstructor;
import com.inversoft.json.ToString;
import io.fusionauth.domain.Buildable;
import io.fusionauth.domain.EventInfo;
import io.fusionauth.domain.IdentityProviderLink;
import io.fusionauth.domain.User;

/**
* Models the User Identity Provider Link Event.
*
* @author Rob Davis
*/
public class UserIdentityProviderLinkEvent extends BaseEvent implements Buildable<UserIdentityProviderLinkEvent>, NonTransactionalEvent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing equals and hashCode.

public IdentityProviderLink identityProviderLink;

public User user;

@JacksonConstructor
public UserIdentityProviderLinkEvent() {
}

public UserIdentityProviderLinkEvent(EventInfo info, IdentityProviderLink identityProviderLink, User user) {
super(info);
this.identityProviderLink = identityProviderLink;
this.user = user;
}

@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;
}
UserIdentityProviderLinkEvent that = (UserIdentityProviderLinkEvent) o;
return Objects.equals(identityProviderLink, that.identityProviderLink) && Objects.equals(user, that.user);
}

@Override
public EventType getType() {
return EventType.UserIdentityProviderLink;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), identityProviderLink, user);
}

@Override
public String toString() {
return ToString.toString(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (c) 2022, 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.event;

import java.util.Objects;

import com.inversoft.json.JacksonConstructor;
import com.inversoft.json.ToString;
import io.fusionauth.domain.Buildable;
import io.fusionauth.domain.EventInfo;
import io.fusionauth.domain.IdentityProviderLink;
import io.fusionauth.domain.User;

/**
* Models the User Identity Provider Unlink Event.
*
* @author Rob Davis
*/
public class UserIdentityProviderUnlinkEvent extends BaseEvent implements Buildable<UserIdentityProviderUnlinkEvent>, NonTransactionalEvent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Equals, hashcode.

public IdentityProviderLink identityProviderLink;

public User user;

@JacksonConstructor
public UserIdentityProviderUnlinkEvent() {
}

public UserIdentityProviderUnlinkEvent(EventInfo info, IdentityProviderLink identityProviderLink, User user) {
super(info);
this.identityProviderLink = identityProviderLink;
this.user = user;
}

@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;
}
UserIdentityProviderUnlinkEvent that = (UserIdentityProviderUnlinkEvent) o;
return Objects.equals(identityProviderLink, that.identityProviderLink) && Objects.equals(user, that.user);
}

@Override
public EventType getType() {
return EventType.UserIdentityProviderUnlink;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), identityProviderLink, user);
}

@Override
public String toString() {
return ToString.toString(this);
}
}