open-vault/builtin/logical/rabbitmq/passwords.go
Michael Golowka a89f09802d
Integrate password policies into RabbitMQ secret engine (#9143)
* Add password policies to RabbitMQ & update docs
* Also updates some parts of the password policies to aid/fix testing
2020-06-11 16:08:20 -06:00

15 lines
314 B
Go

package rabbitmq
import (
"context"
"github.com/hashicorp/vault/sdk/helper/base62"
)
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)
}