Skip to content

Commit b45722c

Browse files
wied03andrewpailyleschemmerling
authored
Merge feature/admin-app-reskin (#170)
* add verificationIds to combo API * add skipUserRequirement to other repos * add verificationIds to combo API (#148) * Merge wied03/ENG-2192/pre-verify-form-api (#150) * form step type added to clients * form step type added to clients * domain object updates * exclude from java client * updated form step type * dial in our exclusion * better comments on enum * equality/PR * add verificationIds to combo API (#151) * /api/identity/verify/start pre-verify field rename * camelCase API --------- Co-authored-by: Andy Pai <8798244+andrewpai@users.noreply.github.com> Co-authored-by: Lyle Schemmerling <lshem16@gmail.com>
1 parent 79ba9b9 commit b45722c

7 files changed

Lines changed: 85 additions & 7 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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.api.identity.verify;
17+
18+
/**
19+
* Represent the various states/expectations of a user in the context of starting verification
20+
*/
21+
public enum ExistingUserStrategy {
22+
mustExist,
23+
mustNotExist
24+
}

src/main/java/io/fusionauth/domain/api/identity/verify/VerifyStartRequest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
public class VerifyStartRequest implements Buildable<VerifyStartRequest> {
2828
public UUID applicationId;
2929

30+
/**
31+
* When MustExist (default), loginId/loginIdType must correspond to a user in the tenant. When this is MustNotExist, verification can begin
32+
* without a user, in order to perform verification before user creation.
33+
*/
34+
public ExistingUserStrategy existingUserStrategy = ExistingUserStrategy.mustExist;
35+
3036
public String loginId;
3137

3238
public String loginIdType;

src/main/java/io/fusionauth/domain/api/user/RegistrationRequest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
package io.fusionauth.domain.api.user;
1717

18+
import java.util.ArrayList;
19+
import java.util.List;
20+
1821
import com.inversoft.json.JacksonConstructor;
1922
import io.fusionauth.domain.EventInfo;
2023
import io.fusionauth.domain.SendSetPasswordIdentityType;
@@ -48,6 +51,8 @@ public class RegistrationRequest extends BaseEventRequest {
4851

4952
public User user;
5053

54+
public List<String> verificationIds = new ArrayList<>();
55+
5156
@JacksonConstructor
5257
public RegistrationRequest() {
5358
}

src/main/java/io/fusionauth/domain/api/user/RegistrationResponse.java

Lines changed: 5 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.
@@ -16,11 +16,13 @@
1616
package io.fusionauth.domain.api.user;
1717

1818
import java.time.ZonedDateTime;
19+
import java.util.List;
1920
import java.util.UUID;
2021

2122
import com.inversoft.json.JacksonConstructor;
2223
import io.fusionauth.domain.User;
2324
import io.fusionauth.domain.UserRegistration;
25+
import io.fusionauth.domain.api.UserResponse.VerificationId;
2426

2527
/**
2628
* Registration API request object.
@@ -44,6 +46,8 @@ public class RegistrationResponse {
4446

4547
public User user;
4648

49+
public List<VerificationId> verificationIds;
50+
4751
@JacksonConstructor
4852
public RegistrationResponse() {
4953
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2020-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.
@@ -85,9 +85,9 @@ public int hashCode() {
8585

8686
public void normalize() {
8787
Normalizer.removeEmpty(data);
88-
// Remove any null steps, steps w/out fields, and any null fields in steps
88+
// Remove any null steps, collectData steps w/out fields, and any null fields in steps
8989
Normalizer.removeEmpty(steps);
90-
steps.removeIf(step -> step.fields.isEmpty());
90+
steps.removeIf(step -> step.type == FormStepType.collectData && step.fields.isEmpty());
9191
steps.stream().map(step -> step.fields).forEach(Normalizer::removeEmpty);
9292
}
9393

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2020-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.
@@ -21,6 +21,7 @@
2121
import java.util.Objects;
2222
import java.util.UUID;
2323

24+
import com.fasterxml.jackson.annotation.JsonIgnore;
2425
import com.inversoft.json.JacksonConstructor;
2526
import com.inversoft.json.ToString;
2627
import io.fusionauth.domain.Buildable;
@@ -31,11 +32,14 @@
3132
public class FormStep implements Buildable<FormStep> {
3233
public List<UUID> fields = new ArrayList<>();
3334

35+
public FormStepType type = FormStepType.collectData;
36+
3437
@JacksonConstructor
3538
public FormStep() {
3639
}
3740

3841
public FormStep(FormStep other) {
42+
type = other.type;
3943
fields.addAll(other.fields);
4044
}
4145

@@ -52,12 +56,12 @@ public boolean equals(Object o) {
5256
return false;
5357
}
5458
FormStep formStep = (FormStep) o;
55-
return Objects.equals(fields, formStep.fields);
59+
return Objects.equals(fields, formStep.fields) && type == formStep.type;
5660
}
5761

5862
@Override
5963
public int hashCode() {
60-
return Objects.hash(fields);
64+
return Objects.hash(fields, type);
6165
}
6266

6367
@Override
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.form;
17+
18+
/**
19+
* Denotes the type of form step. This is used to configure different behavior on form steps in the registration flow.
20+
*/
21+
public enum FormStepType {
22+
// NOTE: These are ordinal, always add to the end
23+
/**
24+
* Collects data from the user.
25+
*/
26+
collectData,
27+
/**
28+
* Verifies the user's email address before creating the user.
29+
*/
30+
verifyEmail,
31+
/**
32+
* Verifies the user's phone number before creating the user.
33+
*/
34+
verifyPhoneNumber
35+
}

0 commit comments

Comments
 (0)