diff --git a/api/src/test/java/io/serverlessworkflow/api/ApiTest.java b/api/src/test/java/io/serverlessworkflow/api/ApiTest.java index 36d6841e..3505d645 100644 --- a/api/src/test/java/io/serverlessworkflow/api/ApiTest.java +++ b/api/src/test/java/io/serverlessworkflow/api/ApiTest.java @@ -23,8 +23,8 @@ import io.serverlessworkflow.api.types.CallHTTP; import io.serverlessworkflow.api.types.CallTask; import io.serverlessworkflow.api.types.HTTPArguments; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData.OAuth2AutenthicationDataGrant; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData.OAuth2AuthenticationDataGrant; import io.serverlessworkflow.api.types.OAuth2AuthenticationPolicy; import io.serverlessworkflow.api.types.OAuth2AuthenticationPolicyConfiguration; import io.serverlessworkflow.api.types.OAuth2AuthenticationPropertiesEndpoints; @@ -107,10 +107,10 @@ void testOauth2Auth() throws IOException { assertThat(endpoints.getToken()).isEqualTo("/auth/token"); assertThat(endpoints.getIntrospection()).isEqualTo("/auth/introspect"); - OAuth2AutenthicationData oauth2Data = oauth2Props.getOAuth2AutenthicationData(); + OAuth2AuthenticationData oauth2Data = oauth2Props.getOAuth2AuthenticationData(); assertThat(oauth2Data.getAuthority().getLiteralUri()) .isEqualTo(URI.create("http://keycloak/realms/fake-authority")); - assertThat(oauth2Data.getGrant()).isEqualTo(OAuth2AutenthicationDataGrant.CLIENT_CREDENTIALS); + assertThat(oauth2Data.getGrant()).isEqualTo(OAuth2AuthenticationDataGrant.CLIENT_CREDENTIALS); assertThat(oauth2Data.getClient().getId()).isEqualTo("workflow-runtime-id"); assertThat(oauth2Data.getClient().getSecret()).isEqualTo("workflow-runtime-secret"); } diff --git a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OAuth2AuthenticationPolicyBuilder.java b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OAuth2AuthenticationPolicyBuilder.java index af76983d..6a4d6835 100644 --- a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OAuth2AuthenticationPolicyBuilder.java +++ b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OAuth2AuthenticationPolicyBuilder.java @@ -43,7 +43,7 @@ public OAuth2AuthenticationPolicyBuilder endpoints( public OAuth2AuthenticationPolicy build() { final OAuth2AuthenticationPolicyConfiguration configuration = new OAuth2AuthenticationPolicyConfiguration(); - configuration.setOAuth2AutenthicationData(this.getAuthenticationData()); + configuration.setOAuth2AuthenticationData(this.getAuthenticationData()); configuration.setOAuth2ConnectAuthenticationProperties(this.properties); final Oauth2 oauth2 = new Oauth2(); diff --git a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OIDCBuilder.java b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OIDCBuilder.java index f12ffbaf..5518b296 100644 --- a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OIDCBuilder.java +++ b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/OIDCBuilder.java @@ -16,8 +16,8 @@ package io.serverlessworkflow.fluent.spec; import io.serverlessworkflow.api.types.AuthenticationPolicy; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; -import io.serverlessworkflow.api.types.OAuth2AutenthicationDataClient; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationDataClient; import io.serverlessworkflow.api.types.OAuth2AuthenticationPropertiesEndpoints; import io.serverlessworkflow.api.types.OAuth2TokenDefinition; import io.serverlessworkflow.api.types.OAuth2TokenRequest; @@ -25,10 +25,10 @@ import java.util.function.Consumer; public abstract class OIDCBuilder { - private final OAuth2AutenthicationData authenticationData; + private final OAuth2AuthenticationData authenticationData; OIDCBuilder() { - this.authenticationData = new OAuth2AutenthicationData(); + this.authenticationData = new OAuth2AuthenticationData(); this.authenticationData.setRequest(new OAuth2TokenRequest()); } @@ -37,7 +37,7 @@ public OIDCBuilder authority(String authority) { return this; } - public OIDCBuilder grant(OAuth2AutenthicationData.OAuth2AutenthicationDataGrant grant) { + public OIDCBuilder grant(OAuth2AuthenticationData.OAuth2AuthenticationDataGrant grant) { this.authenticationData.setGrant(grant); return this; } @@ -100,7 +100,7 @@ public OIDCBuilder client(Consumer cli return this; } - protected final OAuth2AutenthicationData getAuthenticationData() { + protected final OAuth2AuthenticationData getAuthenticationData() { return authenticationData; } @@ -129,10 +129,10 @@ public OAuth2TokenDefinition build() { } public static final class OAuth2AuthenticationDataClientBuilder { - private final OAuth2AutenthicationDataClient client; + private final OAuth2AuthenticationDataClient client; OAuth2AuthenticationDataClientBuilder() { - this.client = new OAuth2AutenthicationDataClient(); + this.client = new OAuth2AuthenticationDataClient(); } public OAuth2AuthenticationDataClientBuilder id(String id) { @@ -151,12 +151,12 @@ public OAuth2AuthenticationDataClientBuilder assertion(String assertion) { } public OAuth2AuthenticationDataClientBuilder authentication( - OAuth2AutenthicationDataClient.ClientAuthentication authentication) { + OAuth2AuthenticationDataClient.ClientAuthentication authentication) { this.client.setAuthentication(authentication); return this; } - public OAuth2AutenthicationDataClient build() { + public OAuth2AuthenticationDataClient build() { return this.client; } } diff --git a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretBasic.java b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretBasic.java index 6dfbe260..d18f2b04 100644 --- a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretBasic.java +++ b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretBasic.java @@ -15,10 +15,10 @@ */ package io.serverlessworkflow.impl.executors.http.oauth; -import static io.serverlessworkflow.api.types.OAuth2AutenthicationData.OAuth2AutenthicationDataGrant.CLIENT_CREDENTIALS; -import static io.serverlessworkflow.api.types.OAuth2AutenthicationData.OAuth2AutenthicationDataGrant.PASSWORD; +import static io.serverlessworkflow.api.types.OAuth2AuthenticationData.OAuth2AuthenticationDataGrant.CLIENT_CREDENTIALS; +import static io.serverlessworkflow.api.types.OAuth2AuthenticationData.OAuth2AuthenticationDataGrant.PASSWORD; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; import io.serverlessworkflow.api.types.Oauth2; import java.util.Base64; @@ -31,8 +31,8 @@ public ClientSecretBasic(Oauth2 oauth2) { } public void execute(HttpRequestBuilder requestBuilder) { - OAuth2AutenthicationData authenticationData = - oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AutenthicationData(); + OAuth2AuthenticationData authenticationData = + oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AuthenticationData(); if (authenticationData.getGrant().equals(PASSWORD)) { password(requestBuilder, authenticationData); } else if (authenticationData.getGrant().equals(CLIENT_CREDENTIALS)) { @@ -44,7 +44,7 @@ public void execute(HttpRequestBuilder requestBuilder) { } private void clientCredentials( - HttpRequestBuilder requestBuilder, OAuth2AutenthicationData authenticationData) { + HttpRequestBuilder requestBuilder, OAuth2AuthenticationData authenticationData) { if (authenticationData.getClient() == null || authenticationData.getClient().getId() == null || authenticationData.getClient().getSecret() == null) { @@ -63,7 +63,7 @@ private void clientCredentials( } private void password( - HttpRequestBuilder requestBuilder, OAuth2AutenthicationData authenticationData) { + HttpRequestBuilder requestBuilder, OAuth2AuthenticationData authenticationData) { if (authenticationData.getUsername() == null || authenticationData.getPassword() == null) { throw new IllegalArgumentException( "Username and password must be provided for password grant type"); diff --git a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretPostStep.java b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretPostStep.java index e00ca28a..2e89b5ea 100644 --- a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretPostStep.java +++ b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/ClientSecretPostStep.java @@ -15,10 +15,10 @@ */ package io.serverlessworkflow.impl.executors.http.oauth; -import static io.serverlessworkflow.api.types.OAuth2AutenthicationData.OAuth2AutenthicationDataGrant.CLIENT_CREDENTIALS; -import static io.serverlessworkflow.api.types.OAuth2AutenthicationData.OAuth2AutenthicationDataGrant.PASSWORD; +import static io.serverlessworkflow.api.types.OAuth2AuthenticationData.OAuth2AuthenticationDataGrant.CLIENT_CREDENTIALS; +import static io.serverlessworkflow.api.types.OAuth2AuthenticationData.OAuth2AuthenticationDataGrant.PASSWORD; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; import io.serverlessworkflow.api.types.Oauth2; class ClientSecretPostStep { @@ -29,8 +29,8 @@ public ClientSecretPostStep(Oauth2 oauth2) { } public void execute(HttpRequestBuilder requestBuilder) { - OAuth2AutenthicationData authenticationData = - oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AutenthicationData(); + OAuth2AuthenticationData authenticationData = + oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AuthenticationData(); if (authenticationData.getGrant().equals(PASSWORD)) { password(requestBuilder, authenticationData); @@ -43,7 +43,7 @@ public void execute(HttpRequestBuilder requestBuilder) { } private void clientCredentials( - HttpRequestBuilder requestBuilder, OAuth2AutenthicationData authenticationData) { + HttpRequestBuilder requestBuilder, OAuth2AuthenticationData authenticationData) { if (authenticationData.getClient() == null || authenticationData.getClient().getId() == null || authenticationData.getClient().getSecret() == null) { @@ -59,7 +59,7 @@ private void clientCredentials( } private void password( - HttpRequestBuilder requestBuilder, OAuth2AutenthicationData authenticationData) { + HttpRequestBuilder requestBuilder, OAuth2AuthenticationData authenticationData) { if (authenticationData.getUsername() == null || authenticationData.getPassword() == null) { throw new IllegalArgumentException( "Username and password must be provided for password grant type"); diff --git a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/HttpRequestBuilder.java b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/HttpRequestBuilder.java index fff003d6..354b8ad0 100644 --- a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/HttpRequestBuilder.java +++ b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/HttpRequestBuilder.java @@ -18,7 +18,7 @@ import static io.serverlessworkflow.api.types.OAuth2TokenRequest.Oauth2TokenRequestEncoding; import static io.serverlessworkflow.api.types.OAuth2TokenRequest.Oauth2TokenRequestEncoding.APPLICATION_X_WWW_FORM_URLENCODED; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; import io.serverlessworkflow.api.types.OAuth2TokenRequest; import io.serverlessworkflow.impl.TaskContext; import io.serverlessworkflow.impl.WorkflowApplication; @@ -48,7 +48,7 @@ class HttpRequestBuilder { private URI uri; - private OAuth2AutenthicationData.OAuth2AutenthicationDataGrant grantType; + private OAuth2AuthenticationData.OAuth2AuthenticationDataGrant grantType; private Oauth2TokenRequestEncoding requestContentType = APPLICATION_X_WWW_FORM_URLENCODED; @@ -81,7 +81,7 @@ HttpRequestBuilder withRequestContentType(OAuth2TokenRequest oAuth2TokenRequest) } HttpRequestBuilder withGrantType( - OAuth2AutenthicationData.OAuth2AutenthicationDataGrant grantType) { + OAuth2AuthenticationData.OAuth2AuthenticationDataGrant grantType) { this.grantType = grantType; return this; } diff --git a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/OAuthRequestBuilder.java b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/OAuthRequestBuilder.java index c78e16f2..1a87e6f5 100644 --- a/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/OAuthRequestBuilder.java +++ b/impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/OAuthRequestBuilder.java @@ -15,10 +15,10 @@ */ package io.serverlessworkflow.impl.executors.http.oauth; -import static io.serverlessworkflow.api.types.OAuth2AutenthicationDataClient.ClientAuthentication.CLIENT_SECRET_POST; +import static io.serverlessworkflow.api.types.OAuth2AuthenticationDataClient.ClientAuthentication.CLIENT_SECRET_POST; -import io.serverlessworkflow.api.types.OAuth2AutenthicationData; -import io.serverlessworkflow.api.types.OAuth2AutenthicationDataClient; +import io.serverlessworkflow.api.types.OAuth2AuthenticationData; +import io.serverlessworkflow.api.types.OAuth2AuthenticationDataClient; import io.serverlessworkflow.api.types.OAuth2AuthenticationPropertiesEndpoints; import io.serverlessworkflow.api.types.Oauth2; import io.serverlessworkflow.impl.TaskContext; @@ -36,7 +36,7 @@ public class OAuthRequestBuilder { private final Oauth2 oauth2; - private final OAuth2AutenthicationData authenticationData; + private final OAuth2AuthenticationData authenticationData; private final WorkflowApplication application; @@ -51,7 +51,7 @@ public class OAuthRequestBuilder { public OAuthRequestBuilder(WorkflowApplication application, Oauth2 oauth2) { this.oauth2 = oauth2; this.authenticationData = - oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AutenthicationData(); + oauth2.getOAuth2ConnectAuthenticationProperties().getOAuth2AuthenticationData(); this.application = application; } @@ -90,7 +90,7 @@ private void clientSecretPost(HttpRequestBuilder requestBuilder) { new ClientSecretPostStep(oauth2).execute(requestBuilder); } - private OAuth2AutenthicationDataClient.ClientAuthentication getClientAuthentication() { + private OAuth2AuthenticationDataClient.ClientAuthentication getClientAuthentication() { if (authenticationData.getClient() == null || authenticationData.getClient().getAuthentication() == null) { return CLIENT_SECRET_POST; @@ -102,7 +102,7 @@ private void issuers() { issuers = oauth2 .getOAuth2ConnectAuthenticationProperties() - .getOAuth2AutenthicationData() + .getOAuth2AuthenticationData() .getIssuers(); } @@ -142,7 +142,7 @@ private void authenticationURI(HttpRequestBuilder requestBuilder) { String baseUri = oauth2 .getOAuth2ConnectAuthenticationProperties() - .getOAuth2AutenthicationData() + .getOAuth2AuthenticationData() .getAuthority() .getLiteralUri() .toString() diff --git a/types/src/main/resources/schema/workflow.yaml b/types/src/main/resources/schema/workflow.yaml index 73bda7ee..91237572 100644 --- a/types/src/main/resources/schema/workflow.yaml +++ b/types/src/main/resources/schema/workflow.yaml @@ -1055,21 +1055,21 @@ $defs: required: [ oidc ] oauth2AuthenticationProperties: type: object - title: OAuth2AutenthicationData + title: OAuth2AuthenticationData description: Inline configuration of the OAuth2 authentication policy. properties: authority: $ref: '#/$defs/uriTemplate' - title: OAuth2AutenthicationDataAuthority + title: OAuth2AuthenticationDataAuthority description: The URI that references the OAuth2 authority to use. grant: type: string enum: [ authorization_code, client_credentials, password, refresh_token, 'urn:ietf:params:oauth:grant-type:token-exchange'] - title: OAuth2AutenthicationDataGrant + title: OAuth2AuthenticationDataGrant description: The grant type to use. client: type: object - title: OAuth2AutenthicationDataClient + title: OAuth2AuthenticationDataClient description: The definition of an OAuth2 client. unevaluatedProperties: false properties: @@ -1109,31 +1109,31 @@ $defs: type: string scopes: type: array - title: OAuth2AutenthicationDataScopes + title: OAuth2AuthenticationDataScopes description: The scopes, if any, to request the token for. items: type: string audiences: type: array - title: OAuth2AutenthicationDataAudiences + title: OAuth2AuthenticationDataAudiences description: The audiences, if any, to request the token for. items: type: string username: type: string - title: OAuth2AutenthicationDataUsername + title: OAuth2AuthenticationDataUsername description: The username to use. Used only if the grant type is Password. password: type: string - title: OAuth2AutenthicationDataPassword + title: OAuth2AuthenticationDataPassword description: The password to use. Used only if the grant type is Password. subject: $ref: '#/$defs/oauth2Token' - title: OAuth2AutenthicationDataSubject + title: OAuth2AuthenticationDataSubject description: The security token that represents the identity of the party on behalf of whom the request is being made. actor: $ref: '#/$defs/oauth2Token' - title: OAuth2AutenthicationDataActor + title: OAuth2AuthenticationDataActor description: The security token that represents the identity of the acting party. oauth2Token: type: object