diff --git a/README.md b/README.md index cc7e3e9..2026e17 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ enabling users to view, get, and manage their Marketplace entries. If you would like to build and contribute to this project, please fork and make pull requests. -If you are internal to VMware, and you would like to run commands against the [Marketplace staging service](https://stg.market.csp.vmware.com/), set this environment variable: +If you are internal to VMware, and you would like to run commands against the [Marketplace staging service](https://stg.market.csp.vmware.com/), ensure your CSP API token [has access](docs/Authentication.md) to the Staging Marketplace and then set this environment variable: ``` export MARKETPLACE_ENV=staging ``` diff --git a/docs/Authentication.md b/docs/Authentication.md index 2590921..a01ea8b 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -11,9 +11,12 @@ To generate a new API Token: 3. Set the token's name 4. Set the token's expiration 5. Add the "VMware Marketplace" service role -6. No organization role is required -7. Click Generate -8. Record the token somewhere (preferably a secure secret store) + + If your org has access to the Staging Marketplace, add the "Cloud Stage Marketplace" service role + +7. No organization role is required +8. Click Generate +9. Record the token somewhere (preferably a secure secret store) ## Using the token diff --git a/internal/csp/token_services_test.go b/internal/csp/token_services_test.go index 6ae36ac..b11da57 100644 --- a/internal/csp/token_services_test.go +++ b/internal/csp/token_services_test.go @@ -5,12 +5,13 @@ package csp_test import ( "errors" + "net/http" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/vmware-labs/marketplace-cli/v2/internal/csp" "github.com/vmware-labs/marketplace-cli/v2/pkg/pkgfakes" "github.com/vmware-labs/marketplace-cli/v2/test" - "net/http" ) var _ = Describe("CSP Token Services", func() { diff --git a/pkg/upload_test.go b/pkg/upload_test.go index dc0c5da..f7e4c13 100644 --- a/pkg/upload_test.go +++ b/pkg/upload_test.go @@ -5,7 +5,6 @@ package pkg_test import ( "errors" - "github.com/vmware-labs/marketplace-cli/v2/test" "net/http" "time" @@ -15,6 +14,7 @@ import ( "github.com/vmware-labs/marketplace-cli/v2/internal/internalfakes" "github.com/vmware-labs/marketplace-cli/v2/pkg" "github.com/vmware-labs/marketplace-cli/v2/pkg/pkgfakes" + "github.com/vmware-labs/marketplace-cli/v2/test" ) var _ = Describe("Upload", func() { diff --git a/test/external/authentication_test.go b/test/external/authentication_test.go index efeb7d1..f26b7d7 100644 --- a/test/external/authentication_test.go +++ b/test/external/authentication_test.go @@ -5,6 +5,7 @@ package external_test import ( "fmt" + . "github.com/bunniesandbeatings/goerkin" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -15,7 +16,7 @@ import ( var _ = Describe("authentication", func() { steps := NewSteps() - Scenario("Exprired token", func() { + Scenario("Expired token", func() { steps.Given("targeting the production environment") steps.When(fmt.Sprintf("running mkpcli --csp-api-token %s auth", "M_sfojHArrjx90lxUCmID2qhZw-I0WGlW5fThBuiQXwVtvy7UJq6XeKtAKzf8cFm")) steps.Then("the command exits with an error")