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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/ci/library_owners.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"github.com/mholt/archives": "apix-2",
"github.com/mongodb-forks/digest": "apix-2",
"github.com/mongodb-labs/cobra2snooty": "apix-2",
"github.com/mongodb/atlas-cli-core": "apix-2",
"github.com/Netflix/go-expect": "apix-2",
"github.com/PaesslerAG/jsonpath": "apix-2",
"github.com/pelletier/go-toml": "apix-2",
Expand Down
4 changes: 3 additions & 1 deletion build/package/purls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ pkg:golang/github.com/dsnet/compress@v0.0.2-0.20230904184137-39efe44ab707
pkg:golang/github.com/ebitengine/purego@v0.8.4
pkg:golang/github.com/fatih/color@v1.14.1
pkg:golang/github.com/felixge/httpsnoop@v1.0.4
pkg:golang/github.com/fsnotify/fsnotify@v1.8.0
pkg:golang/github.com/fsnotify/fsnotify@v1.9.0
pkg:golang/github.com/go-logr/logr@v1.4.3
pkg:golang/github.com/go-logr/stdr@v1.2.2
pkg:golang/github.com/go-ole/go-ole@v1.2.6
pkg:golang/github.com/go-viper/mapstructure/v2@v2.3.0
pkg:golang/github.com/godbus/dbus/v5@v5.1.0
pkg:golang/github.com/golang-jwt/jwt/v4@v4.5.2
pkg:golang/github.com/golang-jwt/jwt/v5@v5.3.0
pkg:golang/github.com/golang/snappy@v0.0.4
pkg:golang/github.com/google/go-github/v61@v61.0.0
Expand All @@ -75,6 +76,7 @@ pkg:golang/github.com/mholt/archives@v0.1.3
pkg:golang/github.com/mikelolasagasti/xz@v1.0.1
pkg:golang/github.com/minio/minlz@v1.0.0
pkg:golang/github.com/mongodb-forks/digest@v1.1.0
pkg:golang/github.com/mongodb/atlas-cli-core@v0.0.0-20250818144810-ba7083f4cd0a
pkg:golang/github.com/montanaflynn/stats@v0.7.1
pkg:golang/github.com/nwaples/rardecode/v2@v2.1.0
pkg:golang/github.com/pelletier/go-toml/v2@v2.2.3
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ require (
github.com/klauspost/compress v1.18.0
github.com/mattn/go-isatty v0.0.20
github.com/mholt/archives v0.1.3
github.com/mongodb-forks/digest v1.1.0
github.com/mongodb-labs/cobra2snooty v1.19.1
github.com/mongodb/atlas-cli-core v0.0.0-20250820105017-56202fc11332
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/shirou/gopsutil/v4 v4.25.7
Expand Down Expand Up @@ -63,12 +63,14 @@ require (
github.com/cli/safeexec v1.0.0 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/addlicense v1.1.1 // indirect
github.com/google/go-licenses/v2 v2.0.0-alpha.1 // indirect
github.com/google/licenseclassifier/v2 v2.0.0 // indirect
github.com/icholy/gomajor v0.14.0 // indirect
github.com/mikelolasagasti/xz v1.0.1 // indirect
github.com/mongodb-forks/digest v1.1.0 // indirect
github.com/otiai10/copy v1.10.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down Expand Up @@ -113,7 +115,7 @@ require (
github.com/ebitengine/purego v0.8.4 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/getkin/kin-openapi v0.132.0 h1:3ISeLMsQzcb5v26yeJrBcdTCEQTag36ZjaGk7MIRUwk=
github.com/getkin/kin-openapi v0.132.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
Expand All @@ -174,6 +174,8 @@ github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+d
github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -320,6 +322,8 @@ github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKk
github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/mongodb-labs/cobra2snooty v1.19.1 h1:GDEQZWy8f/DeJlImNgVvStu6sgNi8nuSOR1Oskcw8BI=
github.com/mongodb-labs/cobra2snooty v1.19.1/go.mod h1:Hyq4YadN8dwdOiz56MXwTuVN63p0WlkQwxdLxOSGdX8=
github.com/mongodb/atlas-cli-core v0.0.0-20250820105017-56202fc11332 h1:A+L5wKOeaOjIiUnscUGf6GEZyhRHdLTBVxx9z/FE1Es=
github.com/mongodb/atlas-cli-core v0.0.0-20250820105017-56202fc11332/go.mod h1:rmM8Mi0YA0iuCSJL6jxQqyT/UEwKqv9wQMi+37zQhTM=
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/nwaples/rardecode/v2 v2.1.0 h1:JQl9ZoBPDy+nIZGb1mx8+anfHp/LV3NE2MjMiv0ct/U=
Expand Down
2 changes: 1 addition & 1 deletion internal/api/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"net/http"
"net/http/httputil"

"github.com/mongodb/atlas-cli-core/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/log"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/store"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/transport"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions internal/cli/auth/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"net/http"
"strings"

"github.com/mongodb/atlas-cli-core/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli/require"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/log"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/oauth"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/usage"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version"
"github.com/spf13/cobra"
"go.mongodb.org/atlas-sdk/v20250312006/auth/clientcredentials"
atlas "go.mongodb.org/atlas/mongodbatlas"
Expand Down Expand Up @@ -73,7 +73,7 @@ func (opts *logoutOpts) initFlow(ctx context.Context) error {
var err error
client := http.DefaultClient
client.Transport = transport.Default()
opts.flow, err = oauth.FlowWithConfig(config.Default(), client)
opts.flow, err = transport.FlowWithConfig(config.Default(), client, version.Version)
opts.revokeServiceAccountToken = func() error {
return revokeServiceAccountToken(ctx, opts.config.ClientID(), opts.config.ClientSecret())
}
Expand Down
8 changes: 4 additions & 4 deletions internal/cli/refresher_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"context"
"net/http"

"github.com/mongodb/atlas-cli-core/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/oauth"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version"
atlasauth "go.mongodb.org/atlas/auth"
atlas "go.mongodb.org/atlas/mongodbatlas"
)
Expand All @@ -39,12 +39,12 @@ type Refresher interface {
RegistrationConfig(ctx context.Context) (*atlasauth.RegistrationConfig, *atlas.Response, error)
}

func (opts *RefresherOpts) InitFlow(c oauth.ServiceGetter) func() error {
func (opts *RefresherOpts) InitFlow(c transport.ServiceGetter) func() error {
return func() error {
var err error
client := http.DefaultClient
client.Transport = transport.Default()
opts.flow, err = oauth.FlowWithConfig(c, client)
opts.flow, err = transport.FlowWithConfig(c, client, version.Version)
return err
}
}
Expand Down
63 changes: 0 additions & 63 deletions internal/oauth/oauth.go

This file was deleted.

7 changes: 4 additions & 3 deletions internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"net/http"
"strings"

"github.com/mongodb/atlas-cli-core/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/log"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/transport"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version"
atlasClustersPinned "go.mongodb.org/atlas-sdk/v20240530005/admin"
atlasv2 "go.mongodb.org/atlas-sdk/v20250312006/admin"
atlasauth "go.mongodb.org/atlas/auth"
Expand Down Expand Up @@ -62,7 +63,7 @@ func HTTPClient(c CredentialsGetter, httpTransport http.RoundTripper) (*http.Cli
if err != nil {
return nil, err
}
tr, err := transport.NewAccessTokenTransport(token, httpTransport, func(t *atlasauth.Token) error {
tr, err := transport.NewAccessTokenTransport(token, httpTransport, version.Version, func(t *atlasauth.Token) error {
config.SetAccessToken(t.AccessToken)
config.SetRefreshToken(t.RefreshToken)
return config.Save()
Expand All @@ -72,7 +73,7 @@ func HTTPClient(c CredentialsGetter, httpTransport http.RoundTripper) (*http.Cli
}
return &http.Client{Transport: tr}, nil
case config.ServiceAccount:
return transport.NewServiceAccountClient(c.ClientID(), c.ClientSecret()), nil
return transport.NewServiceAccountClientWithHost(c.ClientID(), c.ClientSecret(), config.OpsManagerURL()), nil
case config.NoAuth:
fallthrough
default:
Expand Down
127 changes: 0 additions & 127 deletions internal/transport/transport.go

This file was deleted.

Loading
Loading