Add configuration settings for Argon2 password KDF (#217)

* 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
This commit is contained in:
Michael Gaffney authored and GitHub committed 2020-07-29 07:58:19 -04:00
1 parent c3c07f1556
commit c163d790a4
23 files changed
+1613 -64

No files matched your search

@@ -96,6 +96,30 @@ func TestRepository_CreateAuthMethod(t *testing.T) {
},
},
},
{
name: "invalid-with-config-nil-embedded-config",
in: &AuthMethod{
AuthMethod: &store.AuthMethod{
ScopeId: org.PublicId,
},
},
opts: []Option{
WithConfiguration(&Argon2Configuration{}),
},
wantIsErr: ErrInvalidConfiguration,
},
{
name: "invalid-with-config-unknown-config-type",
in: &AuthMethod{
AuthMethod: &store.AuthMethod{
ScopeId: org.PublicId,
},
},
opts: []Option{
WithConfiguration(tconf(0)),
},
wantIsErr: ErrUnsupportedConfiguration,
},
}
for _, tt := range tests {