2323import java .util .HashMap ;
2424import java .util .Map ;
2525import java .util .Objects ;
26+ import java .util .Optional ;
2627
2728class HttpRequestInfoBuilder {
2829
2930 private Map <String , WorkflowValueResolver <String >> headers ;
3031
3132 private Map <String , WorkflowValueResolver <String >> queryParams ;
3233
34+ private Map <String , WorkflowValueResolver <String >> clientAuthParams ;
35+
3336 private WorkflowValueResolver <URI > uri ;
3437
35- private WorkflowValueResolver <URI > revocationUri ;
38+ private Optional < WorkflowValueResolver <URI >> revocationUri = Optional . empty () ;
3639
37- private WorkflowValueResolver <URI > introspectionUri ;
40+ private Optional < WorkflowValueResolver <URI >> introspectionUri = Optional . empty () ;
3841
3942 private String grantType ;
4043
@@ -43,6 +46,7 @@ class HttpRequestInfoBuilder {
4346 HttpRequestInfoBuilder () {
4447 headers = new HashMap <>();
4548 queryParams = new HashMap <>();
49+ clientAuthParams = new HashMap <>();
4650 }
4751
4852 HttpRequestInfoBuilder addHeader (String key , String token ) {
@@ -65,17 +69,28 @@ HttpRequestInfoBuilder addQueryParam(String key, WorkflowValueResolver<String> t
6569 return this ;
6670 }
6771
72+ HttpRequestInfoBuilder addClientAuthParam (String key , String token ) {
73+ clientAuthParams .put (key , (w , t , m ) -> token );
74+ return this ;
75+ }
76+
77+ HttpRequestInfoBuilder addClientAuthParam (String key , WorkflowValueResolver <String > token ) {
78+ clientAuthParams .put (key , token );
79+ return this ;
80+ }
81+
6882 HttpRequestInfoBuilder withUri (WorkflowValueResolver <URI > uri ) {
6983 this .uri = uri ;
7084 return this ;
7185 }
7286
73- HttpRequestInfoBuilder withRevocationUri (WorkflowValueResolver <URI > revocationUri ) {
87+ HttpRequestInfoBuilder withRevocationUri (Optional < WorkflowValueResolver <URI > > revocationUri ) {
7488 this .revocationUri = revocationUri ;
7589 return this ;
7690 }
7791
78- HttpRequestInfoBuilder withIntrospectionUri (WorkflowValueResolver <URI > introspectionUri ) {
92+ HttpRequestInfoBuilder withIntrospectionUri (
93+ Optional <WorkflowValueResolver <URI >> introspectionUri ) {
7994 this .introspectionUri = introspectionUri ;
8095 return this ;
8196 }
@@ -106,6 +121,13 @@ HttpRequestInfo build() {
106121 contentType = APPLICATION_X_WWW_FORM_URLENCODED .value ();
107122 }
108123 return new HttpRequestInfo (
109- headers , queryParams , uri , revocationUri , introspectionUri , grantType , contentType );
124+ headers ,
125+ queryParams ,
126+ clientAuthParams ,
127+ uri ,
128+ revocationUri ,
129+ introspectionUri ,
130+ grantType ,
131+ contentType );
110132 }
111133}
0 commit comments