Files
threshold/internal/auth/password/query.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
1.4 KiB
Go

package password
const (
authenticateQuery = `
select acct.name, -- Account.Name
acct.description, -- Account.Description
acct.user_name, -- Account.UserName
acct.public_id, -- Account.PublicId
acct.auth_method_id, -- Account.AuthMethodId
acct.scope_id, -- Account.ScopeId
acct.create_time, -- Account.CreateTime
acct.update_time, -- Account.UpdateTime
cred.private_id as credential_id, -- Account.CredentialId
cred.password_conf_id, -- Argon2Credential.PasswordConfId
cred.salt, -- Argon2Credential.CtSalt/Salt
cred.derived_key, -- Argon2Credential.DerivedKey
conf.key_length, -- Argon2Configuration.KeyLength
conf.iterations, -- Argon2Configuration.Iterations
conf.memory, -- Argon2Configuration.Memory
conf.threads -- Argon2Configuration.Threads
from auth_password_argon2_cred cred,
auth_password_argon2_conf conf,
auth_password_account acct
where acct.auth_method_id = $1
and acct.user_name = $2
and cred.password_conf_id = conf.private_id
and cred.password_account_id = acct.public_id;
`
)