2023-03-15 16:00:52 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-06-11 22:08:20 +00:00
|
|
|
package rabbitmq
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2021-07-16 00:17:31 +00:00
|
|
|
"github.com/hashicorp/go-secure-stdlib/base62"
|
2020-06-11 22:08:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (b *backend) generatePassword(ctx context.Context, policyName string) (password string, err error) {
|
|
|
|
if policyName != "" {
|
|
|
|
return b.System().GeneratePasswordFromPolicy(ctx, policyName)
|
|
|
|
}
|
|
|
|
return base62.Random(36)
|
|
|
|
}
|