srinandan/apigeecli

Creating an API Product with just the proxy should not be allowed.

Opened this issue · 2 comments

The request should require the use of --opgrp operations.json or --gqlopgrp gql-operations.json.

Otherwise it creates a product that can be used anywhere.

apigeecli -t $TOKEN -o $ORG products create --name example-v1-$ENV \
	--envs $ENV --proxies product-recommendations-v1 --approval auto
{
	"name": "example-v1-test-1",
	"approvalType": "auto",
	"environments": [
		"test-1"
	],
	"createdAt": "1636050369457",
	"lastModifiedAt": "1636050369457"
}

The original intent of the command was to support the legacy model of creating products. For the command you entered, I expected to see the proxies list.

NOTE: A product with not proxies or operations does not give access to any API.

I just looked at the command, to add proxies (legacy model), you must set the legacy flag also.

Create an API product

Usage:
  apigeecli products create [flags]

Flags:
...
  -l, --legacy                 Legacy product object
...