mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
The production password hasher uses PBKDF2 with 600,000 iterations, which is slow especially when combined with race detection. This adds a fast test hasher (work factor 1) that can be used during tests to speed up user creation. The fast hasher is only available in non-production builds via build tags, ensuring it cannot be used in production.
12 lines
317 B
Go
12 lines
317 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
//go:build !production
|
|
|
|
package testlib
|
|
|
|
import "github.com/mattermost/mattermost/server/v8/channels/app/password/hashers"
|
|
|
|
func setupFastTestHasher() {
|
|
hashers.SetTestHasher(hashers.FastTestHasher())
|
|
}
|