Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

### Breaking:

- breaking(ai-runtime-control): `key create` no longer accepts the `--user-id` flag, as it was removed from the API ([#1949](https://github.com/fastly/cli/pull/1949))
- breaking(json): `--json` output for `ai-runtime-control usage-metrics list`, `ngwaf workspace list`, `ngwaf rule list` and `ngwaf workspace rule list` is now a bare array instead of an object with `data` and `meta` ([#1949](https://github.com/fastly/cli/pull/1949))

### Bug Fixes:

- fix(ai-runtime-control): update AI Runtime Control command descriptions to reflect the latest API references ([#1939](https://github.com/fastly/cli/pull/1939))

### Enhancements:

### Dependencies:
- build(deps): `github.com/fastly/go-fastly` from v17.8.0 to v18.0.0 ([#1949](https://github.com/fastly/cli/pull/1949))
- build(deps): `golang.org/x/term` from 0.46.0 to 0.47.0 ([#1944](https://github.com/fastly/cli/pull/1944))
- build(deps): `golang.org/x/crypto` from 0.57.0 to 0.58.0 ([#1944](https://github.com/fastly/cli/pull/1944))
- build(deps): `golang.org/x/mod` from 0.41.0 to 0.42.0 ([#1944](https://github.com/fastly/cli/pull/1944))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ require (
require (
4d63.com/optional v0.2.0
github.com/creack/pty v1.1.24
github.com/fastly/go-fastly/v17 v17.8.0
github.com/fastly/go-fastly/v18 v18.0.0
github.com/mholt/archives v0.1.5
github.com/mitchellh/go-ps v1.0.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj6
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 h1:aYo8nnk3ojoQkP5iErif5Xxv0Mo0Ga/FR5+ffl/7+Nk=
github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc=
github.com/fastly/go-fastly/v17 v17.8.0 h1:KvwZDd+Pgf2JGCt7BtYzRJkUdlOSrHbCbcZIZoO1Ttg=
github.com/fastly/go-fastly/v17 v17.8.0/go.mod h1:ffln+YL+0T4nGgJG6wVhzi/z9O5TxI6tTDRwN0rDZc8=
github.com/fastly/go-fastly/v18 v18.0.0 h1:M0EYF2yjLQevJIIIYqOx6zGSVZT8C6O3STShJ1Hz1Hw=
github.com/fastly/go-fastly/v18 v18.0.0/go.mod h1:xjf9UnxLNKSGA92dVlR9fH+2fUt0QBv61dPr0kwFwyw=
github.com/fastly/kingpin v2.1.12-0.20191105091915-95d230a53780+incompatible h1:FhrXlfhgGCS+uc6YwyiFUt04alnjpoX7vgDKJxS6Qbk=
github.com/fastly/kingpin v2.1.12-0.20191105091915-95d230a53780+incompatible/go.mod h1:U8UynVoU1SQaqD2I4ZqgYd5lx3A1ipQYn4aSt2Y5h6c=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/ed25519"
"net/http"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"
)

// HTTPClient models a concrete http.Client. It's a consumer contract for some
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/hashicorp/cap/oidc"
"github.com/skratchdot/open-golang/open"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"

"github.com/fastly/kingpin"

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"

"github.com/fastly/cli/pkg/app"
"github.com/fastly/cli/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/argparser/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"

"github.com/fastly/kingpin"

Expand Down
2 changes: 1 addition & 1 deletion pkg/argparser/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strconv"
"strings"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"

"github.com/fastly/kingpin"

Expand Down
2 changes: 1 addition & 1 deletion pkg/argparser/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v18/fastly"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/manifest"
Expand Down
7 changes: 2 additions & 5 deletions pkg/commands/airuntimecontrol/key/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"time"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand All @@ -24,7 +24,6 @@ type CreateCommand struct {
name string
model string
provider string
userID string

// Optional.
expiresAt time.Time
Expand All @@ -43,7 +42,6 @@ func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateComman
c.CmdClause.Flag("name", "Human-readable name for the virtual key").Required().StringVar(&c.name)
c.CmdClause.Flag("model", "AI model identifier (e.g. \"claude-sonnet-4-20250514\")").Required().StringVar(&c.model)
c.CmdClause.Flag("provider", "AI model provider name (e.g. \"Anthropic\")").Required().StringVar(&c.provider)
c.CmdClause.Flag("user-id", "ID of the user creating the key").Required().StringVar(&c.userID)

// Optional.
c.CmdClause.Flag("expires-at", "Expiration timestamp (RFC 3339 format)").HintOptions("2026-07-28T19:24:50+00:00").TimeVar(time.RFC3339, &c.expiresAt)
Expand All @@ -62,7 +60,6 @@ func (c *CreateCommand) Exec(_ io.Reader, out io.Writer) error {
Name: &c.name,
Model: &c.model,
Provider: &c.provider,
UserID: &c.userID,
}
if !c.expiresAt.IsZero() {
input.ExpiresAt = &c.expiresAt
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/key/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/key/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
10 changes: 5 additions & 5 deletions pkg/commands/airuntimecontrol/key/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
sub "github.com/fastly/cli/pkg/commands/airuntimecontrol/key"
fstfmt "github.com/fastly/cli/pkg/fmt"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"
)

const (
Expand Down Expand Up @@ -44,17 +44,17 @@ func TestKeyCreate(t *testing.T) {
scenarios := []testutil.CLIScenario{
{
Name: "validate missing --name flag",
Args: fmt.Sprintf("--model %s --provider %s --user-id %s", model, provider, userID),
Args: fmt.Sprintf("--model %s --provider %s", model, provider),
WantError: "error parsing arguments: required flag --name not provided",
},
{
Name: "validate missing --model flag",
Args: fmt.Sprintf("--name %s --provider %s --user-id %s", virtualKey, provider, userID),
Args: fmt.Sprintf("--name %s --provider %s", virtualKey, provider),
WantError: "error parsing arguments: required flag --model not provided",
},
{
Name: "validate API success",
Args: fmt.Sprintf("--name %s --model %s --provider %s --user-id %s", virtualKey, model, provider, userID),
Args: fmt.Sprintf("--name %s --model %s --provider %s", virtualKey, model, provider),
Client: &http.Client{
Transport: &testutil.MockRoundTripper{
Response: &http.Response{
Expand All @@ -68,7 +68,7 @@ func TestKeyCreate(t *testing.T) {
},
{
Name: "validate optional --json flag",
Args: fmt.Sprintf("--name %s --model %s --provider %s --user-id %s --json", virtualKey, model, provider, userID),
Args: fmt.Sprintf("--name %s --model %s --provider %s --json", virtualKey, model, provider),
Client: &http.Client{
Transport: &testutil.MockRoundTripper{
Response: &http.Response{
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/key/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/key/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"time"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/key/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"time"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/key"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/key"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/provider/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/provider"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/provider"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/provider/listmodels.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/provider"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/provider"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/airuntimecontrol/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
sub "github.com/fastly/cli/pkg/commands/airuntimecontrol/provider"
fstfmt "github.com/fastly/cli/pkg/fmt"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/provider"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/provider"
)

func TestProviderList(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/providerconnection/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/fastly/kingpin"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/providerconnection/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/providerconnection/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/providerconnection/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
sub "github.com/fastly/cli/pkg/commands/airuntimecontrol/providerconnection"
fstfmt "github.com/fastly/cli/pkg/fmt"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/providerconnection/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/fastly/kingpin"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/providerconnection"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/providerconnection"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/session/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"time"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/session"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/session"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/airuntimecontrol/session/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
sub "github.com/fastly/cli/pkg/commands/airuntimecontrol/session"
fstfmt "github.com/fastly/cli/pkg/fmt"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/session"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/session"
)

func TestSessionList(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/airuntimecontrol/usagemetrics/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/usagemetrics"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/usagemetrics"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/airuntimecontrol/usagemetrics/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package usagemetrics
import (
"time"

"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/usagemetrics"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/usagemetrics"

"github.com/fastly/cli/pkg/argparser"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/airuntimecontrol/usagemetrics/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"errors"
"io"

"github.com/fastly/go-fastly/v17/fastly"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/usagemetrics"
"github.com/fastly/go-fastly/v18/fastly"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/usagemetrics"

"github.com/fastly/cli/pkg/argparser"
fsterr "github.com/fastly/cli/pkg/errors"
Expand Down Expand Up @@ -61,6 +61,6 @@ func (c *ListCommand) Exec(_ io.Reader, out io.Writer) error {
return err
}

text.PrintUsageMetricsTbl(out, data.Data)
text.PrintUsageMetricsTbl(out, data)
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
sub "github.com/fastly/cli/pkg/commands/airuntimecontrol/usagemetrics"
fstfmt "github.com/fastly/cli/pkg/fmt"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/go-fastly/v17/fastly/airuntimecontrol/v1/usagemetrics"
"github.com/fastly/go-fastly/v18/fastly/airuntimecontrol/v1/usagemetrics"
)

func TestUsageMetricsList(t *testing.T) {
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestUsageMetricsList(t *testing.T) {
},
},
},
WantOutput: fstfmt.EncodeJSON(metrics),
WantOutput: fstfmt.EncodeJSON(metrics.Data),
},
}

Expand Down
Loading
Loading