From f580a6596c67b336bc1b7f49e587498ba30d9c13 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:40:09 +0100 Subject: [PATCH 1/5] Expand apps test cases and move to own test file --- test/integration/apps-test-cases.yaml | 263 ++++++++++++++++++++++++++ test/integration/test-cases.yaml | 236 ----------------------- 2 files changed, 263 insertions(+), 236 deletions(-) create mode 100644 test/integration/apps-test-cases.yaml diff --git a/test/integration/apps-test-cases.yaml b/test/integration/apps-test-cases.yaml new file mode 100644 index 000000000..224e16730 --- /dev/null +++ b/test/integration/apps-test-cases.yaml @@ -0,0 +1,263 @@ +config: + inherit-env: true + +tests: + 01 - it successfully lists all apps: + command: auth0 apps list + exit-code: 0 + + 02 - it throws an error when listing all apps and passing an invalid number flag: + command: auth0 apps list --number -1 + exit-code: 1 + stderr: + contains: + - "number flag invalid, please pass a number between 1 and 1000" + + 03 - it successfully creates a native app: + command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 + exit-code: 0 + stdout: + contains: + - NAME integration-test-app-nativeapp1 + - DESCRIPTION NativeApp1 + - TYPE Native + + 04 - it successfully creates a native app and outputs in json: + command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 --json + exit-code: 0 + stdout: + json: + name: integration-test-app-nativeapp1 + description: NativeApp1 + app_type: native + + 05 - it successfully creates a spa app and outputs in json: + command: auth0 apps create --name integration-test-app-spaapp1 --type spa --description SpaApp1 --json + exit-code: 0 + stdout: + json: + name: integration-test-app-spaapp1 + description: SpaApp1 + app_type: spa + + 06 - it successfully creates a regular app and outputs in json: + command: auth0 apps create --name integration-test-app-regapp1 --type regular --description RegApp1 --json + exit-code: 0 + stdout: + json: + name: integration-test-app-regapp1 + description: RegApp1 + app_type: regular_web + + 07 - it successfully creates a m2m app and outputs in json: + command: auth0 apps create --name integration-test-app-m2mapp1 --type m2m --description M2mApp1 --json + exit-code: 0 + stdout: + json: + name: integration-test-app-m2mapp1 + description: M2mApp1 + app_type: non_interactive + + 08 - it successfully creates a spa app with auth method set to none and outputs in json: + command: auth0 apps create --name integration-test-app-spaapp2 --type spa --description SpaApp2 --auth-method None --json + exit-code: 0 + stdout: + json: + token_endpoint_auth_method: none + + 09 - it fails to creates a m2m app with auth method set to none: + command: auth0 apps create --name integration-test-app-m2mapp2 --type m2m --description M2mApp2 --auth-method None + exit-code: 1 + stderr: + contains: + - "Unable to create application" + + 10 - it successfully creates a regular app with auth method set to post and outputs in json: + command: auth0 apps create --name integration-test-app-regapp2 --type regular --description RegApp2 --auth-method Post --json + exit-code: 0 + stdout: + json: + token_endpoint_auth_method: client_secret_post + + 11 - it successfully creates a regular app with auth method set to basic and outputs in json: + command: auth0 apps create --name integration-test-app-regapp3 --type regular --description RegApp3 --auth-method Basic --json + exit-code: 0 + stdout: + json: + token_endpoint_auth_method: client_secret_basic + + 12 - it successfully creates a m2m app with callbacks: + command: auth0 apps create --name integration-test-app-m2mapp3 --type m2m --description M2mApp3 --callbacks https://example.com + exit-code: 0 + stdout: + contains: + - CALLBACKS https://example.com + + 13 - it successfully creates a regular app with callbacks and outputs in json: + command: auth0 apps create --name integration-test-app-regapp4 --type regular --description RegApp4 --callbacks https://example.com,https://google.com --json + exit-code: 0 + stdout: + json: + callbacks: "[https://example.com https://google.com]" + + 14 - it successfully creates a regular app with grants: + command: auth0 apps create --name integration-test-app-regapp5 --type regular --description RegApp4 --grants credentials,password + exit-code: 0 + stdout: + contains: + - GRANTS client_credentials, password + + 15 - it successfully creates a spa app with grants and outputs in json: + command: auth0 apps create --name integration-test-app-spaapp3 --type spa --description SpaApp3 --grants refresh-token --json + exit-code: 0 + stdout: + json: + grant_types: "[refresh_token]" + + 16 - it successfully creates a native app with grants and outputs in json: + command: auth0 apps create --name integration-test-app-nativeapp2 --type native --description NativeApp2 --grants refresh-token,code --json + exit-code: 0 + stdout: + json: + grant_types: "[refresh_token authorization_code]" + + 17 - it fails to create a m2m app with device code grant: + command: auth0 apps create --name integration-test-app-m2mapp4 --type m2m --description M2mApp4 --grants credentials,device-code + exit-code: 1 + stderr: + contains: + - "Unable to create application" + + 18 - it successfully creates a native app with logout urls and outputs in json: + command: auth0 apps create --name integration-test-app-regapp6 --type native --description RegularApp --logout-urls https://*.example.com/logout,https://example.com/logout --json + exit-code: 0 + stdout: + json: + allowed_logout_urls: "[https://*.example.com/logout https://example.com/logout]" + + 19 - it successfully creates a native app with origins and outputs in json: + command: auth0 apps create --name integration-test-app-regapp7 --type native --description RegularApp --origins https://*.example.com,https://example.com --json + exit-code: 0 + stdout: + json: + allowed_origins: "[https://*.example.com https://example.com]" + + 20 - it successfully creates a native app with web origins and outputs in json: + command: auth0 apps create --name integration-test-app-spaapp4 --type native --description SpaApp4 --web-origins https://example.com --json + exit-code: 0 + stdout: + json: + web_origins: "[https://example.com]" + + 21 - given a test app: + command: ./test/integration/scripts/get-app-id.sh + exit-code: 0 + + 22 - given a test app, it successfully gets the app's details and outputs in json: + command: auth0 apps show $(cat ./test/integration/identifiers/app-id) --json + exit-code: 0 + stdout: + json: + name: integration-test-app-newapp + description: NewApp + app_type: native + + 23 - given a test app, it successfully gets the app's details: + command: auth0 apps show $(cat ./test/integration/identifiers/app-id) + exit-code: 0 + stdout: + contains: + - NAME integration-test-app-newapp + - DESCRIPTION NewApp + - TYPE Native + + 24 - given a test app, it successfully updates the app's auth method and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --auth-method Basic --json + exit-code: 0 + stdout: + json: + token_endpoint_auth_method: client_secret_basic + + 25 - given a test app, it successfully updates the app's callbacks and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --callbacks https://example.com --json + stdout: + json: + callbacks: "[https://example.com]" + exit-code: 0 + + 26 - given a test app, it successfully updates the app's description and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --description "A better description" --json + exit-code: 0 + stdout: + json: + description: A better description + + 27 - given a test app, it successfully updates the app's grants and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --grants code --json + exit-code: 0 + stdout: + json: + grant_types: "[authorization_code]" + + 28 - given a test app, it successfully updates the app's logout urls and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --logout-urls https://example.com --json + exit-code: 0 + stdout: + json: + allowed_logout_urls: "[https://example.com]" + + 29 - given a test app, it successfully updates the app's name and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --name integration-test-app-betterAppName --json + exit-code: 0 + stdout: + json: + name: integration-test-app-betterAppName + + 30 - given a test app, it successfully updates the app's origins and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --origins https://example.com --json + exit-code: 0 + stdout: + json: + allowed_origins: "[https://example.com]" + + 31 - given a test app, it successfully updates the app's type and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --type spa --json + exit-code: 0 + stdout: + json: + app_type: spa + + 32 - given a test app, it successfully updates the app's web origins and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://example.com --json + exit-code: 0 + stdout: + json: + web_origins: "[https://example.com]" + + 33 - given a test app, it successfully updates the app's web origins and type and outputs in json: + command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://examples.com --type native --json + exit-code: 0 + stdout: + json: + app_type: native + web_origins: "[https://examples.com]" + + 34 - given a test app, it successfully opens the settings page: + command: auth0 apps open $(cat ./test/integration/identifiers/app-id) --no-input + exit-code: 0 + stderr: + contains: + - "Open the following URL in a browser" + + + 35 - given a test app, it successfully sets the default application: + command: auth0 apps use $(cat ./test/integration/identifiers/app-id) --no-input + exit-code: 0 + stderr: + contains: + - "Successfully set the default application to" + + + 36 - given a test app, it successfully deletes the app: + command: auth0 apps delete $(cat ./test/integration/identifiers/app-id) --force + exit-code: 0 diff --git a/test/integration/test-cases.yaml b/test/integration/test-cases.yaml index 534c371ad..cbf712314 100644 --- a/test/integration/test-cases.yaml +++ b/test/integration/test-cases.yaml @@ -5,9 +5,6 @@ tests: auth0 apis list: exit-code: 0 - auth0 apps list: - exit-code: 0 - auth0 logs list: exit-code: 0 stdout: @@ -45,238 +42,6 @@ tests: auth0 completion bash: exit-code: 0 - # Test 'apps create' --type flag - apps create type native and check data: - command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 --json - exit-code: 0 - stdout: - json: - name: integration-test-app-nativeapp1 - description: NativeApp1 - app_type: native - - apps create type native and check output: - command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 - exit-code: 0 - stdout: - contains: - - NAME integration-test-app-nativeapp1 - - DESCRIPTION NativeApp1 - - TYPE Native - - apps create type spa: - command: auth0 apps create --name integration-test-app-spaapp1 --type spa --description SpaApp1 --json - exit-code: 0 - stdout: - json: - name: integration-test-app-spaapp1 - description: SpaApp1 - app_type: spa - - apps create type regular: - command: auth0 apps create --name integration-test-app-regapp1 --type regular --description RegApp1 --json - exit-code: 0 - stdout: - json: - name: integration-test-app-regapp1 - description: RegApp1 - app_type: regular_web - - apps create type m2m: - command: auth0 apps create --name integration-test-app-m2mapp1 --type m2m --description M2mApp1 --json - exit-code: 0 - stdout: - json: - name: integration-test-app-m2mapp1 - description: M2mApp1 - app_type: non_interactive - - # Test 'apps create' --auth-method flag - apps create type spa auth method none: - command: auth0 apps create --name integration-test-app-spaapp2 --type spa --description SpaApp2 --auth-method None --json - stdout: - json: - token_endpoint_auth_method: none - exit-code: 0 - - apps create type m2m auth method none fails: - command: auth0 apps create --name integration-test-app-m2mapp2 --type m2m --description M2mApp2 --auth-method None - exit-code: 1 - - apps create type regular auth method post: - command: auth0 apps create --name integration-test-app-regapp2 --type regular --description RegApp2 --auth-method Post --json - stdout: - json: - token_endpoint_auth_method: client_secret_post - exit-code: 0 - - apps create type regular auth method basic: - command: auth0 apps create --name integration-test-app-regapp3 --type regular --description RegApp3 --auth-method Basic --json - stdout: - json: - token_endpoint_auth_method: client_secret_basic - exit-code: 0 - - # Test 'apps create' --callbacks flag - apps create type m2m callbacks: - command: auth0 apps create --name integration-test-app-m2mapp3 --type m2m --description M2mApp3 --callbacks https://example.com - stdout: - contains: - - CALLBACKS https://example.com - exit-code: 0 - - apps create type regular callbacks list: - command: auth0 apps create --name integration-test-app-regapp4 --type regular --description RegApp4 --callbacks https://example.com,https://google.com --json - stdout: - json: - callbacks: "[https://example.com https://google.com]" - exit-code: 0 - - # Test 'apps create' --grants flag - apps create type regular grants: - command: auth0 apps create --name integration-test-app-regapp5 --type regular --description RegApp4 --grants credentials,password - stdout: - contains: - - GRANTS client_credentials, password - exit-code: 0 - - apps create type spa grants: - command: auth0 apps create --name integration-test-app-spaapp3 --type spa --description SpaApp3 --grants refresh-token --json - stdout: - json: - grant_types: "[refresh_token]" - exit-code: 0 - - apps create type native grants: - command: auth0 apps create --name integration-test-app-nativeapp2 --type native --description NativeApp2 --grants refresh-token,code --json - stdout: - json: - grant_types: "[refresh_token authorization_code]" - exit-code: 0 - - apps create type m2m grants fails: - command: auth0 apps create --name integration-test-app-m2mapp4 --type m2m --description M2mApp4 --grants credentials,device-code - exit-code: 1 - - # Test 'apps create' --logout-urls flag - apps create type regular logout urls: - command: auth0 apps create --name integration-test-app-regapp6 --type native --description RegularApp --logout-urls https://*.example.com/logout,https://example.com/logout --json - stdout: - json: - allowed_logout_urls: "[https://*.example.com/logout https://example.com/logout]" - exit-code: 0 - - # Test 'apps create' --origins flag - apps create type regular origins: - command: auth0 apps create --name integration-test-app-regapp7 --type native --description RegularApp --origins https://*.example.com,https://example.com --json - stdout: - json: - allowed_origins: "[https://*.example.com https://example.com]" - exit-code: 0 - - # Test 'apps create' --web-origins flag - apps create type native web origins: - command: auth0 apps create --name integration-test-app-spaapp4 --type native --description SpaApp4 --web-origins https://example.com --json - stdout: - json: - web_origins: "[https://example.com]" - exit-code: 0 - - # Test 'apps show' - apps create test app: # create an app and capture its client id - command: ./test/integration/scripts/get-app-id.sh - exit-code: 0 - - apps show json: - command: auth0 apps show $(cat ./test/integration/identifiers/app-id) --json # depends on "apps create test app" test - stdout: - json: - name: integration-test-app-newapp - description: NewApp - app_type: native - exit-code: 0 - - apps show: - command: auth0 apps show $(cat ./test/integration/identifiers/app-id) # depends on "apps create test app" test - stdout: - contains: - - NAME integration-test-app-newapp - - DESCRIPTION NewApp - - TYPE Native - exit-code: 0 - - # Test 'apps update'; all tests depend on "apps create test app" test - apps update auth method: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --auth-method Basic --json - stdout: - json: - token_endpoint_auth_method: client_secret_basic - exit-code: 0 - - apps update callbacks: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --callbacks https://example.com --json - stdout: - json: - callbacks: "[https://example.com]" - exit-code: 0 - - apps update description: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --description "A better description" --json - stdout: - json: - description: A better description - exit-code: 0 - - apps update grants: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --grants code --json - stdout: - json: - grant_types: "[authorization_code]" - exit-code: 0 - - apps update logout urls: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --logout-urls https://example.com --json - stdout: - json: - allowed_logout_urls: "[https://example.com]" - exit-code: 0 - - apps update name: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --name integration-test-app-betterAppName --json - stdout: - json: - name: integration-test-app-betterAppName - exit-code: 0 - - apps update origins: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --origins https://example.com --json - stdout: - json: - allowed_origins: "[https://example.com]" - exit-code: 0 - - apps update type: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --type spa --json - stdout: - json: - app_type: spa - exit-code: 0 - - apps update web origins: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://example.com --json - stdout: - json: - web_origins: "[https://example.com]" - exit-code: 0 - - apps update multiple updates: - command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://examples.com --type native --json - stdout: - json: - app_type: native - web_origins: "[https://examples.com]" - exit-code: 0 - # Test 'apis create' apis create and check data: command: auth0 apis create --name integration-test-api-def1 --identifier http://integration-test-api-def1 --scopes read:todos,write:todos --json @@ -337,7 +102,6 @@ tests: json: allow_offline_access: "false" - # Test 'apps show' apis create test api: # create an api and capture its id command: ./test/integration/scripts/get-api-id.sh exit-code: 0 From 87807858fcb3793c3b68243713f59e1c246ccdaf Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:40:27 +0100 Subject: [PATCH 2/5] Add coverage files to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6d8cf0ccc..f65d02904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Project artifacts /auth0 /test/integration/identifiers +/coverage +coverage.out # Swap [._]*.s[a-v][a-z] From 68c54d6aad09ca2587caef582521a8e47d3fb046 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:41:42 +0100 Subject: [PATCH 3/5] Add make commands to build the binary with test cover support --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 456f3aa2a..9a6f30b7c 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,10 @@ build: ## Build the cli binary for the native platform ${call print, "Building the cli binary"} go build -v -ldflags "$(GO_LINKER_FLAGS)" -o "${BUILD_DIR}/auth0" cmd/auth0/main.go +build-with-cover: ## Build the cli binary for the native platform with coverage support. + ${call print, "Building the cli binary"} + go build -cover -v -ldflags "$(GO_LINKER_FLAGS)" -o "${BUILD_DIR}/auth0" cmd/auth0/main.go + build-all-platforms: ## Build a dev version of the cli binary for all supported platforms for os in darwin linux windows; \ do env GOOS=$$os go build -ldflags "$(GO_LINKER_FLAGS)" -o "${BUILD_DIR}/auth0-$${os}" cmd/auth0/main.go; \ @@ -101,6 +105,10 @@ install: ## Install the cli binary for the native platform ${call print, "Installing the cli binary"} @$(MAKE) build BUILD_DIR="$(GO_BIN)" +install-with-cover: ## Install the cli binary for the native platform with coverage support. + ${call print, "Installing the cli binary"} + @$(MAKE) build-with-cover BUILD_DIR="$(GO_BIN)" + #----------------------------------------------------------------------------------------------------------------------- # Checks #----------------------------------------------------------------------------------------------------------------------- From b24bfe8323e87b69c9ef5c025d694a0093683ff4 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:41:52 +0100 Subject: [PATCH 4/5] Fix no input flag for apps open cmd --- internal/cli/utils_shared.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/cli/utils_shared.go b/internal/cli/utils_shared.go index c06039158..d08dfe5c9 100644 --- a/internal/cli/utils_shared.go +++ b/internal/cli/utils_shared.go @@ -272,8 +272,16 @@ func openManageURL(cli *cli, tenant string, path string) { cli.renderer.Warnf("Unable to format the correct URL, please ensure you have run 'auth0 login' and try again.") return } - if err := browser.OpenURL(fmt.Sprintf("%s%s", manageTenantURL, path)); err != nil { - cli.renderer.Warnf("Couldn't open the URL, please do it manually: %s.", manageTenantURL) + + settingsURL := fmt.Sprintf("%s%s", manageTenantURL, path) + + if cli.noInput { + cli.renderer.Infof("Open the following URL in a browser: %s", settingsURL) + return + } + + if err := browser.OpenURL(settingsURL); err != nil { + cli.renderer.Warnf("Couldn't open the URL, please do it manually: %s", settingsURL) } } From 64516f1ec5a27d585dca48cddab45a2e38327356 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Wed, 1 Mar 2023 13:04:57 +0100 Subject: [PATCH 5/5] Fix tenant name not being set when using client credentials --- internal/cli/login.go | 2 + test/integration/apps-test-cases.yaml | 72 +++++++++++++-------------- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/internal/cli/login.go b/internal/cli/login.go index d683bbe19..3cb51bced 100644 --- a/internal/cli/login.go +++ b/internal/cli/login.go @@ -3,6 +3,7 @@ package cli import ( "context" "fmt" + "strings" "github.com/pkg/browser" "github.com/spf13/cobra" @@ -272,6 +273,7 @@ func RunLoginAsMachine(ctx context.Context, inputs LoginInputs, cli *cli, cmd *c } t := Tenant{ + Name: strings.Split(inputs.Domain, ".")[0], Domain: inputs.Domain, ExpiresAt: token.ExpiresAt, ClientID: inputs.ClientID, diff --git a/test/integration/apps-test-cases.yaml b/test/integration/apps-test-cases.yaml index 224e16730..e236bb80e 100644 --- a/test/integration/apps-test-cases.yaml +++ b/test/integration/apps-test-cases.yaml @@ -2,18 +2,18 @@ config: inherit-env: true tests: - 01 - it successfully lists all apps: + 001 - it successfully lists all apps: command: auth0 apps list exit-code: 0 - 02 - it throws an error when listing all apps and passing an invalid number flag: + 002 - it throws an error when listing all apps and passing an invalid number flag: command: auth0 apps list --number -1 exit-code: 1 stderr: contains: - "number flag invalid, please pass a number between 1 and 1000" - 03 - it successfully creates a native app: + 003 - it successfully creates a native app: command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 exit-code: 0 stdout: @@ -22,7 +22,7 @@ tests: - DESCRIPTION NativeApp1 - TYPE Native - 04 - it successfully creates a native app and outputs in json: + 004 - it successfully creates a native app and outputs in json: command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 --json exit-code: 0 stdout: @@ -31,7 +31,7 @@ tests: description: NativeApp1 app_type: native - 05 - it successfully creates a spa app and outputs in json: + 005 - it successfully creates a spa app and outputs in json: command: auth0 apps create --name integration-test-app-spaapp1 --type spa --description SpaApp1 --json exit-code: 0 stdout: @@ -40,7 +40,7 @@ tests: description: SpaApp1 app_type: spa - 06 - it successfully creates a regular app and outputs in json: + 006 - it successfully creates a regular app and outputs in json: command: auth0 apps create --name integration-test-app-regapp1 --type regular --description RegApp1 --json exit-code: 0 stdout: @@ -49,7 +49,7 @@ tests: description: RegApp1 app_type: regular_web - 07 - it successfully creates a m2m app and outputs in json: + 007 - it successfully creates a m2m app and outputs in json: command: auth0 apps create --name integration-test-app-m2mapp1 --type m2m --description M2mApp1 --json exit-code: 0 stdout: @@ -58,102 +58,102 @@ tests: description: M2mApp1 app_type: non_interactive - 08 - it successfully creates a spa app with auth method set to none and outputs in json: + 008 - it successfully creates a spa app with auth method set to none and outputs in json: command: auth0 apps create --name integration-test-app-spaapp2 --type spa --description SpaApp2 --auth-method None --json exit-code: 0 stdout: json: token_endpoint_auth_method: none - 09 - it fails to creates a m2m app with auth method set to none: + 009 - it fails to creates a m2m app with auth method set to none: command: auth0 apps create --name integration-test-app-m2mapp2 --type m2m --description M2mApp2 --auth-method None exit-code: 1 stderr: contains: - "Unable to create application" - 10 - it successfully creates a regular app with auth method set to post and outputs in json: + 010 - it successfully creates a regular app with auth method set to post and outputs in json: command: auth0 apps create --name integration-test-app-regapp2 --type regular --description RegApp2 --auth-method Post --json exit-code: 0 stdout: json: token_endpoint_auth_method: client_secret_post - 11 - it successfully creates a regular app with auth method set to basic and outputs in json: + 011 - it successfully creates a regular app with auth method set to basic and outputs in json: command: auth0 apps create --name integration-test-app-regapp3 --type regular --description RegApp3 --auth-method Basic --json exit-code: 0 stdout: json: token_endpoint_auth_method: client_secret_basic - 12 - it successfully creates a m2m app with callbacks: + 012 - it successfully creates a m2m app with callbacks: command: auth0 apps create --name integration-test-app-m2mapp3 --type m2m --description M2mApp3 --callbacks https://example.com exit-code: 0 stdout: contains: - CALLBACKS https://example.com - 13 - it successfully creates a regular app with callbacks and outputs in json: + 013 - it successfully creates a regular app with callbacks and outputs in json: command: auth0 apps create --name integration-test-app-regapp4 --type regular --description RegApp4 --callbacks https://example.com,https://google.com --json exit-code: 0 stdout: json: callbacks: "[https://example.com https://google.com]" - 14 - it successfully creates a regular app with grants: + 014 - it successfully creates a regular app with grants: command: auth0 apps create --name integration-test-app-regapp5 --type regular --description RegApp4 --grants credentials,password exit-code: 0 stdout: contains: - GRANTS client_credentials, password - 15 - it successfully creates a spa app with grants and outputs in json: + 015 - it successfully creates a spa app with grants and outputs in json: command: auth0 apps create --name integration-test-app-spaapp3 --type spa --description SpaApp3 --grants refresh-token --json exit-code: 0 stdout: json: grant_types: "[refresh_token]" - 16 - it successfully creates a native app with grants and outputs in json: + 016 - it successfully creates a native app with grants and outputs in json: command: auth0 apps create --name integration-test-app-nativeapp2 --type native --description NativeApp2 --grants refresh-token,code --json exit-code: 0 stdout: json: grant_types: "[refresh_token authorization_code]" - 17 - it fails to create a m2m app with device code grant: + 017 - it fails to create a m2m app with device code grant: command: auth0 apps create --name integration-test-app-m2mapp4 --type m2m --description M2mApp4 --grants credentials,device-code exit-code: 1 stderr: contains: - "Unable to create application" - 18 - it successfully creates a native app with logout urls and outputs in json: + 018 - it successfully creates a native app with logout urls and outputs in json: command: auth0 apps create --name integration-test-app-regapp6 --type native --description RegularApp --logout-urls https://*.example.com/logout,https://example.com/logout --json exit-code: 0 stdout: json: allowed_logout_urls: "[https://*.example.com/logout https://example.com/logout]" - 19 - it successfully creates a native app with origins and outputs in json: + 019 - it successfully creates a native app with origins and outputs in json: command: auth0 apps create --name integration-test-app-regapp7 --type native --description RegularApp --origins https://*.example.com,https://example.com --json exit-code: 0 stdout: json: allowed_origins: "[https://*.example.com https://example.com]" - 20 - it successfully creates a native app with web origins and outputs in json: + 020 - it successfully creates a native app with web origins and outputs in json: command: auth0 apps create --name integration-test-app-spaapp4 --type native --description SpaApp4 --web-origins https://example.com --json exit-code: 0 stdout: json: web_origins: "[https://example.com]" - 21 - given a test app: + 021 - given a test app: command: ./test/integration/scripts/get-app-id.sh exit-code: 0 - 22 - given a test app, it successfully gets the app's details and outputs in json: + 022 - given a test app, it successfully gets the app's details and outputs in json: command: auth0 apps show $(cat ./test/integration/identifiers/app-id) --json exit-code: 0 stdout: @@ -162,7 +162,7 @@ tests: description: NewApp app_type: native - 23 - given a test app, it successfully gets the app's details: + 023 - given a test app, it successfully gets the app's details: command: auth0 apps show $(cat ./test/integration/identifiers/app-id) exit-code: 0 stdout: @@ -171,70 +171,70 @@ tests: - DESCRIPTION NewApp - TYPE Native - 24 - given a test app, it successfully updates the app's auth method and outputs in json: + 024 - given a test app, it successfully updates the app's auth method and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --auth-method Basic --json exit-code: 0 stdout: json: token_endpoint_auth_method: client_secret_basic - 25 - given a test app, it successfully updates the app's callbacks and outputs in json: + 025 - given a test app, it successfully updates the app's callbacks and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --callbacks https://example.com --json stdout: json: callbacks: "[https://example.com]" exit-code: 0 - 26 - given a test app, it successfully updates the app's description and outputs in json: + 026 - given a test app, it successfully updates the app's description and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --description "A better description" --json exit-code: 0 stdout: json: description: A better description - 27 - given a test app, it successfully updates the app's grants and outputs in json: + 027 - given a test app, it successfully updates the app's grants and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --grants code --json exit-code: 0 stdout: json: grant_types: "[authorization_code]" - 28 - given a test app, it successfully updates the app's logout urls and outputs in json: + 028 - given a test app, it successfully updates the app's logout urls and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --logout-urls https://example.com --json exit-code: 0 stdout: json: allowed_logout_urls: "[https://example.com]" - 29 - given a test app, it successfully updates the app's name and outputs in json: + 029 - given a test app, it successfully updates the app's name and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --name integration-test-app-betterAppName --json exit-code: 0 stdout: json: name: integration-test-app-betterAppName - 30 - given a test app, it successfully updates the app's origins and outputs in json: + 030 - given a test app, it successfully updates the app's origins and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --origins https://example.com --json exit-code: 0 stdout: json: allowed_origins: "[https://example.com]" - 31 - given a test app, it successfully updates the app's type and outputs in json: + 031 - given a test app, it successfully updates the app's type and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --type spa --json exit-code: 0 stdout: json: app_type: spa - 32 - given a test app, it successfully updates the app's web origins and outputs in json: + 032 - given a test app, it successfully updates the app's web origins and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://example.com --json exit-code: 0 stdout: json: web_origins: "[https://example.com]" - 33 - given a test app, it successfully updates the app's web origins and type and outputs in json: + 033 - given a test app, it successfully updates the app's web origins and type and outputs in json: command: auth0 apps update $(cat ./test/integration/identifiers/app-id) --web-origins https://examples.com --type native --json exit-code: 0 stdout: @@ -242,7 +242,7 @@ tests: app_type: native web_origins: "[https://examples.com]" - 34 - given a test app, it successfully opens the settings page: + 034 - given a test app, it successfully opens the settings page: command: auth0 apps open $(cat ./test/integration/identifiers/app-id) --no-input exit-code: 0 stderr: @@ -250,7 +250,7 @@ tests: - "Open the following URL in a browser" - 35 - given a test app, it successfully sets the default application: + 035 - given a test app, it successfully sets the default application: command: auth0 apps use $(cat ./test/integration/identifiers/app-id) --no-input exit-code: 0 stderr: @@ -258,6 +258,6 @@ tests: - "Successfully set the default application to" - 36 - given a test app, it successfully deletes the app: + 036 - given a test app, it successfully deletes the app: command: auth0 apps delete $(cat ./test/integration/identifiers/app-id) --force exit-code: 0