Skip to content

Commit d9e351c

Browse files
committed
Delegate UseAuthenticationsBuilder oidc/oauth2 shorthands to DSL helpers
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
1 parent 65f319e commit d9e351c

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/UseAuthenticationsBuilder.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public UseAuthenticationsBuilder digest(String name, String username, String pas
5252

5353
public UseAuthenticationsBuilder oidc(
5454
String name, String authority, OAuth2AuthenticationData.OAuth2AuthenticationDataGrant grant) {
55-
return authentication(name, a -> a.openIDConnect(o -> o.authority(authority).grant(grant)));
55+
return authentication(name, DSL.oidc(authority, grant));
5656
}
5757

5858
public UseAuthenticationsBuilder oidc(
@@ -61,14 +61,7 @@ public UseAuthenticationsBuilder oidc(
6161
OAuth2AuthenticationData.OAuth2AuthenticationDataGrant grant,
6262
String clientId,
6363
String clientSecret) {
64-
return authentication(
65-
name,
66-
a ->
67-
a.openIDConnect(
68-
o ->
69-
o.authority(authority)
70-
.grant(grant)
71-
.client(c -> c.id(clientId).secret(clientSecret))));
64+
return authentication(name, DSL.oidc(authority, grant, clientId, clientSecret));
7265
}
7366

7467
public UseAuthenticationsBuilder oauth2(
@@ -87,16 +80,7 @@ public UseAuthenticationsBuilder oauth2(
8780
String clientId,
8881
String clientSecret,
8982
Consumer<OAuth2AuthenticationPropertiesEndpointsBuilder> endpoints) {
90-
return authentication(
91-
name,
92-
a ->
93-
a.oauth2(
94-
o -> {
95-
o.authority(authority)
96-
.grant(grant)
97-
.client(c -> c.id(clientId).secret(clientSecret));
98-
o.endpoints(endpoints);
99-
}));
83+
return authentication(name, DSL.oauth2(authority, grant, clientId, clientSecret, endpoints));
10084
}
10185

10286
public UseAuthenticationsBuilder oauth2(

0 commit comments

Comments
 (0)