Skip to content

Commit

Permalink
Bump github.com/michaelklishin/rabbit-hole/v2 from 2.6.0 to 2.7.0 (#90)
Browse files Browse the repository at this point in the history
* Bump github.com/michaelklishin/rabbit-hole/v2 from 2.6.0 to 2.7.0

Bumps [github.com/michaelklishin/rabbit-hole/v2](https://github.com/michaelklishin/rabbit-hole) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/michaelklishin/rabbit-hole/releases)
- [Changelog](https://github.com/michaelklishin/rabbit-hole/blob/master/ChangeLog.md)
- [Commits](michaelklishin/rabbit-hole@v2.6.0...v2.7.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Update RabbitHoleClientFactory interface to match rabbithole changes.

* go mod tidy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mirah Gary <mgary@vmware.com>
Co-authored-by: Chunyi Lyu <clyu@pivotal.io>
  • Loading branch information
3 people committed Apr 6, 2021
1 parent bf3f678 commit 81d3fb1
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -6,7 +6,7 @@ require (
github.com/elastic/crd-ref-docs v0.0.7
github.com/go-logr/logr v0.4.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0
github.com/michaelklishin/rabbit-hole/v2 v2.6.0
github.com/michaelklishin/rabbit-hole/v2 v2.7.0
github.com/onsi/ginkgo v1.16.0
github.com/onsi/gomega v1.11.0
github.com/rabbitmq/cluster-operator v1.5.0
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -497,8 +497,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 h1:8E6DrFvII6QR4eJ3PkFvV+lc03P+2qwqTPLm1ax7694=
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0/go.mod h1:fcEyUyXZXoV4Abw8DX0t7wyL8mCDxXyU4iAFZfT3IHw=
github.com/michaelklishin/rabbit-hole/v2 v2.6.0 h1:oMLErqUVIYpXClYujgkCXtJNLswnth0LlJ8G3lKPF30=
github.com/michaelklishin/rabbit-hole/v2 v2.6.0/go.mod h1:VZQTDutXFmoyrLvlRjM79MEPb0+xCLLhV5yBTjwMWkM=
github.com/michaelklishin/rabbit-hole/v2 v2.7.0 h1:y+M7/XG4KYGku90mjBP3RdvNbnlM7US2fEHlMogFUJY=
github.com/michaelklishin/rabbit-hole/v2 v2.7.0/go.mod h1:VZQTDutXFmoyrLvlRjM79MEPb0+xCLLhV5yBTjwMWkM=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
Expand Down
18 changes: 10 additions & 8 deletions internal/internalfakes/fake_rabbit_mqclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/rabbitmq_client_factory.go
Expand Up @@ -38,7 +38,7 @@ type RabbitMQClient interface {
PutPolicy(string, string, rabbithole.Policy) (*http.Response, error)
DeletePolicy(string, string) (*http.Response, error)
DeclareQueue(string, string, rabbithole.QueueSettings) (*http.Response, error)
DeleteQueue(string, string) (*http.Response, error)
DeleteQueue(string, string, ...rabbithole.QueueDeleteOptions) (*http.Response, error)
DeclareExchange(string, string, rabbithole.ExchangeSettings) (*http.Response, error)
DeleteExchange(string, string) (*http.Response, error)
PutVhost(string, rabbithole.VhostSettings) (*http.Response, error)
Expand Down
3 changes: 1 addition & 2 deletions internal/user_settings.go
Expand Up @@ -11,7 +11,6 @@ package internal

import (
"fmt"
"strings"

rabbithole "github.com/michaelklishin/rabbit-hole/v2"
topology "github.com/rabbitmq/messaging-topology-operator/api/v1alpha2"
Expand All @@ -35,7 +34,7 @@ func GenerateUserSettings(credentials *corev1.Secret, tags []topology.UserTag) (

return rabbithole.UserSettings{
Name: string(username),
Tags: strings.Join(userTagStrings, ","),
Tags: userTagStrings,
// To avoid sending raw passwords over the wire, compute a password hash using a random salt
// and use this in the UserSettings instead.
// For more information on this hashing algorithm, see
Expand Down
3 changes: 1 addition & 2 deletions internal/user_settings_test.go
Expand Up @@ -3,7 +3,6 @@ package internal_test
import (
"crypto/sha512"
"encoding/base64"
"strings"

rabbithole "github.com/michaelklishin/rabbit-hole/v2"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -32,7 +31,7 @@ var _ = Describe("GenerateUserSettings", func() {
settings, err := internal.GenerateUserSettings(&credentialSecret, userTags)
Expect(err).NotTo(HaveOccurred())
Expect(settings.Name).To(Equal("my-rabbit-user"))
Expect(strings.Split(settings.Tags, ",")).To(ConsistOf("administrator", "monitoring"))
Expect(settings.Tags).To(ConsistOf("administrator", "monitoring"))
Expect(settings.HashingAlgorithm.String()).To(Equal(rabbithole.HashingAlgorithmSHA512.String()))

// The first 4 bytes of the PasswordHash will be the salt used in the hashing algorithm.
Expand Down
2 changes: 1 addition & 1 deletion system_tests/user_system_test.go
Expand Up @@ -70,7 +70,7 @@ var _ = Describe("Users", func() {

Expect(*userInfo).To(MatchFields(IgnoreExtras, Fields{
"Name": Equal(rawUsername),
"Tags": Equal("policymaker,management"),
"Tags": ConsistOf("policymaker", "management"),
"HashingAlgorithm": Equal(rabbithole.HashingAlgorithmSHA512),
}))
Expect(userInfo.PasswordHash).NotTo(BeEmpty())
Expand Down

0 comments on commit 81d3fb1

Please sign in to comment.