This repository was archived by the owner on May 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-8
lines changed
spring-cloud-dataflow-shell-core/src/main
java/org/springframework/cloud/dataflow/shell Expand file tree Collapse file tree 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,19 @@ public class TargetCredentials {
3737
3838 private final String password ;
3939
40+ private final boolean usesAccessToken ;
41+
4042 public TargetCredentials (String username , String password ) {
4143 this .username = username ;
4244 this .password = password ;
45+ this .usesAccessToken = false ;
46+ }
47+
48+ public TargetCredentials (boolean usesAccessToken ) {
49+ super ();
50+ this .username = null ;
51+ this .password = null ;
52+ this .usesAccessToken = usesAccessToken ;
4353 }
4454
4555 public String getUsername () {
@@ -51,7 +61,12 @@ public String getPassword() {
5161 }
5262
5363 public String getDisplayableContents () {
54- return "[username='" + username + "', password='********']" ;
64+ if (this .usesAccessToken ) {
65+ return "[Uses OAuth2 Access Token]" ;
66+ }
67+ else {
68+ return "[username='" + username + "', password='********']" ;
69+ }
5570 }
5671
5772 public List <RoleType > getRoles () {
Original file line number Diff line number Diff line change 4343import org .springframework .cloud .dataflow .rest .util .ProcessOutputResource ;
4444import org .springframework .cloud .dataflow .rest .util .ResourceBasedAuthorizationInterceptor ;
4545import org .springframework .cloud .dataflow .shell .Target ;
46+ import org .springframework .cloud .dataflow .shell .TargetCredentials ;
4647import org .springframework .cloud .dataflow .shell .TargetHolder ;
4748import org .springframework .cloud .dataflow .shell .command .support .RoleType ;
4849import org .springframework .cloud .dataflow .shell .config .DataFlowShell ;
@@ -195,6 +196,7 @@ public String target(
195196 httpClientConfigurer .basicAuthCredentials (targetUsername , targetPassword );
196197 }
197198 if (StringUtils .hasText (credentialsProviderCommand )) {
199+ this .targetHolder .getTarget ().setTargetCredentials (new TargetCredentials (true ));
198200 final Resource credentialsResource = new ProcessOutputResource (credentialsProviderCommand .split ("\\ s+" ));
199201 httpClientConfigurer .addInterceptor (new ResourceBasedAuthorizationInterceptor (credentialsResource ));
200202 }
Original file line number Diff line number Diff line change 11Data Flow Options:
2- --dataflow.uri=<uri> Address of the Data Flow Server [default: http://localhost:9393].
3- --dataflow.username=<USER> Username of the Data Flow Server [no default].
4- --dataflow.password=<PASSWORD> Password of the Data Flow Server [no default].
5- --dataflow.skip-ssl-validation=<true|false> Accept any SSL certificate (even self-signed) [default: no].
6- --spring.shell.historySize=<SIZE> Default size of the shell log file [default: 3000].
7- --spring.shell.commandFile=<FILE> Data Flow Shell executes commands read from the file(s) and then exits.
8- --help This message.
2+ --dataflow.uri=<uri> Address of the Data Flow Server [default: http://localhost:9393].
3+ --dataflow.username=<USER> Username of the Data Flow Server [no default].
4+ --dataflow.password=<PASSWORD> Password of the Data Flow Server [no default].
5+ --dataflow.credentials-provider-command=<COMMAND> Executes an external command which must return an OAuth Access Token [no default].
6+ --dataflow.skip-ssl-validation=<true|false> Accept any SSL certificate (even self-signed) [default: no].
7+ --spring.shell.historySize=<SIZE> Default size of the shell log file [default: 3000].
8+ --spring.shell.commandFile=<FILE> Data Flow Shell executes commands read from the file(s) and then exits.
9+ --help This message.
You can’t perform that action at this time.
0 commit comments