Skip to content

Commit

Permalink
[VAULT-3008] Update RabbitMQ dependency and fix regression in UserInf…
Browse files Browse the repository at this point in the history
…o.Tags in v3.9 (hashicorp#12877)
  • Loading branch information
vinay-gopalan authored and Artem Alexandrov committed Feb 4, 2022
1 parent 7ba02a6 commit 46b4b60
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion builtin/logical/rabbitmq/backend.go
Expand Up @@ -8,7 +8,7 @@ import (
cleanhttp "github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
rabbithole "github.com/michaelklishin/rabbit-hole"
rabbithole "github.com/michaelklishin/rabbit-hole/v2"
)

// Factory creates and configures the backend
Expand Down
4 changes: 2 additions & 2 deletions builtin/logical/rabbitmq/backend_test.go
Expand Up @@ -12,7 +12,7 @@ import (
logicaltest "github.com/hashicorp/vault/helper/testhelpers/logical"
"github.com/hashicorp/vault/sdk/helper/jsonutil"
"github.com/hashicorp/vault/sdk/logical"
rabbithole "github.com/michaelklishin/rabbit-hole"
rabbithole "github.com/michaelklishin/rabbit-hole/v2"
"github.com/mitchellh/mapstructure"
)

Expand All @@ -37,7 +37,7 @@ func prepareRabbitMQTestContainer(t *testing.T) (func(), string) {

runner, err := docker.NewServiceRunner(docker.RunOptions{
ImageRepo: "rabbitmq",
ImageTag: "3.8-management",
ImageTag: "3-management",
ContainerName: "rabbitmq",
Ports: []string{"15672/tcp"},
})
Expand Down
2 changes: 1 addition & 1 deletion builtin/logical/rabbitmq/path_config_connection.go
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/template"
"github.com/hashicorp/vault/sdk/logical"
rabbithole "github.com/michaelklishin/rabbit-hole"
rabbithole "github.com/michaelklishin/rabbit-hole/v2"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions builtin/logical/rabbitmq/path_role_create.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/template"
"github.com/hashicorp/vault/sdk/logical"
rabbithole "github.com/michaelklishin/rabbit-hole"
rabbithole "github.com/michaelklishin/rabbit-hole/v2"
)

const (
Expand Down Expand Up @@ -93,7 +93,7 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
// Register the generated credentials in the backend, with the RabbitMQ server
resp, err := client.PutUser(username, rabbithole.UserSettings{
Password: password,
Tags: role.Tags,
Tags: []string{role.Tags},
})
if err != nil {
return nil, fmt.Errorf("failed to create a new user with the generated credentials")
Expand Down
3 changes: 3 additions & 0 deletions changelog/12877.txt
@@ -0,0 +1,3 @@
```release-note:improvement
secrets/rabbitmq: Update dependency github.com/michaelklishin/rabbit-hole to v2 and resolve UserInfo.tags regression from RabbitMQ v3.9
```
3 changes: 1 addition & 2 deletions go.mod
Expand Up @@ -132,7 +132,7 @@ require (
github.com/lib/pq v1.10.3
github.com/mattn/go-colorable v0.1.11
github.com/mholt/archiver v3.1.1+incompatible
github.com/michaelklishin/rabbit-hole v0.0.0-20191008194146-93d9988f0cd5
github.com/michaelklishin/rabbit-hole/v2 v2.11.0
github.com/miekg/dns v1.1.40 // indirect
github.com/mitchellh/cli v1.1.2
github.com/mitchellh/copystructure v1.0.0
Expand Down Expand Up @@ -167,7 +167,6 @@ require (
github.com/sethvargo/go-limiter v0.7.1
github.com/shirou/gopsutil v3.21.5+incompatible
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 // indirect
github.com/stretchr/testify v1.7.0
github.com/tidwall/pretty v1.0.1 // indirect
github.com/tklauser/go-sysconf v0.3.6 // indirect
Expand Down
47 changes: 28 additions & 19 deletions go.sum

Large diffs are not rendered by default.

0 comments on commit 46b4b60

Please sign in to comment.