diff --git a/src/main/api/approveDeviceWithRequest.json b/src/main/api/approveDeviceWithRequest.json new file mode 100644 index 0000000..223499d --- /dev/null +++ b/src/main/api/approveDeviceWithRequest.json @@ -0,0 +1,20 @@ +{ + "uri": "/oauth2/device/approve", + "comments": [ + "Approve a device grant." + ], + "method": "post", + "methodName": "approveDeviceWithRequest", + "successResponse": "DeviceApprovalResponse", + "errorResponse": "Errors", + "params": [ + { + "name": "request", + "comments": [ + "The request object containing the device approval information and optional tenantId." + ], + "type": "formBody", + "javaType": "DeviceApprovalRequest" + } + ] +} diff --git a/src/main/api/clientCredentialsGrantWithRequest.json b/src/main/api/clientCredentialsGrantWithRequest.json new file mode 100644 index 0000000..c7060f9 --- /dev/null +++ b/src/main/api/clientCredentialsGrantWithRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Make a Client Credentials grant request to obtain an access token." + ], + "method": "post", + "methodName": "clientCredentialsGrantWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The client credentials grant request containing client authentication, scope and optional tenantId." + ], + "type": "formBody", + "javaType": "ClientCredentialsGrantRequest" + } + ] +} diff --git a/src/main/api/deviceAuthorize.json b/src/main/api/deviceAuthorize.json new file mode 100644 index 0000000..a3c63db --- /dev/null +++ b/src/main/api/deviceAuthorize.json @@ -0,0 +1,37 @@ +{ + "uri": "/oauth2/device_authorize", + "comments": [ + "Start the Device Authorization flow using form-encoded parameters" + ], + "method": "post", + "methodName": "deviceAuthorize", + "successResponse": "DeviceResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "client_id", + "comments": [ + "The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate." + ], + "type": "form", + "javaType": "String" + }, + { + "name": "client_secret", + "comments": [ + "(Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header." + ], + "type": "form", + "javaType": "String" + }, + { + "name": "scope", + "comments": [ + "(Optional) A space-delimited string of the requested scopes. Defaults to all scopes configured in the Application's OAuth configuration." + ], + "type": "form", + "javaType": "String" + } + ] +} diff --git a/src/main/api/deviceAuthorizeWithRequest.json b/src/main/api/deviceAuthorizeWithRequest.json new file mode 100644 index 0000000..0b46d96 --- /dev/null +++ b/src/main/api/deviceAuthorizeWithRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/device_authorize", + "comments": [ + "Start the Device Authorization flow using a request body" + ], + "method": "post", + "methodName": "deviceAuthorizeWithRequest", + "successResponse": "DeviceResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The device authorization request containing client authentication, scope, and optional device metadata." + ], + "type": "formBody", + "javaType": "DeviceAuthorizationRequest" + } + ] +} diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEWithRequest.json b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEWithRequest.json new file mode 100644 index 0000000..84a2f6b --- /dev/null +++ b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEWithRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchanges an OAuth authorization code and code_verifier for an access token.", + "Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token." + ], + "method": "post", + "methodName": "exchangeOAuthCodeForAccessTokenUsingPKCEWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The PKCE OAuth code access token exchange request." + ], + "type": "formBody", + "javaType": "OAuthCodePKCEAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenWithRequest.json b/src/main/api/exchangeOAuthCodeForAccessTokenWithRequest.json new file mode 100644 index 0000000..a661049 --- /dev/null +++ b/src/main/api/exchangeOAuthCodeForAccessTokenWithRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchanges an OAuth authorization code for an access token.", + "Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token." + ], + "method": "post", + "methodName": "exchangeOAuthCodeForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The OAuth code access token exchange request." + ], + "type": "formBody", + "javaType": "OAuthCodeAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeRefreshTokenForAccessTokenWithRequest.json b/src/main/api/exchangeRefreshTokenForAccessTokenWithRequest.json new file mode 100644 index 0000000..a4783da --- /dev/null +++ b/src/main/api/exchangeRefreshTokenForAccessTokenWithRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchange a Refresh Token for an Access Token.", + "If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token." + ], + "method": "post", + "methodName": "exchangeRefreshTokenForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The refresh token access token exchange request." + ], + "type": "formBody", + "javaType": "RefreshTokenAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeUserCredentialsForAccessTokenWithRequest.json b/src/main/api/exchangeUserCredentialsForAccessTokenWithRequest.json new file mode 100644 index 0000000..9443eca --- /dev/null +++ b/src/main/api/exchangeUserCredentialsForAccessTokenWithRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchange User Credentials for a Token.", + "If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token." + ], + "method": "post", + "methodName": "exchangeUserCredentialsForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The user credentials access token exchange request." + ], + "type": "formBody", + "javaType": "UserCredentialsAccessTokenRequest" + } + ] +} diff --git a/src/main/api/introspectAccessTokenWithRequest.json b/src/main/api/introspectAccessTokenWithRequest.json new file mode 100644 index 0000000..f079e50 --- /dev/null +++ b/src/main/api/introspectAccessTokenWithRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/introspect", + "comments": [ + "Inspect an access token issued as the result of the User based grant such as the Authorization Code Grant, Implicit Grant, the User Credentials Grant or the Refresh Grant." + ], + "method": "post", + "methodName": "introspectAccessTokenWithRequest", + "successResponse": "IntrospectResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The access token introspection request." + ], + "type": "formBody", + "javaType": "AccessTokenIntrospectRequest" + } + ] +} diff --git a/src/main/api/introspectClientCredentialsAccessTokenWithRequest.json b/src/main/api/introspectClientCredentialsAccessTokenWithRequest.json new file mode 100644 index 0000000..a8f9cde --- /dev/null +++ b/src/main/api/introspectClientCredentialsAccessTokenWithRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/introspect", + "comments": [ + "Inspect an access token issued as the result of the Client Credentials Grant." + ], + "method": "post", + "methodName": "introspectClientCredentialsAccessTokenWithRequest", + "successResponse": "IntrospectResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The client credentials access token." + ], + "type": "formBody", + "javaType": "ClientCredentialsAccessTokenIntrospectRequest" + } + ] +} diff --git a/src/main/api/retrieveUserCodeUsingAPIKeyWithRequest.json b/src/main/api/retrieveUserCodeUsingAPIKeyWithRequest.json new file mode 100644 index 0000000..fdc9014 --- /dev/null +++ b/src/main/api/retrieveUserCodeUsingAPIKeyWithRequest.json @@ -0,0 +1,25 @@ +{ + "uri": "/oauth2/device/user-code", + "comments": [ + "Retrieve a user_code that is part of an in-progress Device Authorization Grant.", + "", + "This API is useful if you want to build your own login workflow to complete a device grant.", + "", + "This request will require an API key." + ], + "method": "post", + "methodName": "retrieveUserCodeUsingAPIKeyWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": false, + "params": [ + { + "name": "request", + "comments": [ + "The user code retrieval request including optional tenantId." + ], + "type": "formBody", + "javaType": "RetrieveUserCodeUsingAPIKeyRequest" + } + ] +} diff --git a/src/main/api/retrieveUserCodeWithRequest.json b/src/main/api/retrieveUserCodeWithRequest.json new file mode 100644 index 0000000..2ad3334 --- /dev/null +++ b/src/main/api/retrieveUserCodeWithRequest.json @@ -0,0 +1,23 @@ +{ + "uri": "/oauth2/device/user-code", + "comments": [ + "Retrieve a user_code that is part of an in-progress Device Authorization Grant.", + "", + "This API is useful if you want to build your own login workflow to complete a device grant." + ], + "method": "post", + "methodName": "retrieveUserCodeWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The user code retrieval request." + ], + "type": "formBody", + "javaType": "RetrieveUserCodeRequest" + } + ] +} diff --git a/src/main/api/validateDeviceWithRequest.json b/src/main/api/validateDeviceWithRequest.json new file mode 100644 index 0000000..5a0ffcc --- /dev/null +++ b/src/main/api/validateDeviceWithRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/device/validate", + "comments": [ + "Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant.", + "If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant." + ], + "method": "get", + "methodName": "validateDeviceWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The device validation request." + ], + "type": "queryBody", + "javaType": "ValidateDeviceRequest" + } + ] +} diff --git a/src/main/client/csharp.client.ftl b/src/main/client/csharp.client.ftl index 18f7c9b..a3fe12d 100644 --- a/src/main/client/csharp.client.ftl +++ b/src/main/client/csharp.client.ftl @@ -107,7 +107,7 @@ namespace FusionAuth { [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] Dictionary body = new Dictionary(); @@ -116,6 +116,29 @@ namespace FusionAuth body.Add("${param.name}", ${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)}); [/#if] [/#list] + [#list api.params![] as param] + [#if param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "UUID"] + if (request.${fieldName} != null) { + body.Add("${fieldName}", request.${fieldName}.ToString()); + } + [#elseif field.type == "String"] + body.Add("${fieldName}", request.${fieldName}); + [#else] + if (request.${fieldName} != null) { + body.Add("${fieldName}", request.${fieldName}.ToString()); + } + [/#if] + [/#list] + [/#if] + [/#list] + [/#if] + [/#list] [/#if] return Start[#if api.anonymous??]Anonymous[/#if]<${global.convertType(api.successResponse, "csharp")}, ${global.convertType(api.errorResponse, "csharp")}>().Uri("${api.uri}") [#if api.authorization??] @@ -131,7 +154,7 @@ namespace FusionAuth [/#if] [/#list] [#if formPost] - .BodyHandler(new FormDataBodyHandler(body) + .BodyHandler(new FormDataBodyHandler(body)) [/#if] .${api.method?cap_first}() .Go(); diff --git a/src/main/client/go.client.ftl b/src/main/client/go.client.ftl index 1ce43cd..6aecd5e 100644 --- a/src/main/client/go.client.ftl +++ b/src/main/client/go.client.ftl @@ -184,7 +184,7 @@ func (rc *restClient) WithUriSegment(segment string) *restClient { [#-- @formatter:off --] [#-- Ignoring these few following APIs due to currently being unable to convert the json response into the actual IdentityProvider type. Need a conversion utility. --] -[#assign ignoredAPIs = ["CreateIdentityProvider","IntrospectAccessToken","IntrospectClientCredentialsAccessToken","RetrieveIdentityProvider","RetrieveIdentityProviders","RetrieveUserInfoFromAccessToken","UpdateIdentityProvider"]/] +[#assign ignoredAPIs = ["CreateIdentityProvider","IntrospectAccessToken","IntrospectAccessTokenWithRequest","IntrospectClientCredentialsAccessToken","IntrospectClientCredentialsAccessTokenWithRequest","RetrieveIdentityProvider","RetrieveIdentityProviders","RetrieveUserInfoFromAccessToken","UpdateIdentityProvider"]/] [#list apis as api] [#if !(ignoredAPIs?seq_contains(api.methodName?cap_first))] // ${api.methodName?cap_first} @@ -225,13 +225,29 @@ func (c *FusionAuthClient) ${api.methodName?cap_first}WithContext(ctx context.Co [/#if] [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] formBody := url.Values{} [#list api.params![] as param] [#if param.type == "form"] formBody.Set("${param.name}", ${(param.constant?? && param.constant)?then("\""+param.value+"\"", global.convertValue(param.name, "go"))}) + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "UUID" || field.type == "String"] + formBody.Set("${fieldName}", request.${global.toCamelCase(fieldName)?cap_first}) + [#else] + if request.${global.toCamelCase(fieldName)?cap_first} != nil { + formBody.Set("${fieldName}", fmt.Sprintf("%v", request.${global.toCamelCase(fieldName)?cap_first})) + } + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] [/#if] @@ -274,6 +290,18 @@ func (c *FusionAuthClient) ${api.methodName?cap_first}WithContext(ctx context.Co [#else] WithParameter("${param.parameterName}", string(${(param.constant?? && param.constant)?then(param.value, global.convertValue(param.name, "go"))})). [/#if] + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "UUID" || field.type == "String"] + WithParameter("${fieldName}", request.${global.toCamelCase(fieldName)?cap_first}). + [#else] + WithParameter("${fieldName}", fmt.Sprintf("%v", request.${global.toCamelCase(fieldName)?cap_first})). + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] WithJSONBody(${global.convertValue(param.name, "go")}). [/#if] diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index 85961e4..9e50cb3 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -239,11 +239,24 @@ 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.oauth2.AccessToken; +import io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest; +import io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest; +import io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest; +import io.fusionauth.domain.oauth2.DeviceApprovalRequest; import io.fusionauth.domain.oauth2.DeviceApprovalResponse; +import io.fusionauth.domain.oauth2.DeviceAuthorizationRequest; +import io.fusionauth.domain.oauth2.DeviceResponse; import io.fusionauth.domain.oauth2.IntrospectResponse; import io.fusionauth.domain.oauth2.JWKSResponse; +import io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest; +import io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest; import io.fusionauth.domain.oauth2.OAuthError; +import io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest; +import io.fusionauth.domain.oauth2.RetrieveUserCodeRequest; +import io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest; +import io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest; import io.fusionauth.domain.oauth2.UserinfoResponse; +import io.fusionauth.domain.oauth2.ValidateDeviceRequest; import io.fusionauth.domain.provider.IdentityProviderType; /** @@ -359,13 +372,38 @@ public class FusionAuthClient { public ClientResponse<${api.successResponse}, ${api.errorResponse}> ${api.methodName}(${global.methodParameters(api, "java")}) { [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] Map> parameters = new HashMap<>(); [#list api.params![] as param] + [#assign pval = param.name /] [#if param.type == "form"] - parameters.put("${param.name}", Arrays.asList(${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)})); + [#if param.constant?? && param.constant] + [#assign pval = "\""+param.value+"\"" /] + [#else] + [#if param.javaType != "String"] + [#assign pval = "\"\" + ${param.name}" /] + [/#if] + [/#if] + parameters.put("${param.name}", Arrays.asList(${pval})); + [/#if] + [#if param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + parameters.put("${fieldName}", Arrays.asList(request.${fieldName})); + [#else] + if (request.${fieldName} != null) { + parameters.put("${fieldName}", Arrays.asList(request.${fieldName}.toString())); + } + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] [/#if] @@ -381,6 +419,20 @@ public class FusionAuthClient { .urlParameter("${param.parameterName}", ${(param.constant?? && param.constant)?then(param.value, param.name)}) [#elseif param.type == "body"] .bodyHandler(new JSONBodyHandler(${param.name}, objectMapper())) + [#elseif param.type == "queryBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + .urlParameter("${fieldName}", request.${fieldName}) + [#else] + .urlParameter("${fieldName}", request.${fieldName} != null ? request.${fieldName}.toString() : null) + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] [#if formPost] diff --git a/src/main/client/netcore.client.ftl b/src/main/client/netcore.client.ftl index e60ea0d..b0eadac 100644 --- a/src/main/client/netcore.client.ftl +++ b/src/main/client/netcore.client.ftl @@ -99,16 +99,27 @@ namespace io.fusionauth { public Task> ${api.methodName?cap_first}Async(${global.methodParameters(api, "csharp")}) { [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] - var body = new Dictionary { - [#list api.params![] as param] - [#if param.type == "form"] - { "${param.name}", ${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)} }, - [/#if] - [/#list] - }; + var body = new Dictionary(); + [#list api.params![] as param] + [#if param.type == "form"] + body.Add("${param.name}", ${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)}); + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + if (request.${fieldName} != null) { + body.Add("${fieldName}", request.${fieldName}.ToString()); + } + [/#list] + [/#if] + [/#list] + [/#if] + [/#list] [/#if] return build[#if api.anonymous??]Anonymous[/#if]Client() .withUri("${api.uri}") @@ -120,6 +131,18 @@ namespace io.fusionauth { .withUriSegment(${(param.constant?? && param.constant)?then(param.value, param.name)}) [#elseif param.type == "urlParameter"] .withParameter("${param.parameterName}", ${(param.constant?? && param.constant)?then(param.value, param.name)}) + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + .withParameter("${fieldName}", request.${fieldName}) + [#else] + .withParameter("${fieldName}", request.${fieldName}?.ToString()) + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] .withJSONBody(${param.name}) [/#if] diff --git a/src/main/client/php.client.ftl b/src/main/client/php.client.ftl index 65293e5..87b7ecb 100644 --- a/src/main/client/php.client.ftl +++ b/src/main/client/php.client.ftl @@ -100,14 +100,30 @@ class FusionAuthClient public function ${api.methodName}(${global.methodParameters(api, "php")}) { [#assign formPost = false/] + [#assign hasFormParams = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] + [#if param.type == "form"][#assign hasFormParams = true/][/#if] [/#list] [#if formPost] $post_data = array( [#list api.params![] as param] [#if param.type == "form"] '${param.name}' => ${(param.constant?? && param.constant)?then("'"+param.value+"'", "$"+param.name)}[#if param?has_next],[/#if] + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + [#if fieldName?is_first && !hasFormParams][#else],[/#if]'${fieldName}' => $request->${fieldName} + [#else] + [#if fieldName?is_first && !hasFormParams][#else],[/#if]'${fieldName}' => ($request->${fieldName} !== null ? (string)$request->${fieldName} : null) + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] ); @@ -121,6 +137,18 @@ class FusionAuthClient ->urlSegment(${(param.constant?? && param.constant)?then(param.value, "$" + param.name)}) [#elseif param.type == "urlParameter"] ->urlParameter("${param.parameterName}", ${parameter_value(param)}) + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + ->urlParameter("${fieldName}", $request->${fieldName}) + [#else] + ->urlParameter("${fieldName}", $request->${fieldName} !== null ? (string)$request->${fieldName} : null) + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] ->bodyHandler(new JSONBodyHandler($${param.name})) [/#if] diff --git a/src/main/client/python.client.ftl b/src/main/client/python.client.ftl index 82b23c5..be74bf1 100644 --- a/src/main/client/python.client.ftl +++ b/src/main/client/python.client.ftl @@ -54,13 +54,27 @@ class FusionAuthClient: """ [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] body = { [#list api.params![] as param] [#if param.type == "form"] "${param.name}": ${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)}, + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + "${fieldName}": request.${fieldName}, + [#else] + "${fieldName}": str(request.${fieldName}) if request.${fieldName} is not None else None, + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] } @@ -74,6 +88,18 @@ class FusionAuthClient: .url_segment(${global.convertValue(param, "python")}) \ [#elseif param.type == "urlParameter"] .url_parameter('${param.parameterName}', self.convert_true_false(${global.convertValue(param, "python")})) \ + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + .url_parameter('${fieldName}', request.${fieldName}) \ + [#else] + .url_parameter('${fieldName}', str(request.${fieldName}) if request.${fieldName} is not None else None) \ + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] .body_handler(JSONBodyHandler(${camel_to_underscores(param.name)})) \ [/#if] diff --git a/src/main/client/ruby.client.ftl b/src/main/client/ruby.client.ftl index 626bed3..235c779 100644 --- a/src/main/client/ruby.client.ftl +++ b/src/main/client/ruby.client.ftl @@ -59,14 +59,30 @@ module FusionAuth [/#if] def ${camel_to_underscores(api.methodName)}[#if (api.params![])?filter(p -> !p.constant??)?has_content](${global.methodParameters(api, "ruby")})[/#if] [#assign formPost = false/] + [#assign hasFormParams = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] + [#if param.type == "form"][#assign hasFormParams = true/][/#if] [/#list] [#if formPost] - body = { + form_parameters = { [#list api.params![] as param] [#if param.type == "form"] - "${param.name}" => ${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)}[#if param?has_next],[/#if] + "${param.name}" => ${(param.constant?? && param.constant)?then("'"+param.value+"'", camel_to_underscores(param.name))}, + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + "${fieldName}" => request.${fieldName}, + [#else] + "${fieldName}" => (request.${fieldName}.to_s unless request.${fieldName}.nil?), + [/#if] + [/#list] + [/#if] + [/#list] [/#if] [/#list] } @@ -80,12 +96,24 @@ module FusionAuth .url_segment(${(param.constant?? && param.constant)?then(param.value, camel_to_underscores(param.name))}) [#elseif param.type == "urlParameter"] .url_parameter('${param.parameterName}', ${(param.constant?? && param.constant)?then(param.value, camel_to_underscores(param.name?replace("end", "_end")))}) + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + .url_parameter('${fieldName}', request.${fieldName}) + [#else] + .url_parameter('${fieldName}', request.${fieldName}.nil? ? nil : request.${fieldName}.to_s) + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] .body_handler(FusionAuth::JSONBodyHandler.new(${camel_to_underscores(param.name)})) [/#if] [/#list] [#if formPost] - .body_handler(FusionAuth::FormDataBodyHandler.new(body)) + .body_handler(FusionAuth::FormDataBodyHandler.new(form_parameters)) [/#if] .${api.method} .go diff --git a/src/main/client/typescript.client.ftl b/src/main/client/typescript.client.ftl index 04896b9..a83b8d5 100644 --- a/src/main/client/typescript.client.ftl +++ b/src/main/client/typescript.client.ftl @@ -77,7 +77,7 @@ export class FusionAuthClient { ${api.methodName}(${parameters}): Promise> { [#assign formPost = false/] [#list api.params![] as param] - [#if param.type == "form"][#assign formPost = true/][/#if] + [#if param.type == "form" || param.type == "formBody"][#assign formPost = true/][/#if] [/#list] [#if formPost] let body = new URLSearchParams(); @@ -85,6 +85,22 @@ export class FusionAuthClient { [#list api.params![] as param] [#if param.type == "form"] body.append('${param.name}', ${(param.constant?? && param.constant)?then("'"+param.value+"'", param.name)}); + [#elseif param.type == "formBody"] + [#-- Lookup the domain object by javaType --] + [#list domain as d] + [#if d.type == param.javaType] + [#-- Iterate through all fields in the domain object --] + [#list d.fields as fieldName, field] + if (request.${fieldName} !== null && request.${fieldName} !== undefined) { + [#if field.type == "String"] + body.append('${fieldName}', request.${fieldName}); + [#else] + body.append('${fieldName}', request.${fieldName}.toString()); + [/#if] + } + [/#list] + [/#if] + [/#list] [/#if] [/#list] [/#if] @@ -101,6 +117,18 @@ export class FusionAuthClient { .withUriSegment(${(param.constant?? && param.constant)?then(param.value, param.name)}) [#elseif param.type == "urlParameter"] .withParameter('${param.parameterName}', ${(param.constant?? && param.constant)?then(param.value, param.name)}) + [#elseif param.type == "queryBody"] + [#list domain as d] + [#if d.type == param.javaType] + [#list d.fields as fieldName, field] + [#if field.type == "String"] + .withParameter('${fieldName}', request.${fieldName}) + [#else] + .withParameter('${fieldName}', request.${fieldName} != null ? request.${fieldName}.toString() : null) + [/#if] + [/#list] + [/#if] + [/#list] [#elseif param.type == "body"] .withJSONBody(${param.name}) [/#if] diff --git a/src/main/domain/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json new file mode 100644 index 0000000..e40fa15 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json @@ -0,0 +1,16 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "AccessTokenIntrospectRequest", + "description" : "/**\n * The request object for introspecting an access token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "tenantId" : { + "type" : "String" + }, + "token" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json new file mode 100644 index 0000000..a998fcf --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json @@ -0,0 +1,13 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ClientCredentialsAccessTokenIntrospectRequest", + "description" : "/**\n * Contains the parameters used to introspect an access token that was obtained via the client credentials grant.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "tenantId" : { + "type" : "String" + }, + "token" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json new file mode 100644 index 0000000..25e1d72 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json @@ -0,0 +1,22 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ClientCredentialsGrantRequest", + "description" : "/**\n * The request object to make a Client Credentials grant request to obtain an access token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "grant_type" : { + "type" : "String" + }, + "scope" : { + "type" : "String" + }, + "tenantId" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json new file mode 100644 index 0000000..aafbebe --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json @@ -0,0 +1,22 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "DeviceApprovalRequest", + "description" : "/**\n * The request object to approve a device grant.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + }, + "token" : { + "type" : "String" + }, + "user_code" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json new file mode 100644 index 0000000..c2f04be --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json @@ -0,0 +1,19 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "DeviceAuthorizationRequest", + "description" : "/**\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "scope" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json new file mode 100644 index 0000000..1a13bd5 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json @@ -0,0 +1,25 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "OAuthCodeAccessTokenRequest", + "description" : "/**\n * The request object for exchanging an OAuth authorization code for an access token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "code" : { + "type" : "String" + }, + "grant_type" : { + "type" : "String" + }, + "redirect_uri" : { + "type" : "String" + }, + "tenantId" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json new file mode 100644 index 0000000..60fdf94 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json @@ -0,0 +1,28 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "OAuthCodePKCEAccessTokenRequest", + "description" : "/**\n * The request object to make a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a\n * code_verifier for an access token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "code" : { + "type" : "String" + }, + "code_verifier" : { + "type" : "String" + }, + "grant_type" : { + "type" : "String" + }, + "redirect_uri" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json new file mode 100644 index 0000000..19d8fba --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json @@ -0,0 +1,28 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RefreshTokenAccessTokenRequest", + "description" : "/**\n * The request object to exchange a Refresh Token for an Access Token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "grant_type" : { + "type" : "String" + }, + "refresh_token" : { + "type" : "String" + }, + "scope" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + }, + "user_code" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json new file mode 100644 index 0000000..1665353 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json @@ -0,0 +1,19 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RetrieveUserCodeRequest", + "description" : "/**\n * The request object for retrieving a user code that is part of an in-progress Device Authorization Grant.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + }, + "user_code" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json new file mode 100644 index 0000000..e2b12ba --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json @@ -0,0 +1,13 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RetrieveUserCodeUsingAPIKeyRequest", + "description" : "/**\n * The request object for retrieving a user code that is part of an in-progress Device Authorization Grant using an API key\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "tenantId" : { + "type" : "UUID" + }, + "user_code" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json new file mode 100644 index 0000000..12a4527 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json @@ -0,0 +1,31 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "UserCredentialsAccessTokenRequest", + "description" : "/**\n * The request object for exchanging user credentials (username and password) for an access token.\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "client_secret" : { + "type" : "String" + }, + "grant_type" : { + "type" : "String" + }, + "password" : { + "type" : "String" + }, + "scope" : { + "type" : "String" + }, + "tenantId" : { + "type" : "String" + }, + "user_code" : { + "type" : "String" + }, + "username" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domain/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json b/src/main/domain/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json new file mode 100644 index 0000000..2af2139 --- /dev/null +++ b/src/main/domain/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json @@ -0,0 +1,16 @@ +{ + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ValidateDeviceRequest", + "description" : "/**\n * The request object for validating an end-user provided user_code from the user-interaction of the Device Authorization Grant\n *\n * @author Lyle Schemmerling\n */\n", + "fields" : { + "client_id" : { + "type" : "String" + }, + "tenantId" : { + "type" : "UUID" + }, + "user_code" : { + "type" : "String" + } + } +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json new file mode 100644 index 0000000..73d4885 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest.json @@ -0,0 +1,23 @@ +{ + "className" : "io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.lang.String", + "type" : "String" + }, + "token" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "AccessTokenIntrospectRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json new file mode 100644 index 0000000..06a37b7 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest.json @@ -0,0 +1,19 @@ +{ + "className" : "io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest", + "extends" : { }, + "fields" : { + "tenantId" : { + "className" : "java.lang.String", + "type" : "String" + }, + "token" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ClientCredentialsAccessTokenIntrospectRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json new file mode 100644 index 0000000..7083ec0 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest.json @@ -0,0 +1,31 @@ +{ + "className" : "io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "grant_type" : { + "className" : "java.lang.String", + "type" : "String" + }, + "scope" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ClientCredentialsGrantRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json new file mode 100644 index 0000000..93ca454 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceApprovalRequest.json @@ -0,0 +1,31 @@ +{ + "className" : "io.fusionauth.domain.oauth2.DeviceApprovalRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + }, + "token" : { + "className" : "java.lang.String", + "type" : "String" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "DeviceApprovalRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json new file mode 100644 index 0000000..6cbf75d --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.DeviceAuthorizationRequest.json @@ -0,0 +1,27 @@ +{ + "className" : "io.fusionauth.domain.oauth2.DeviceAuthorizationRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "scope" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "DeviceAuthorizationRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json new file mode 100644 index 0000000..4f0dfda --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest.json @@ -0,0 +1,35 @@ +{ + "className" : "io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "code" : { + "className" : "java.lang.String", + "type" : "String" + }, + "grant_type" : { + "className" : "java.lang.String", + "type" : "String" + }, + "redirect_uri" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "OAuthCodeAccessTokenRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json new file mode 100644 index 0000000..636816c --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest.json @@ -0,0 +1,39 @@ +{ + "className" : "io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "code" : { + "className" : "java.lang.String", + "type" : "String" + }, + "code_verifier" : { + "className" : "java.lang.String", + "type" : "String" + }, + "grant_type" : { + "className" : "java.lang.String", + "type" : "String" + }, + "redirect_uri" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "OAuthCodePKCEAccessTokenRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json new file mode 100644 index 0000000..a40a1e9 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest.json @@ -0,0 +1,39 @@ +{ + "className" : "io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "grant_type" : { + "className" : "java.lang.String", + "type" : "String" + }, + "refresh_token" : { + "className" : "java.lang.String", + "type" : "String" + }, + "scope" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RefreshTokenAccessTokenRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json new file mode 100644 index 0000000..1b15919 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeRequest.json @@ -0,0 +1,27 @@ +{ + "className" : "io.fusionauth.domain.oauth2.RetrieveUserCodeRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RetrieveUserCodeRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json new file mode 100644 index 0000000..0f90131 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest.json @@ -0,0 +1,19 @@ +{ + "className" : "io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest", + "extends" : { }, + "fields" : { + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.util.UUID", "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "RetrieveUserCodeUsingAPIKeyRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json new file mode 100644 index 0000000..3403e30 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest.json @@ -0,0 +1,43 @@ +{ + "className" : "io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "client_secret" : { + "className" : "java.lang.String", + "type" : "String" + }, + "grant_type" : { + "className" : "java.lang.String", + "type" : "String" + }, + "password" : { + "className" : "java.lang.String", + "type" : "String" + }, + "scope" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.lang.String", + "type" : "String" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + }, + "username" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "UserCredentialsAccessTokenRequest" +} \ No newline at end of file diff --git a/src/main/domainNG/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json b/src/main/domainNG/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json new file mode 100644 index 0000000..7cae3b2 --- /dev/null +++ b/src/main/domainNG/io.fusionauth.domain.oauth2.ValidateDeviceRequest.json @@ -0,0 +1,23 @@ +{ + "className" : "io.fusionauth.domain.oauth2.ValidateDeviceRequest", + "extends" : { }, + "fields" : { + "client_id" : { + "className" : "java.lang.String", + "type" : "String" + }, + "tenantId" : { + "className" : "java.util.UUID", + "type" : "UUID" + }, + "user_code" : { + "className" : "java.lang.String", + "type" : "String" + } + }, + "imports" : [ "java.lang.String", "java.util.UUID" ], + "interfaces" : [ ], + "objectType" : "Object", + "packageName" : "io.fusionauth.domain.oauth2", + "type" : "ValidateDeviceRequest" +} \ No newline at end of file