mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +00:00
fix(crypto): allow parsing of cost int from env string (#7061)
fic(crypto): allow parsing of cost int from env string
This commit is contained in:
@@ -145,11 +145,15 @@ func (c *HasherConfig) buildHasher() (hasher passwap.Hasher, prefixes []string,
|
||||
}
|
||||
}
|
||||
|
||||
// decodeParams uses a mapstructure decoder from the Params map to dst.
|
||||
// The decoder fails when there are unused fields in dst.
|
||||
// It uses weak input typing, to allow conversion of env strings to ints.
|
||||
func (c *HasherConfig) decodeParams(dst any) error {
|
||||
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
|
||||
ErrorUnused: false,
|
||||
ErrorUnset: true,
|
||||
Result: dst,
|
||||
ErrorUnused: false,
|
||||
ErrorUnset: true,
|
||||
WeaklyTypedInput: true,
|
||||
Result: dst,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user