* Bump generated proto code * Add argon2 conf sql and proto files * Add generated code for argon2 conf * Add Resources for Argon2 configuration * Add get and set Configuration to repository * Add current config reference to AuthMethod * Fix authmethod_test * Fix TestAccount_New * Add WithConfiguration to options * Add sql views for current configuration * Fix SetTableName * Remove duplicate testAccounts function * Make tests clearer * Fix comment * Rename test variable * Use NewPrivateId function for private Ids * Refactor: rename public_id to private_id for password_conf and password_credential * Remove bad comment * Check if embedded argon2 configuration is nil * Add checks around the WithConfiguration option * Use spaces not tabs in proto file * Add doc to explain choice of oplog ticket * Verify oplog in test
21 lines
415 B
Go
21 lines
415 B
Go
package password
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/watchtower/internal/db"
|
|
)
|
|
|
|
// Prefixes for private ids for types in the password package.
|
|
const (
|
|
argon2ConfigurationPrefix = "arg2conf"
|
|
)
|
|
|
|
func newArgon2ConfigurationId() (string, error) {
|
|
id, err := db.NewPrivateId(argon2ConfigurationPrefix)
|
|
if err != nil {
|
|
return "", fmt.Errorf("new password argon2 configuration id: %w", err)
|
|
}
|
|
return id, err
|
|
}
|