Files
threshold/internal/auth/password/private_ids.go
T
Michael GaffneyandTodd Knight 6c679a9939 Add password authentication using Argon2 (#227)
* Add argon2 credentials

* Verify oplog in tests

* Refactor: rename field

* Update internal/auth/password/repository_account.go

Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>

* Add inline comments to SQL query to doc mapping to structure

* Refactor: move authentication query to query.go file

* Replace immutable_create_time_func with immutable_columns

Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
2020-07-31 11:18:41 -04:00

30 lines
666 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"
argon2CredentialPrefix = "arg2cred"
)
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
}
func newArgon2CredentialId() (string, error) {
id, err := db.NewPrivateId(argon2CredentialPrefix)
if err != nil {
return "", fmt.Errorf("new password argon2 configuration id: %w", err)
}
return id, err
}