[AAE-9169] adf-cli - Change the doc and add clientId input (#7730)

* Change the doc and add input

* fix mistake
This commit is contained in:
Maurizio Vitale
2022-07-28 14:02:43 +02:00
committed by GitHub
parent 4c249c8106
commit 46420ea0b2
6 changed files with 13 additions and 8 deletions

View File

@@ -256,7 +256,7 @@ TEST_APP: {
The following command is in charge of checking plugin status by given plugin name: The following command is in charge of checking plugin status by given plugin name:
```bash ```bash
adf-cli check-plugin-env --host "gateway_env" --pluginName "Name of the plugin" --appName "appName" -u "username" -p "password" adf-cli check-plugin-env --host "gateway_env" --pluginName "Name of the plugin" --clientId "clientId" --appName "appName" -u "username" -p "password"
--ui "uiName" --ui "uiName"
``` ```
@@ -265,5 +265,5 @@ adf-cli check-plugin-env --host "gateway_env" --pluginName "Name of the plugin"
The following command will scan the environment to show various information on its current status: The following command will scan the environment to show various information on its current status:
```bash ```bash
adf-cli scan-env --host "https://example.com" -u "admin" -p "password" adf-cli scan-env --host "https://example.com" --clientId "clientId" -u "admin" -p "password"
``` ```

View File

@@ -12,13 +12,14 @@ export default async function main(_args: string[]) {
.version('0.1.0') .version('0.1.0')
.option('--host [type]', 'Remote environment host') .option('--host [type]', 'Remote environment host')
.option('--pluginName [type]', 'pluginName') .option('--pluginName [type]', 'pluginName')
.option('--clientId [type]', 'sso client', 'alfresco')
.option('--appName [type]', 'appName ', 'Deployed appName on activiti-cloud') .option('--appName [type]', 'appName ', 'Deployed appName on activiti-cloud')
.option('-p, --password [type]', 'password ') .option('-p, --password [type]', 'password ')
.option('-u, --username [type]', 'username ') .option('-u, --username [type]', 'username ')
.option('--ui, --uiName [type]', 'uiName', 'Deployed app UI type on activiti-cloud') .option('--ui, --uiName [type]', 'uiName', 'Deployed app UI type on activiti-cloud')
.parse(process.argv); .parse(process.argv);
pluginEnv = new CheckEnv(program.host, program.username, program.password); pluginEnv = new CheckEnv(program.host, program.username, program.password, program.clientId);
await pluginEnv.checkEnv(); await pluginEnv.checkEnv();
if (program.pluginName === PluginTarget.processService) { if (program.pluginName === PluginTarget.processService) {

View File

@@ -21,6 +21,7 @@ async function main() {
program program
.version('0.1.0') .version('0.1.0')
.option('--host [type]', 'Remote environment host') .option('--host [type]', 'Remote environment host')
.option('--clientId [type]', 'sso client', 'alfresco')
.option('-p, --password [type]', 'password ') .option('-p, --password [type]', 'password ')
.option('-u, --username [type]', 'username ') .option('-u, --username [type]', 'username ')
.parse(process.argv); .parse(process.argv);
@@ -155,7 +156,7 @@ async function checkEnv() {
authType: 'OAUTH', authType: 'OAUTH',
oauth2: { oauth2: {
host: `${program.host}/auth/realms/alfresco`, host: `${program.host}/auth/realms/alfresco`,
clientId: 'alfresco', clientId: `${program.clientId}`,
scope: 'openid' scope: 'openid'
} }
}); });

View File

@@ -26,6 +26,7 @@ async function main() {
program program
.version('0.1.0') .version('0.1.0')
.option('--host [type]', 'Remote environment host') .option('--host [type]', 'Remote environment host')
.option('--clientId [type]', 'sso client', 'alfresco')
.option('-p, --password [type]', 'password ') .option('-p, --password [type]', 'password ')
.option('-u, --username [type]', 'username ') .option('-u, --username [type]', 'username ')
.option('--license [type]', 'APS license S3 path ') .option('--license [type]', 'APS license S3 path ')
@@ -119,7 +120,7 @@ async function checkEnv() {
authType: 'OAUTH', authType: 'OAUTH',
oauth2: { oauth2: {
host: `${program.host}/auth/realms/alfresco`, host: `${program.host}/auth/realms/alfresco`,
clientId: 'alfresco', clientId: `${program.clientId}`,
scope: 'openid' scope: 'openid'
} }
}); });

View File

@@ -10,7 +10,8 @@ export class CheckEnv {
constructor( constructor(
private host: string, private host: string,
private username: string, private username: string,
private password: string private password: string,
private clientId: string = 'alfresco'
) {} ) {}
async checkEnv() { async checkEnv() {
@@ -22,7 +23,7 @@ export class CheckEnv {
authType: 'OAUTH', authType: 'OAUTH',
oauth2: { oauth2: {
host: `${this.host}/auth/realms/alfresco`, host: `${this.host}/auth/realms/alfresco`,
clientId: 'alfresco', clientId: `${this.clientId}`,
scope: 'openid' scope: 'openid'
} }
} as any); } as any);

View File

@@ -29,6 +29,7 @@ export default async function main(_args: string[]) {
program program
.version('0.1.0') .version('0.1.0')
.option('--host <type>', 'Remote environment host') .option('--host <type>', 'Remote environment host')
.option('--clientId [type]', 'sso client', 'alfresco')
.option('-p, --password <type>', 'password ') .option('-p, --password <type>', 'password ')
.option('-u, --username <type>', 'username ') .option('-u, --username <type>', 'username ')
.parse(process.argv); .parse(process.argv);
@@ -79,7 +80,7 @@ async function attemptLogin() {
authType: 'OAUTH', authType: 'OAUTH',
oauth2: { oauth2: {
host: `${program.host}/auth/realms/alfresco`, host: `${program.host}/auth/realms/alfresco`,
clientId: 'alfresco', clientId: `${program.clientId}`,
scope: 'openid', scope: 'openid',
redirectUri: '/', redirectUri: '/',
implicitFlow: false implicitFlow: false