Skip to content

Commit

Permalink
Fix lint issues and update documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pwall@vmware.com>
  • Loading branch information
Pete Wall committed Jul 20, 2022
1 parent a3d143d commit 89ca73f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
9 changes: 6 additions & 3 deletions docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion internal/csp/token_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package pkg_test

import (
"errors"
"github.com/vmware-labs/marketplace-cli/v2/test"
"net/http"
"time"

Expand All @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion test/external/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package external_test

import (
"fmt"

. "github.com/bunniesandbeatings/goerkin"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -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")
Expand Down

0 comments on commit 89ca73f

Please sign in to comment.