Skip to content

Commit

Permalink
Use macaroon bakery v3 and other upstream libs to ensure compatibilit…
Browse files Browse the repository at this point in the history
…y with juju/mgo/v2
  • Loading branch information
wallyworld committed Mar 2, 2021
1 parent 31b06ac commit af6d070
Show file tree
Hide file tree
Showing 107 changed files with 182 additions and 172 deletions.
4 changes: 2 additions & 2 deletions api/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"sync/atomic"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/gorilla/websocket"
"github.com/juju/clock"
"github.com/juju/errors"
Expand All @@ -28,8 +30,6 @@ import (
"github.com/juju/utils"
"github.com/juju/utils/parallel"
"github.com/juju/version"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"
"gopkg.in/retry.v1"

Expand Down
2 changes: 1 addition & 1 deletion api/applicationoffers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package applicationoffers

import (
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/charm/v7"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/bakery"

"github.com/juju/juju/api/base"
"github.com/juju/juju/apiserver/params"
Expand Down
4 changes: 2 additions & 2 deletions api/authentication/interactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"net/http"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery/form"
"github.com/juju/errors"
"gopkg.in/httprequest.v1"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon-bakery.v2/httpbakery/form"
)

const authMethod = "juju_userpass"
Expand Down
4 changes: 2 additions & 2 deletions api/authentication/interactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"net/http/httptest"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery/form"
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/httprequest.v1"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon-bakery.v2/httpbakery/form"

"github.com/juju/juju/api/authentication"
)
Expand Down
2 changes: 1 addition & 1 deletion api/base/caller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"net/http"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/names/v4"
"gopkg.in/httprequest.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion api/crossmodelrelations/crossmodelrelations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package crossmodelrelations

import (
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api/base"
Expand Down
2 changes: 1 addition & 1 deletion api/crossmodelrelations/crossmodelrelations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"fmt"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/clock"
"github.com/juju/errors"
jujutesting "github.com/juju/testing"
jc "github.com/juju/testing/checkers"
"github.com/juju/worker/v2/workertest"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api/base"
Expand Down
2 changes: 1 addition & 1 deletion api/crossmodelrelations/macarooncache.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sync"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/clock"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/charmstore"
Expand Down
2 changes: 1 addition & 1 deletion api/crossmodelrelations/macarooncache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/macaroon.v2"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/juju/api/crossmodelrelations"
apitesting "github.com/juju/juju/api/testing"
coretesting "github.com/juju/juju/testing"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
)

const longerThanExpiryTime = 11 * time.Minute
Expand Down
2 changes: 1 addition & 1 deletion api/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"context"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api/base"
Expand Down
4 changes: 2 additions & 2 deletions api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"net/http"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
"gopkg.in/httprequest.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/params"
Expand Down
2 changes: 1 addition & 1 deletion api/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"net/http/httptest"
"reflect"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/httprequest.v1"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api"
Expand Down
2 changes: 1 addition & 1 deletion api/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"net/url"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/clock"
"github.com/juju/collections/set"
"github.com/juju/errors"
"github.com/juju/names/v4"
"github.com/juju/version"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api/base"
Expand Down
4 changes: 2 additions & 2 deletions api/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"runtime/debug"
"strconv"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
"github.com/juju/featureflag"
"github.com/juju/names/v4"
"github.com/juju/utils"
"github.com/juju/version"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api/base"
Expand Down
2 changes: 1 addition & 1 deletion api/state_macaroon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"net/http"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api"
Expand Down
6 changes: 3 additions & 3 deletions api/testing/macaroonsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"net/http/cookiejar"
"net/url"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakerytest"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/errors"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon-bakery.v2/bakerytest"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api"
Expand Down
4 changes: 2 additions & 2 deletions api/watcher/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"context"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
"github.com/juju/worker/v2"
"github.com/juju/worker/v2/workertest"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/api"
Expand Down
4 changes: 2 additions & 2 deletions apiserver/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
"strconv"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/collections/set"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/httpbakery"

"github.com/juju/juju/api"
apimachiner "github.com/juju/juju/api/machiner"
Expand Down
8 changes: 4 additions & 4 deletions apiserver/authentication/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"net/http"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/identchecker"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon-bakery.v2/bakery/identchecker"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/common"
Expand Down
10 changes: 5 additions & 5 deletions apiserver/authentication/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import (
"context"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/identchecker"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakerytest"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/clock/testclock"
"github.com/juju/errors"
"github.com/juju/names/v4"
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon-bakery.v2/bakery/identchecker"
"gopkg.in/macaroon-bakery.v2/bakerytest"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/authentication"
Expand Down
4 changes: 2 additions & 2 deletions apiserver/bakeryutil/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"time"

"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/authentication"
Expand Down
4 changes: 2 additions & 2 deletions apiserver/common/crossmodel/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"context"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon.v2"
"gopkg.in/yaml.v2"

Expand Down
4 changes: 2 additions & 2 deletions apiserver/common/crossmodel/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"strings"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/clock/testclock"
"github.com/juju/errors"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/authentication"
Expand Down
4 changes: 2 additions & 2 deletions apiserver/common/crossmodel/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"context"
"time"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery/checkers"
"github.com/juju/errors"
"github.com/juju/names/v4"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/authentication"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/common/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"net/http"
"strings"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/errors"
"github.com/juju/names/v4"
"github.com/juju/txn"
"gopkg.in/macaroon-bakery.v2/bakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/params"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/client/application/charmstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"os"
"strings"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/httpbakery"
"github.com/juju/charm/v7"
"github.com/juju/charmrepo/v5"
"github.com/juju/charmrepo/v5/csclient"
csparams "github.com/juju/charmrepo/v5/csclient/params"
"github.com/juju/errors"
"github.com/juju/utils"
"github.com/juju/version"
"gopkg.in/macaroon-bakery.v2/httpbakery"
"gopkg.in/macaroon.v2"

"github.com/juju/juju/apiserver/params"
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/client/applicationoffers/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ package applicationoffers_test
import (
"regexp"

"github.com/go-macaroon-bakery/macaroon-bakery/v3/bakery"
"github.com/juju/errors"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/macaroon-bakery.v2/bakery"

"github.com/juju/juju/apiserver/common"
"github.com/juju/juju/apiserver/common/crossmodel"
Expand Down
Loading

0 comments on commit af6d070

Please sign in to comment.