Deprecate cloud-token and cloud-host args and params. Write token to new ~/.pipes location (#4147)

This commit is contained in:
kaidaguerre
2024-02-28 08:59:56 -06:00
committed by GitHub
parent a02c9a69fb
commit d7ff47b165
22 changed files with 282 additions and 132 deletions

View File

@@ -1,8 +1,8 @@
workspace "default" {
introspection = "info"
cloud_host = "latestpipe.turbot.io/"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099999"
pipes_host = "latestpipe.turbot.io/"
pipes_token = "spt_012faketoken34567890_012faketoken3456789099999"
install_dir = "sp_install_dir_default"
mod_location = "sp_install_dir_default"
snapshot_location = "snaps"
@@ -11,8 +11,8 @@ workspace "default" {
workspace "sample" {
introspection = "control"
cloud_host = "testpipe.turbot.io"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099999"
pipes_host = "testpipe.turbot.io"
pipes_token = "spt_012faketoken34567890_012faketoken3456789099999"
install_dir = "sp_install_dir_sample"
mod_location = "sp_install_dir_sample"
snapshot_location = "snap"

View File

@@ -1,6 +1,6 @@
workspace "default" {
cloud_host = "latestpipe.turbot.io/"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099999"
pipes_host = "latestpipe.turbot.io/"
pipes_token = "spt_012faketoken34567890_012faketoken3456789099999"
mod_location = "sp_install_dir_default"
snapshot_location = "snaps"
workspace_database = "fk43e7"
@@ -27,8 +27,8 @@ workspace "default" {
}
workspace "sample" {
cloud_host = "latestpipe.turbot.io/"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099999"
pipes_host = "latestpipe.turbot.io/"
pipes_token = "spt_012faketoken34567890_012faketoken3456789099999"
mod_location = "sp_install_dir_sample"
snapshot_location = "snaps"
workspace_database = "fk43e7"

View File

@@ -11,8 +11,8 @@
},
"expected": {
"introspection": "info",
"cloud-host": "latestpipe.turbot.io/",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099999",
"pipes-host": "latestpipe.turbot.io/",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099999",
"install-dir": "sp_install_dir_default",
"mod-location": "sp_install_dir_default",
"snapshot-location": "snaps",
@@ -27,10 +27,10 @@
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles",
"STEAMPIPE_CLOUD_HOST=testpipe.turbot.io",
"PIPES_HOST=testpipe.turbot.io",
"STEAMPIPE_MOD_LOCATION=sp_install_dir_env",
"STEAMPIPE_INSTALL_DIR=sp_install_dir_env",
"STEAMPIPE_CLOUD_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"PIPES_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"STEAMPIPE_SNAPSHOT_LOCATION=snapshot",
"STEAMPIPE_WORKSPACE_DATABASE=fk/43e7",
"STEAMPIPE_INTROSPECTION=none"
@@ -38,16 +38,16 @@
"args": [
"--install-dir=sp_install_dir_default",
"--mod-location=sp_install_dir_default",
"--cloud-host=fastestpipe.turbot.io",
"--cloud-token=spt_012faketoken34567890_012faketoken3456789099990",
"--pipes-host=fastestpipe.turbot.io",
"--pipes-token=spt_012faketoken34567890_012faketoken3456789099990",
"--snapshot-location=snaps",
"--workspace-database=fk43e9"
]
},
"expected": {
"introspection": "none",
"cloud-host": "fastestpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099990",
"pipes-host": "fastestpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099990",
"install-dir": "sp_install_dir_default",
"mod-location": "sp_install_dir_default",
"snapshot-location": "snaps",
@@ -61,18 +61,18 @@
"cmd": "query",
"setup": {
"env": [
"STEAMPIPE_CLOUD_HOST=latestpipe.turbot.io/",
"PIPES_HOST=latestpipe.turbot.io/",
"STEAMPIPE_INSTALL_DIR=sp_install_dir_env",
"STEAMPIPE_MOD_LOCATION=sp_install_dir_env",
"STEAMPIPE_CLOUD_TOKEN=spt_012faketoken34567890_012faketoken3456789099999",
"PIPES_TOKEN=spt_012faketoken34567890_012faketoken3456789099999",
"STEAMPIPE_SNAPSHOT_LOCATION=snaps",
"STEAMPIPE_WORKSPACE_DATABASE=fk43e7"
],
"args": []
},
"expected": {
"cloud-host": "latestpipe.turbot.io/",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099999",
"pipes-host": "latestpipe.turbot.io/",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099999",
"install-dir": "sp_install_dir_env",
"mod-location": "sp_install_dir_env",
"snapshot-location": "snaps",
@@ -94,8 +94,8 @@
},
"expected": {
"introspection": "control",
"cloud-host": "testpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099999",
"pipes-host": "testpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099999",
"install-dir": "sp_install_dir_sample",
"mod-location": "sp_install_dir_sample",
"snapshot-location": "snap",
@@ -112,15 +112,15 @@
"args": [
"--install-dir=sp_install_dir_sample",
"--mod-location=sp_install_dir_sample",
"--cloud-host=fastestpipe.turbot.io",
"--cloud-token=spt_012faketoken34567890_012faketoken3456789099990",
"--pipes-host=fastestpipe.turbot.io",
"--pipes-token=spt_012faketoken34567890_012faketoken3456789099990",
"--snapshot-location=snaps",
"--workspace-database=fk43e9"
]
},
"expected": {
"cloud-host": "fastestpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099990",
"pipes-host": "fastestpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099990",
"install-dir": "sp_install_dir_sample",
"mod-location": "sp_install_dir_sample",
"snapshot-location": "snaps",
@@ -135,18 +135,18 @@
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles",
"STEAMPIPE_CLOUD_HOST=fastestpipe.turbot.io/",
"PIPES_HOST=fastestpipe.turbot.io/",
"STEAMPIPE_INSTALL_DIR=sp_install_dir_env",
"STEAMPIPE_MOD_LOCATION=sp_install_dir_env",
"STEAMPIPE_CLOUD_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"PIPES_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"STEAMPIPE_SNAPSHOT_LOCATION=snapshot",
"STEAMPIPE_WORKSPACE_DATABASE=ab43e6"
],
"args": []
},
"expected": {
"cloud-host": "fastestpipe.turbot.io/",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099996",
"pipes-host": "fastestpipe.turbot.io/",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099996",
"install-dir": "sp_install_dir_env",
"mod-location": "sp_install_dir_env",
"snapshot-location": "snapshot",
@@ -161,10 +161,10 @@
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles",
"STEAMPIPE_CLOUD_HOST=fastestpipe.turbot.io/",
"PIPES_HOST=fastestpipe.turbot.io/",
"STEAMPIPE_INSTALL_DIR=sp_install_dir_env",
"STEAMPIPE_MOD_LOCATION=sp_install_dir_env",
"STEAMPIPE_CLOUD_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"PIPES_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"STEAMPIPE_SNAPSHOT_LOCATION=snapshot",
"STEAMPIPE_WORKSPACE_DATABASE=ab43e6"
],
@@ -173,8 +173,8 @@
]
},
"expected": {
"cloud-host": "testpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099999",
"pipes-host": "testpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099999",
"install-dir": "sp_install_dir_sample",
"mod-location": "sp_install_dir_sample",
"snapshot-location": "snap",
@@ -189,10 +189,10 @@
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles",
"STEAMPIPE_CLOUD_HOST=fastestpipe.turbot.io/",
"PIPES_HOST=fastestpipe.turbot.io/",
"STEAMPIPE_INSTALL_DIR=sp_install_dir_env",
"STEAMPIPE_MOD_LOCATION=sp_install_dir_env",
"STEAMPIPE_CLOUD_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"PIPES_TOKEN=spt_012faketoken34567890_012faketoken3456789099996",
"STEAMPIPE_SNAPSHOT_LOCATION=snapshot",
"STEAMPIPE_WORKSPACE_DATABASE=ab43e6"
],
@@ -201,8 +201,8 @@
]
},
"expected": {
"cloud-host": "testpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099999",
"pipes-host": "testpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099999",
"install-dir": "sp_install_dir_sample",
"mod-location": "sp_install_dir_sample",
"snapshot-location": "snap",
@@ -221,15 +221,15 @@
"args": [
"--install-dir=sp_install_dir_default",
"--mod-location=sp_install_dir_default",
"--cloud-host=fastestpipe.turbot.io",
"--cloud-token=spt_012faketoken34567890_012faketoken3456789099990",
"--pipes-host=fastestpipe.turbot.io",
"--pipes-token=spt_012faketoken34567890_012faketoken3456789099990",
"--snapshot-location=snaps",
"--workspace-database=fk43e9"
]
},
"expected": {
"cloud-host": "fastestpipe.turbot.io",
"cloud-token": "spt_012faketoken34567890_012faketoken3456789099990",
"pipes-host": "fastestpipe.turbot.io",
"pipes-token": "spt_012faketoken34567890_012faketoken3456789099990",
"install-dir": "sp_install_dir_default",
"mod-location": "sp_install_dir_default",
"snapshot-location": "snaps",

View File

@@ -20,7 +20,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
@test "connect to cloud workspace - passing the cloud-token arg and the workspace name to workspace-database arg" {
# run steampipe query and fetch an account from the cloud workspace
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --cloud-token $SPIPETOOLS_TOKEN --workspace-database spipetools/toolstest --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --pipes-token $SPIPETOOLS_TOKEN --workspace-database spipetools/toolstest --output json
echo $output
# fetch the value of account_alias to compare
@@ -33,7 +33,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
@test "connect to cloud workspace - passing the cloud-host arg, the cloud-token arg and the workspace name to workspace-database arg" {
# run steampipe query and fetch an account from the cloud workspace
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --cloud-host "pipes.turbot.com" --cloud-token $SPIPETOOLS_TOKEN --workspace-database spipetools/toolstest --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --pipes-host "pipes.turbot.com" --pipes-token $SPIPETOOLS_TOKEN --workspace-database spipetools/toolstest --output json
echo $output
# fetch the value of account_alias to compare

View File

@@ -1,13 +1,6 @@
load "$LIB_BATS_ASSERT/load.bash"
load "$LIB_BATS_SUPPORT/load.bash"
@test "steampipe plugin help is displayed when no sub command given" {
steampipe plugin > test.txt
assert_equal "$(cat test.txt)" "$(cat $TEST_DATA_DIR/expected_plugin_help_output.txt)"
rm -f test.txt*
}
@test "plugin install" {
run steampipe plugin install net
assert_success

View File

@@ -1,13 +1,6 @@
load "$LIB_BATS_ASSERT/load.bash"
load "$LIB_BATS_SUPPORT/load.bash"
@test "steampipe service help is displayed when no sub command given" {
steampipe service > test.txt
assert_equal "$(cat test.txt)" "$(cat $TEST_DATA_DIR/expected_service_help_output.txt)"
rm -f test.txt*
}
@test "steampipe service start" {
run steampipe service start
assert_success