* Implement ChangePassword * Refactor: extract authenticate method * Update tests to verify oplog entries * More refactoring * Remove extraneous clones * More refactoring
34 lines
1.6 KiB
Go
34 lines
1.6 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.private_id, -- Argon2Credential.PrivateId
|
|
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
|
|
meth.password_conf_id = cred.password_conf_id as is_current_conf
|
|
from auth_password_argon2_cred cred,
|
|
auth_password_argon2_conf conf,
|
|
auth_password_account acct,
|
|
auth_password_method meth
|
|
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
|
|
and acct.auth_method_id = meth.public_id ;
|
|
`
|
|
)
|