From 2d370bffc1c5ab90d7558f706482122c503ad505 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Fri, 20 Dec 2024 16:24:35 -0700 Subject: [PATCH 01/10] Get Java client compiling w/o InternalUser --- build.savant | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.savant b/build.savant index cbb2dbdb..0338a0ce 100644 --- a/build.savant +++ b/build.savant @@ -170,6 +170,8 @@ target(name: "build-java", description: "Build the Java Client Library") { filter(token: ".*@MaskMapValue\\(.*\n", value: "") filter(token: ".*@MaskString.*\n", value: "") filter(token: ".*@InternalUse.*\n ", value: "") + filter(token: "import io.fusionauth.api.domain.users.InternalUser;", value: "import io.fusionauth.domain.User;") + filter(token: "InternalUser", value: "User") } file.prune(dir: "../fusionauth-java-client/src/main/java/io/fusionauth/client") file.copy(to: "../fusionauth-java-client/src/main/java/io/fusionauth/client") { From 695890308225c3f706ac28caf8a21fd326d24120 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Fri, 20 Dec 2024 16:32:43 -0700 Subject: [PATCH 02/10] More Java fixes --- src/main/client/java.client.ftl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index 7f65a0bb..f1b2ee1b 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -35,6 +35,7 @@ import com.inversoft.rest.FormDataBodyHandler; import com.inversoft.rest.JSONBodyHandler; import com.inversoft.rest.JSONResponseHandler; import com.inversoft.rest.RESTClient; +import io.fusionauth.domain.APIVersion; import io.fusionauth.domain.LambdaType; import io.fusionauth.domain.OpenIdConfiguration; import io.fusionauth.domain.api.APIKeyRequest; @@ -252,6 +253,7 @@ import io.fusionauth.domain.provider.IdentityProviderType; */ @SuppressWarnings("unused") public class FusionAuthClient { + public static String API_VERSION_HEADER = "X-FusionAuth-API-Version"; public static String TENANT_ID_HEADER = "X-FusionAuth-TenantId"; public static final ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL) @@ -267,6 +269,8 @@ public class FusionAuthClient { private final String apiKey; + public final APIVersion apiVersion; + private final String baseURL; private final ObjectMapper customMapper; @@ -282,19 +286,20 @@ public class FusionAuthClient { } public FusionAuthClient(String apiKey, String baseURL, String tenantId) { - this(apiKey, baseURL, 2000, 2000, tenantId); + this(apiKey, baseURL, 2000, 2000, tenantId, APIVersion.V1); } public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout) { - this(apiKey, baseURL, connectTimeout, readTimeout, null); + this(apiKey, baseURL, connectTimeout, readTimeout, null, APIVersion.V1); } - public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId) { - this(apiKey, baseURL, connectTimeout, readTimeout, tenantId, null); + public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, APIVersion apiVersion) { + this(apiKey, baseURL, connectTimeout, readTimeout, tenantId, null, apiVersion); } - public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, ObjectMapper objectMapper) { + public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, ObjectMapper objectMapper, APIVersion apiVersion) { this.apiKey = apiKey; + this.apiVersion = apiVersion; this.baseURL = baseURL; this.connectTimeout = connectTimeout; this.readTimeout = readTimeout; @@ -316,7 +321,7 @@ public class FusionAuthClient { return this; } - return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId.toString()); + return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId.toString(), apiVersion); } /** @@ -327,7 +332,7 @@ public class FusionAuthClient { * @return the new FusionAuthClient */ public FusionAuthClient setObjectMapper(ObjectMapper objectMapper) { - return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId, objectMapper); + return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId, objectMapper, apiVersion); } [#list apis as api] @@ -401,6 +406,8 @@ public class FusionAuthClient { client.header(TENANT_ID_HEADER, tenantId); } + client.header(API_VERSION_HEADER, apiVersion.version); + return client; } From ddeda5362b62fe3fc36ced5adc7d120c6fdb50dd Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 08:43:36 -0700 Subject: [PATCH 03/10] To simplify, use java client to build our JSONs --- build.savant | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.savant b/build.savant index 0338a0ce..a2c9a75c 100644 --- a/build.savant +++ b/build.savant @@ -77,12 +77,14 @@ target(name: "extract-source-jars") { file.unzip(file: fusionAuthJWT.replace("${fusionauthJWTVersion}.jar", "${fusionauthJWTVersion}-src.jar"), to: "build/src/fusionauth-jwt/") } -target(name: "generateDomain", description: "Generates all of the json files for the domain", dependsOn: ['extract-source-jars']) { +target(name: "generateDomain", description: "Generates all of the json files for the domain", dependsOn: ['extract-source-jars', 'build-java']) { file.delete { fileSet(dir: "src/main/domain") } - clientLibrary.generateDomainJson(srcDir: "../fusionauth-app/src/main/java/io/fusionauth/domain", outDir: "src/main/domain") + // To simplify InternalUser exclusion, let the build-java target sanitize all our domain objects and + // just use that as our starting point + clientLibrary.generateDomainJson(srcDir: "../fusionauth-java-client/src/main/java/io/fusionauth/domain", outDir: "src/main/domain") clientLibrary.generateDomainJson(srcDir: "build/src/java-error/com/inversoft/error", outDir: "src/main/domain") clientLibrary.generateDomainJson(srcDir: "build/src/fusionauth-jwt/io/fusionauth/jwt/domain/", outDir: "src/main/domain") clientLibrary.generateDomainJson(srcDir: "build/src/fusionauth-jwt/io/fusionauth/jwks/domain/", outDir: "src/main/domain") From 30934121af4d54eb4f0264b162ddd28692e2692d Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 08:44:19 -0700 Subject: [PATCH 04/10] Apply updates (new approach hides JSONColumable, which should be fine) --- .../domain/io.fusionauth.domain.APIVersion.json | 11 +++++++++++ .../domain/io.fusionauth.domain.Application.json | 2 -- ....fusionauth.domain.ApplicationOAuthScope.json | 2 -- .../domain/io.fusionauth.domain.AuditLog.json | 2 -- .../domain/io.fusionauth.domain.Consent.json | 2 -- src/main/domain/io.fusionauth.domain.Entity.json | 2 -- .../domain/io.fusionauth.domain.EntityGrant.json | 2 -- .../domain/io.fusionauth.domain.EntityType.json | 2 -- ...o.fusionauth.domain.EntityTypePermission.json | 2 -- src/main/domain/io.fusionauth.domain.Family.json | 2 -- .../io.fusionauth.domain.FamilyMember.json | 2 -- ...io.fusionauth.domain.IPAccessControlList.json | 2 -- ...o.fusionauth.domain.IdentityProviderLink.json | 2 -- ...io.fusionauth.domain.SystemConfiguration.json | 5 +++-- src/main/domain/io.fusionauth.domain.Tenant.json | 5 ----- ...nauth.domain.TenantIdentityConfiguration.json | 16 ---------------- ...h.domain.TenantIdentityConfigurationMode.json | 6 ------ src/main/domain/io.fusionauth.domain.Theme.json | 2 -- .../domain/io.fusionauth.domain.UserConsent.json | 2 -- .../io.fusionauth.domain.UserRegistration.json | 2 -- .../io.fusionauth.domain.WebAuthnCredential.json | 2 -- .../domain/io.fusionauth.domain.Webhook.json | 2 -- .../io.fusionauth.domain.WebhookAttemptLog.json | 2 -- .../io.fusionauth.domain.WebhookEventLog.json | 2 -- ...ain.connector.BaseConnectorConfiguration.json | 3 --- ...ionauth.domain.connector.ConnectorPolicy.json | 2 -- .../domain/io.fusionauth.domain.form.Form.json | 2 -- .../io.fusionauth.domain.form.FormField.json | 2 -- .../io.fusionauth.domain.jwt.RefreshToken.json | 2 -- ...usionauth.domain.message.MessageTemplate.json | 3 --- ...ain.messenger.BaseMessengerConfiguration.json | 3 --- ...uth.domain.provider.BaseIdentityProvider.json | 3 --- ...IdentityProviderApplicationConfiguration.json | 3 --- ...ider.IdentityProviderTenantConfiguration.json | 2 -- 34 files changed, 14 insertions(+), 92 deletions(-) create mode 100644 src/main/domain/io.fusionauth.domain.APIVersion.json delete mode 100644 src/main/domain/io.fusionauth.domain.TenantIdentityConfiguration.json delete mode 100644 src/main/domain/io.fusionauth.domain.TenantIdentityConfigurationMode.json diff --git a/src/main/domain/io.fusionauth.domain.APIVersion.json b/src/main/domain/io.fusionauth.domain.APIVersion.json new file mode 100644 index 00000000..803cb85b --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.APIVersion.json @@ -0,0 +1,11 @@ +{ + "packageName" : "io.fusionauth.domain", + "type" : "APIVersion", + "enum" : [ { + "name" : "V1", + "args" : [ "v1" ] + }, { + "name" : "V2", + "args" : [ "v2" ] + } ] +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.Application.json b/src/main/domain/io.fusionauth.domain.Application.json index ad34903b..dcad1c86 100644 --- a/src/main/domain/io.fusionauth.domain.Application.json +++ b/src/main/domain/io.fusionauth.domain.Application.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Application" } ] - }, { - "type" : "JSONColumnable" }, { "type" : "Tenantable" } ], diff --git a/src/main/domain/io.fusionauth.domain.ApplicationOAuthScope.json b/src/main/domain/io.fusionauth.domain.ApplicationOAuthScope.json index 0df07f8a..d5391e2f 100644 --- a/src/main/domain/io.fusionauth.domain.ApplicationOAuthScope.json +++ b/src/main/domain/io.fusionauth.domain.ApplicationOAuthScope.json @@ -12,8 +12,6 @@ "typeArguments" : [ { "type" : "ApplicationOAuthScope" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "applicationId" : { diff --git a/src/main/domain/io.fusionauth.domain.AuditLog.json b/src/main/domain/io.fusionauth.domain.AuditLog.json index c24d87ef..cc67b628 100644 --- a/src/main/domain/io.fusionauth.domain.AuditLog.json +++ b/src/main/domain/io.fusionauth.domain.AuditLog.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "AuditLog" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.Consent.json b/src/main/domain/io.fusionauth.domain.Consent.json index 27fae252..bf1ab1c7 100644 --- a/src/main/domain/io.fusionauth.domain.Consent.json +++ b/src/main/domain/io.fusionauth.domain.Consent.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Consent" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.Entity.json b/src/main/domain/io.fusionauth.domain.Entity.json index dcb516cf..8572c814 100644 --- a/src/main/domain/io.fusionauth.domain.Entity.json +++ b/src/main/domain/io.fusionauth.domain.Entity.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Entity" } ] - }, { - "type" : "JSONColumnable" }, { "type" : "Tenantable" } ], diff --git a/src/main/domain/io.fusionauth.domain.EntityGrant.json b/src/main/domain/io.fusionauth.domain.EntityGrant.json index 3747feb6..2d07fac4 100644 --- a/src/main/domain/io.fusionauth.domain.EntityGrant.json +++ b/src/main/domain/io.fusionauth.domain.EntityGrant.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "EntityGrant" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.EntityType.json b/src/main/domain/io.fusionauth.domain.EntityType.json index c2fbb521..9923ba7d 100644 --- a/src/main/domain/io.fusionauth.domain.EntityType.json +++ b/src/main/domain/io.fusionauth.domain.EntityType.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "EntityType" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.EntityTypePermission.json b/src/main/domain/io.fusionauth.domain.EntityTypePermission.json index a620f0aa..c5db3946 100644 --- a/src/main/domain/io.fusionauth.domain.EntityTypePermission.json +++ b/src/main/domain/io.fusionauth.domain.EntityTypePermission.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "EntityTypePermission" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.Family.json b/src/main/domain/io.fusionauth.domain.Family.json index db429a94..e310071f 100644 --- a/src/main/domain/io.fusionauth.domain.Family.json +++ b/src/main/domain/io.fusionauth.domain.Family.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Family" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "members" : { diff --git a/src/main/domain/io.fusionauth.domain.FamilyMember.json b/src/main/domain/io.fusionauth.domain.FamilyMember.json index 6dc2477f..75fa0c2d 100644 --- a/src/main/domain/io.fusionauth.domain.FamilyMember.json +++ b/src/main/domain/io.fusionauth.domain.FamilyMember.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "FamilyMember" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.IPAccessControlList.json b/src/main/domain/io.fusionauth.domain.IPAccessControlList.json index 8c70418c..7d2570e5 100644 --- a/src/main/domain/io.fusionauth.domain.IPAccessControlList.json +++ b/src/main/domain/io.fusionauth.domain.IPAccessControlList.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "IPAccessControlList" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.IdentityProviderLink.json b/src/main/domain/io.fusionauth.domain.IdentityProviderLink.json index 1f1d906b..02370b4f 100644 --- a/src/main/domain/io.fusionauth.domain.IdentityProviderLink.json +++ b/src/main/domain/io.fusionauth.domain.IdentityProviderLink.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "IdentityProviderLink" } ] - }, { - "type" : "JSONColumnable" }, { "type" : "Tenantable" } ], diff --git a/src/main/domain/io.fusionauth.domain.SystemConfiguration.json b/src/main/domain/io.fusionauth.domain.SystemConfiguration.json index 0f32c1d6..04a18508 100644 --- a/src/main/domain/io.fusionauth.domain.SystemConfiguration.json +++ b/src/main/domain/io.fusionauth.domain.SystemConfiguration.json @@ -7,13 +7,14 @@ "typeArguments" : [ { "type" : "SystemConfiguration" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "auditLogConfiguration" : { "type" : "AuditLogConfiguration" }, + "cookieEncryptionKey" : { + "type" : "String" + }, "corsConfiguration" : { "type" : "CORSConfiguration" }, diff --git a/src/main/domain/io.fusionauth.domain.Tenant.json b/src/main/domain/io.fusionauth.domain.Tenant.json index 2f89f327..a786121b 100644 --- a/src/main/domain/io.fusionauth.domain.Tenant.json +++ b/src/main/domain/io.fusionauth.domain.Tenant.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Tenant" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { @@ -58,9 +56,6 @@ "id" : { "type" : "UUID" }, - "identityConfiguration" : { - "type" : "TenantIdentityConfiguration" - }, "insertInstant" : { "type" : "ZonedDateTime" }, diff --git a/src/main/domain/io.fusionauth.domain.TenantIdentityConfiguration.json b/src/main/domain/io.fusionauth.domain.TenantIdentityConfiguration.json deleted file mode 100644 index 95b00e48..00000000 --- a/src/main/domain/io.fusionauth.domain.TenantIdentityConfiguration.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "packageName" : "io.fusionauth.domain", - "type" : "TenantIdentityConfiguration", - "description" : "/**\n * @author Daniel DeGroff\n */\n", - "implements" : [ { - "type" : "Buildable", - "typeArguments" : [ { - "type" : "TenantIdentityConfiguration" - } ] - } ], - "fields" : { - "mode" : { - "type" : "TenantIdentityConfigurationMode" - } - } -} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.TenantIdentityConfigurationMode.json b/src/main/domain/io.fusionauth.domain.TenantIdentityConfigurationMode.json deleted file mode 100644 index 275ccecd..00000000 --- a/src/main/domain/io.fusionauth.domain.TenantIdentityConfigurationMode.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packageName" : "io.fusionauth.domain", - "type" : "TenantIdentityConfigurationMode", - "description" : "/**\n * @author Daniel DeGroff\n */\n", - "enum" : [ "Compatible", "Discrete" ] -} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.Theme.json b/src/main/domain/io.fusionauth.domain.Theme.json index c1b8753d..6ec44cf0 100644 --- a/src/main/domain/io.fusionauth.domain.Theme.json +++ b/src/main/domain/io.fusionauth.domain.Theme.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Theme" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.UserConsent.json b/src/main/domain/io.fusionauth.domain.UserConsent.json index bc6e56f8..cfb6d8d9 100644 --- a/src/main/domain/io.fusionauth.domain.UserConsent.json +++ b/src/main/domain/io.fusionauth.domain.UserConsent.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "UserConsent" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.UserRegistration.json b/src/main/domain/io.fusionauth.domain.UserRegistration.json index 768ae39c..e478b03a 100644 --- a/src/main/domain/io.fusionauth.domain.UserRegistration.json +++ b/src/main/domain/io.fusionauth.domain.UserRegistration.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "UserRegistration" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.WebAuthnCredential.json b/src/main/domain/io.fusionauth.domain.WebAuthnCredential.json index b4c1c99f..6d1fd71d 100644 --- a/src/main/domain/io.fusionauth.domain.WebAuthnCredential.json +++ b/src/main/domain/io.fusionauth.domain.WebAuthnCredential.json @@ -9,8 +9,6 @@ "typeArguments" : [ { "type" : "WebAuthnCredential" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "algorithm" : { diff --git a/src/main/domain/io.fusionauth.domain.Webhook.json b/src/main/domain/io.fusionauth.domain.Webhook.json index 1c112c37..a19c8162 100644 --- a/src/main/domain/io.fusionauth.domain.Webhook.json +++ b/src/main/domain/io.fusionauth.domain.Webhook.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Webhook" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "connectTimeout" : { diff --git a/src/main/domain/io.fusionauth.domain.WebhookAttemptLog.json b/src/main/domain/io.fusionauth.domain.WebhookAttemptLog.json index 75b43df6..961f1ba7 100644 --- a/src/main/domain/io.fusionauth.domain.WebhookAttemptLog.json +++ b/src/main/domain/io.fusionauth.domain.WebhookAttemptLog.json @@ -12,8 +12,6 @@ "typeArguments" : [ { "type" : "WebhookAttemptLog" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.WebhookEventLog.json b/src/main/domain/io.fusionauth.domain.WebhookEventLog.json index e1de5e03..187e6f2b 100644 --- a/src/main/domain/io.fusionauth.domain.WebhookEventLog.json +++ b/src/main/domain/io.fusionauth.domain.WebhookEventLog.json @@ -6,8 +6,6 @@ "typeArguments" : [ { "type" : "WebhookEventLog" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "attempts" : { diff --git a/src/main/domain/io.fusionauth.domain.connector.BaseConnectorConfiguration.json b/src/main/domain/io.fusionauth.domain.connector.BaseConnectorConfiguration.json index 3f107b69..a4a8fc83 100644 --- a/src/main/domain/io.fusionauth.domain.connector.BaseConnectorConfiguration.json +++ b/src/main/domain/io.fusionauth.domain.connector.BaseConnectorConfiguration.json @@ -2,9 +2,6 @@ "packageName" : "io.fusionauth.domain.connector", "type" : "BaseConnectorConfiguration", "description" : "// Do not require a setter for 'type', it is defined by the concrete class and is not mutable\n", - "implements" : [ { - "type" : "JSONColumnable" - } ], "fields" : { "data" : { "type" : "Map", diff --git a/src/main/domain/io.fusionauth.domain.connector.ConnectorPolicy.json b/src/main/domain/io.fusionauth.domain.connector.ConnectorPolicy.json index ddeb20fb..ac51fd86 100644 --- a/src/main/domain/io.fusionauth.domain.connector.ConnectorPolicy.json +++ b/src/main/domain/io.fusionauth.domain.connector.ConnectorPolicy.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "ConnectorPolicy" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "connectorId" : { diff --git a/src/main/domain/io.fusionauth.domain.form.Form.json b/src/main/domain/io.fusionauth.domain.form.Form.json index bad1b075..399d973d 100644 --- a/src/main/domain/io.fusionauth.domain.form.Form.json +++ b/src/main/domain/io.fusionauth.domain.form.Form.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "Form" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { diff --git a/src/main/domain/io.fusionauth.domain.form.FormField.json b/src/main/domain/io.fusionauth.domain.form.FormField.json index 8209e84d..ba947274 100644 --- a/src/main/domain/io.fusionauth.domain.form.FormField.json +++ b/src/main/domain/io.fusionauth.domain.form.FormField.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "FormField" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "confirm" : { diff --git a/src/main/domain/io.fusionauth.domain.jwt.RefreshToken.json b/src/main/domain/io.fusionauth.domain.jwt.RefreshToken.json index de8b9c43..b31063af 100644 --- a/src/main/domain/io.fusionauth.domain.jwt.RefreshToken.json +++ b/src/main/domain/io.fusionauth.domain.jwt.RefreshToken.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "RefreshToken" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "applicationId" : { diff --git a/src/main/domain/io.fusionauth.domain.message.MessageTemplate.json b/src/main/domain/io.fusionauth.domain.message.MessageTemplate.json index a283b525..b0d6add6 100644 --- a/src/main/domain/io.fusionauth.domain.message.MessageTemplate.json +++ b/src/main/domain/io.fusionauth.domain.message.MessageTemplate.json @@ -2,9 +2,6 @@ "packageName" : "io.fusionauth.domain.message", "type" : "MessageTemplate", "description" : "/**\n * Stores an message template used to distribute messages;\n *\n * @author Michael Sleevi\n */\n", - "implements" : [ { - "type" : "JSONColumnable" - } ], "fields" : { "data" : { "type" : "Map", diff --git a/src/main/domain/io.fusionauth.domain.messenger.BaseMessengerConfiguration.json b/src/main/domain/io.fusionauth.domain.messenger.BaseMessengerConfiguration.json index 26d2b7dc..8405b0e8 100644 --- a/src/main/domain/io.fusionauth.domain.messenger.BaseMessengerConfiguration.json +++ b/src/main/domain/io.fusionauth.domain.messenger.BaseMessengerConfiguration.json @@ -2,9 +2,6 @@ "packageName" : "io.fusionauth.domain.messenger", "type" : "BaseMessengerConfiguration", "description" : "// Do not require a setter for 'type', it is defined by the concrete class and is not mutable\n", - "implements" : [ { - "type" : "JSONColumnable" - } ], "fields" : { "data" : { "type" : "Map", diff --git a/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProvider.json b/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProvider.json index 772d98d8..02c889d1 100644 --- a/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProvider.json +++ b/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProvider.json @@ -11,9 +11,6 @@ "extends" : [ { "type" : "Enableable" } ], - "implements" : [ { - "type" : "JSONColumnable" - } ], "fields" : { "data" : { "type" : "Map", diff --git a/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProviderApplicationConfiguration.json b/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProviderApplicationConfiguration.json index 132d14d3..b3fe5865 100644 --- a/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProviderApplicationConfiguration.json +++ b/src/main/domain/io.fusionauth.domain.provider.BaseIdentityProviderApplicationConfiguration.json @@ -5,9 +5,6 @@ "extends" : [ { "type" : "Enableable" } ], - "implements" : [ { - "type" : "JSONColumnable" - } ], "fields" : { "data" : { "type" : "Map", diff --git a/src/main/domain/io.fusionauth.domain.provider.IdentityProviderTenantConfiguration.json b/src/main/domain/io.fusionauth.domain.provider.IdentityProviderTenantConfiguration.json index ae2e185c..9fce4c01 100644 --- a/src/main/domain/io.fusionauth.domain.provider.IdentityProviderTenantConfiguration.json +++ b/src/main/domain/io.fusionauth.domain.provider.IdentityProviderTenantConfiguration.json @@ -7,8 +7,6 @@ "typeArguments" : [ { "type" : "IdentityProviderTenantConfiguration" } ] - }, { - "type" : "JSONColumnable" } ], "fields" : { "data" : { From 6c4bbcfd98d9619eb07dc16e2a4ab2dd02fc7c10 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 09:16:34 -0700 Subject: [PATCH 05/10] Added our missing identity verify API --- src/main/api/completeVerifyIdentity.json | 20 ++++++++++++++++++++ src/main/api/sendVerifyIdentity.json | 20 ++++++++++++++++++++ src/main/api/startVerifyIdentity.json | 21 +++++++++++++++++++++ src/main/client/java.client.ftl | 3 +++ 4 files changed, 64 insertions(+) create mode 100644 src/main/api/completeVerifyIdentity.json create mode 100644 src/main/api/sendVerifyIdentity.json create mode 100644 src/main/api/startVerifyIdentity.json diff --git a/src/main/api/completeVerifyIdentity.json b/src/main/api/completeVerifyIdentity.json new file mode 100644 index 00000000..1fb1ee7f --- /dev/null +++ b/src/main/api/completeVerifyIdentity.json @@ -0,0 +1,20 @@ +{ + "uri": "/api/identity/verify/complete", + "comments": [ + "Completes verification of an identity using verification codes from the Verify Start API." + ], + "method": "post", + "methodName": "completeVerifyIdentity", + "successResponse": "Void", + "errorResponse": "Errors", + "params": [ + { + "name": "request", + "comments": [ + "The identity verify complete request that contains all the information used to verify the identity." + ], + "type": "body", + "javaType": "VerifySendCompleteRequest" + } + ] +} diff --git a/src/main/api/sendVerifyIdentity.json b/src/main/api/sendVerifyIdentity.json new file mode 100644 index 00000000..578dbc35 --- /dev/null +++ b/src/main/api/sendVerifyIdentity.json @@ -0,0 +1,20 @@ +{ + "uri": "/api/identity/verify/send", + "comments": [ + "Send a verification code using the appropriate transport for the identity type being verified." + ], + "method": "post", + "methodName": "sendVerifyIdentity", + "successResponse": "Void", + "errorResponse": "Errors", + "params": [ + { + "name": "request", + "comments": [ + "The identity verify send request that contains all the information used send the code." + ], + "type": "body", + "javaType": "VerifySendCompleteRequest" + } + ] +} diff --git a/src/main/api/startVerifyIdentity.json b/src/main/api/startVerifyIdentity.json new file mode 100644 index 00000000..7449c006 --- /dev/null +++ b/src/main/api/startVerifyIdentity.json @@ -0,0 +1,21 @@ +{ + "uri": "/api/identity/verify/start", + "comments": [ + "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." + ], + "method": "post", + "methodName": "startVerifyIdentity", + "successResponse": "VerifyStartResponse", + "errorResponse": "Errors", + "params": [ + { + "name": "request", + "comments": [ + "The identity verify start request that contains all the information used to begin the request." + ], + "type": "body", + "javaType": "VerifyStartRequest" + } + ] +} diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index f1b2ee1b..c42d6075 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -232,6 +232,9 @@ import io.fusionauth.domain.api.user.VerifyEmailRequest; 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; From 17e3c708ea472ccbbeb219e01232cec813435b04 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 09:32:24 -0700 Subject: [PATCH 06/10] Fix netcore --- src/main/client/netcore.client.ftl | 1 + src/main/client/netcore.client.interface.ftl | 1 + src/main/client/netcore.client.sync.ftl | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/client/netcore.client.ftl b/src/main/client/netcore.client.ftl index a112d05a..948a9434 100644 --- a/src/main/client/netcore.client.ftl +++ b/src/main/client/netcore.client.ftl @@ -28,6 +28,7 @@ using io.fusionauth.domain.api.passwordless; using io.fusionauth.domain.api.report; using io.fusionauth.domain.api.twoFactor; using io.fusionauth.domain.api.user; +using io.fusionauth.domain.api.user.verify; using io.fusionauth.domain.oauth2; using io.fusionauth.domain.provider; diff --git a/src/main/client/netcore.client.interface.ftl b/src/main/client/netcore.client.interface.ftl index 92bc98b1..9a33c356 100644 --- a/src/main/client/netcore.client.interface.ftl +++ b/src/main/client/netcore.client.interface.ftl @@ -27,6 +27,7 @@ using io.fusionauth.domain.api.passwordless; using io.fusionauth.domain.api.report; using io.fusionauth.domain.api.twoFactor; using io.fusionauth.domain.api.user; +using io.fusionauth.domain.api.user.verify; using io.fusionauth.domain.oauth2; using io.fusionauth.domain.provider; using io.fusionauth.domain.reactor; diff --git a/src/main/client/netcore.client.sync.ftl b/src/main/client/netcore.client.sync.ftl index 06c95e6f..f15add8a 100644 --- a/src/main/client/netcore.client.sync.ftl +++ b/src/main/client/netcore.client.sync.ftl @@ -42,6 +42,7 @@ using io.fusionauth.domain.api.passwordless; using io.fusionauth.domain.api.report; using io.fusionauth.domain.api.twoFactor; using io.fusionauth.domain.api.user; +using io.fusionauth.domain.api.user.verify; using io.fusionauth.domain.oauth2; using io.fusionauth.domain.provider; using io.fusionauth.domain.reactor; From 8632f4d7a39ddd4fbccd6c2e696cd1e3c3c9b910 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 10:20:57 -0700 Subject: [PATCH 07/10] explain --- build.savant | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.savant b/build.savant index a2c9a75c..531f0cbe 100644 --- a/build.savant +++ b/build.savant @@ -172,6 +172,9 @@ target(name: "build-java", description: "Build the Java Client Library") { filter(token: ".*@MaskMapValue\\(.*\n", value: "") filter(token: ".*@MaskString.*\n", value: "") filter(token: ".*@InternalUse.*\n ", value: "") + // our events have `InternalUser` objects in them, but that class is intentionally not usable + // outside of FusionAuth. We serialize events to public `User` objects anyways, so we replace + // our references here filter(token: "import io.fusionauth.api.domain.users.InternalUser;", value: "import io.fusionauth.domain.User;") filter(token: "InternalUser", value: "User") } From 22ca0b23804d6fa99f657a6376a9c1a89fe1aa30 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Sat, 21 Dec 2024 10:23:10 -0700 Subject: [PATCH 08/10] Only apply this to the event classes --- build.savant | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.savant b/build.savant index 531f0cbe..03482b2e 100644 --- a/build.savant +++ b/build.savant @@ -172,6 +172,9 @@ target(name: "build-java", description: "Build the Java Client Library") { filter(token: ".*@MaskMapValue\\(.*\n", value: "") filter(token: ".*@MaskString.*\n", value: "") filter(token: ".*@InternalUse.*\n ", value: "") + } + file.copy(to: "../fusionauth-java-client/src/main/java/io/fusionauth/domain/event") { + fileSet(dir: "../fusionauth-app/src/main/java/io/fusionauth/domain/event", excludePatterns: ["internal/annotation/*"]) // our events have `InternalUser` objects in them, but that class is intentionally not usable // outside of FusionAuth. We serialize events to public `User` objects anyways, so we replace // our references here From bc76dc9b8a933245e793fc034cf66d3a294e6247 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Wed, 15 Jan 2025 15:58:31 -0700 Subject: [PATCH 09/10] api version removal --- src/main/domain/io.fusionauth.domain.APIVersion.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 src/main/domain/io.fusionauth.domain.APIVersion.json diff --git a/src/main/domain/io.fusionauth.domain.APIVersion.json b/src/main/domain/io.fusionauth.domain.APIVersion.json deleted file mode 100644 index 803cb85b..00000000 --- a/src/main/domain/io.fusionauth.domain.APIVersion.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "packageName" : "io.fusionauth.domain", - "type" : "APIVersion", - "enum" : [ { - "name" : "V1", - "args" : [ "v1" ] - }, { - "name" : "V2", - "args" : [ "v2" ] - } ] -} \ No newline at end of file From 8d737c661a0f6c67f1d4a749919e0c0ba1352289 Mon Sep 17 00:00:00 2001 From: Brady Wied Date: Wed, 15 Jan 2025 16:02:49 -0700 Subject: [PATCH 10/10] Remove API version here --- src/main/client/java.client.ftl | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index c42d6075..aaf35349 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -35,7 +35,6 @@ import com.inversoft.rest.FormDataBodyHandler; import com.inversoft.rest.JSONBodyHandler; import com.inversoft.rest.JSONResponseHandler; import com.inversoft.rest.RESTClient; -import io.fusionauth.domain.APIVersion; import io.fusionauth.domain.LambdaType; import io.fusionauth.domain.OpenIdConfiguration; import io.fusionauth.domain.api.APIKeyRequest; @@ -256,7 +255,6 @@ import io.fusionauth.domain.provider.IdentityProviderType; */ @SuppressWarnings("unused") public class FusionAuthClient { - public static String API_VERSION_HEADER = "X-FusionAuth-API-Version"; public static String TENANT_ID_HEADER = "X-FusionAuth-TenantId"; public static final ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL) @@ -272,8 +270,6 @@ public class FusionAuthClient { private final String apiKey; - public final APIVersion apiVersion; - private final String baseURL; private final ObjectMapper customMapper; @@ -289,20 +285,19 @@ public class FusionAuthClient { } public FusionAuthClient(String apiKey, String baseURL, String tenantId) { - this(apiKey, baseURL, 2000, 2000, tenantId, APIVersion.V1); + this(apiKey, baseURL, 2000, 2000, tenantId); } public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout) { - this(apiKey, baseURL, connectTimeout, readTimeout, null, APIVersion.V1); + this(apiKey, baseURL, connectTimeout, readTimeout, null); } - public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, APIVersion apiVersion) { - this(apiKey, baseURL, connectTimeout, readTimeout, tenantId, null, apiVersion); + public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId) { + this(apiKey, baseURL, connectTimeout, readTimeout, tenantId, null); } - public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, ObjectMapper objectMapper, APIVersion apiVersion) { + public FusionAuthClient(String apiKey, String baseURL, int connectTimeout, int readTimeout, String tenantId, ObjectMapper objectMapper) { this.apiKey = apiKey; - this.apiVersion = apiVersion; this.baseURL = baseURL; this.connectTimeout = connectTimeout; this.readTimeout = readTimeout; @@ -324,7 +319,7 @@ public class FusionAuthClient { return this; } - return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId.toString(), apiVersion); + return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId.toString()); } /** @@ -335,7 +330,7 @@ public class FusionAuthClient { * @return the new FusionAuthClient */ public FusionAuthClient setObjectMapper(ObjectMapper objectMapper) { - return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId, objectMapper, apiVersion); + return new FusionAuthClient(apiKey, baseURL, connectTimeout, readTimeout, tenantId, objectMapper); } [#list apis as api] @@ -409,8 +404,6 @@ public class FusionAuthClient { client.header(TENANT_ID_HEADER, tenantId); } - client.header(API_VERSION_HEADER, apiVersion.version); - return client; }