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 wied03/ENG-1/ENG-2074/api_version #49

Closed
Closed
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
46 changes: 46 additions & 0 deletions src/main/java/io/fusionauth/client/FusionAuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
import io.fusionauth.domain.api.user.VerifyEmailResponse;
import io.fusionauth.domain.api.user.VerifyRegistrationRequest;
import io.fusionauth.domain.api.user.VerifyRegistrationResponse;
import io.fusionauth.domain.api.user.verify.VerifyStartRequest;
import io.fusionauth.domain.api.user.verify.VerifyStartResponse;
import io.fusionauth.domain.api.user.verify.VerifySendCompleteRequest;
import io.fusionauth.domain.oauth2.AccessToken;
import io.fusionauth.domain.oauth2.DeviceApprovalResponse;
import io.fusionauth.domain.oauth2.IntrospectResponse;
Expand Down Expand Up @@ -540,6 +543,20 @@ public ClientResponse<UserCommentResponse, Errors> commentOnUser(UserCommentRequ
.go();
}

/**
* Completes verification of an identity using verification codes from the Verify Start API.
*
* @param request The identity verify complete request that contains all the information used to verify the identity.
* @return The ClientResponse object.
*/
public ClientResponse<Void, Errors> completeVerifyIdentity(VerifySendCompleteRequest request) {
return start(Void.TYPE, Errors.class)
.uri("/api/identity/verify/complete")
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.post()
.go();
}

/**
* Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
*
Expand Down Expand Up @@ -4977,6 +4994,20 @@ public ClientResponse<Void, Errors> sendTwoFactorCodeForLoginUsingMethod(String
.go();
}

/**
* Send a verification code using the appropriate transport for the identity type being verified.
*
* @param request The identity verify send request that contains all the information used send the code.
* @return The ClientResponse object.
*/
public ClientResponse<Void, Errors> sendVerifyIdentity(VerifySendCompleteRequest request) {
return start(Void.TYPE, Errors.class)
.uri("/api/identity/verify/send")
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.post()
.go();
}

/**
* Begins a login request for a 3rd party login that requires user interaction such as HYPR.
*
Expand Down Expand Up @@ -5026,6 +5057,21 @@ public ClientResponse<TwoFactorStartResponse, Errors> startTwoFactorLogin(TwoFac
.go();
}

/**
* Start a verification of an identity by generating a code. This code can be sent to the User using the Verify Send API
* Verification Code API or using a mechanism outside of FusionAuth. The verification is completed by using the Verify Complete API with this code.
*
* @param request The identity verify start request that contains all the information used to begin the request.
* @return The ClientResponse object.
*/
public ClientResponse<VerifyStartResponse, Errors> startVerifyIdentity(VerifyStartRequest request) {
return start(VerifyStartResponse.class, Errors.class)
.uri("/api/identity/verify/start")
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.post()
.go();
}

/**
* Start a WebAuthn authentication ceremony by generating a new challenge for the user
*
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/java/io/fusionauth/domain/Tenant.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public class Tenant implements Buildable<Tenant> {

public UUID id;

public TenantIdentityConfiguration identityConfiguration = new TenantIdentityConfiguration();

public ZonedDateTime insertInstant;

public String issuer;
Expand Down Expand Up @@ -143,7 +141,6 @@ public Tenant(Tenant other) {
this.formConfiguration = new TenantFormConfiguration(other.formConfiguration);
this.httpSessionMaxInactiveInterval = other.httpSessionMaxInactiveInterval;
this.id = other.id;
this.identityConfiguration = new TenantIdentityConfiguration(other.identityConfiguration);
this.insertInstant = other.insertInstant;
this.accessControlConfiguration = new TenantAccessControlConfiguration(other.accessControlConfiguration);
this.issuer = other.issuer;
Expand Down Expand Up @@ -192,7 +189,6 @@ public boolean equals(Object o) {
Objects.equals(familyConfiguration, tenant.familyConfiguration) &&
Objects.equals(formConfiguration, tenant.formConfiguration) &&
Objects.equals(id, tenant.id) &&
Objects.equals(identityConfiguration, tenant.identityConfiguration) &&
Objects.equals(insertInstant, tenant.insertInstant) &&
Objects.equals(accessControlConfiguration, tenant.accessControlConfiguration) &&
Objects.equals(issuer, tenant.issuer) &&
Expand Down Expand Up @@ -238,7 +234,6 @@ public int hashCode() {
formConfiguration,
httpSessionMaxInactiveInterval,
id,
identityConfiguration,
insertInstant,
accessControlConfiguration,
issuer,
Expand Down

This file was deleted.

This file was deleted.

11 changes: 8 additions & 3 deletions src/main/java/io/fusionauth/domain/event/BaseUserEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.UUID;

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

/**
* Base class for all {@link User}-related events.
Expand All @@ -35,7 +35,10 @@ public BaseUserEvent() {

public BaseUserEvent(EventInfo info, User user) {
super(info);
this.user = user;
this.user = null;
if (user != null) {
this.user = new User(user).secure().sort();
}
}

@Override
Expand Down Expand Up @@ -64,6 +67,7 @@ public int hashCode() {

public static class IdentityInfo {
public final String type;

public final String value;

@JacksonConstructor
Expand All @@ -78,7 +82,8 @@ public IdentityInfo(String type, String value) {
this.value = value;
}

@Override public boolean equals(Object o) {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/io/fusionauth/domain/event/EventRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
* Copyright (c) 2018-2025, 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 All @@ -17,21 +17,15 @@

import java.util.Objects;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.inversoft.json.JacksonConstructor;
import com.inversoft.json.ToString;
import io.fusionauth.client.json.WebhookEventDeserializer;

/**
* Container for the event information. This is the JSON that is sent from FusionAuth to webhooks.
*
* @author Brian Pontarelli
*/
public class EventRequest {
// TODO : ENG-1822 : Can we delete this if we aren't going to use it an longer?
// Some tests still use it, maybe we should only bind it ot the TestObjectMapper?
// See one usage: UserActionTest.post_noPassword_has_email_and_phone
@JsonDeserialize(using = WebhookEventDeserializer.class)
public BaseEvent event;

@JacksonConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.util.UUID;

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

/**
* Models the identity verified event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import java.util.UUID;

import com.inversoft.json.JacksonConstructor;
import io.fusionauth.domain.User;
import io.fusionauth.domain.Buildable;
import io.fusionauth.domain.EventInfo;
import io.fusionauth.domain.User;
import io.fusionauth.domain.jwt.RefreshToken;

/**
Expand Down Expand Up @@ -53,15 +53,19 @@ public JWTRefreshTokenRevokeEvent(EventInfo info, User user, UUID applicationId,
super(info);
this.applicationId = applicationId;
this.applicationTimeToLiveInSeconds.put(applicationId, timeToLiveInSeconds);
this.user = user;
this.userId = user == null ? null : user.id;
if (user != null) {
this.user = new User(user).secure().sort();
this.userId = user.id;
}
}

public JWTRefreshTokenRevokeEvent(EventInfo info, User user, Map<UUID, Integer> applicationTimeToLiveInSeconds) {
super(info);
this.applicationTimeToLiveInSeconds.putAll(applicationTimeToLiveInSeconds);
this.user = user;
this.userId = user == null ? null : user.id;
if (user != null) {
this.user = new User(user).secure().sort();
this.userId = user.id;
}
}

public List<UUID> applicationIds() {
Expand Down
Loading