You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In vault system log: interface conversion: interface {} is json.Number, not string
You use StringToSliceHookFunc() in DecodeHook();
if reflect1.Kind != reflect.String || reflect2.Kind != reflect.Slice {return data, nil}
you do it : raw := data.(string)
reflect.ValueOf(json.Number), reflect.Kind() => string, reflect.Type() => json.Number
sdk/framework/field_data.go, maybe remove function mapstructure.StringToSliceHookFunc(",") from DecodeHook
commit: Brian Kassouf, 4 years ago (March 3rd, 2018 2:01 AM) logical/framework: add a field data type for parsing integer arrays, [83a7d20]
The text was updated successfully, but these errors were encountered:
Hello, @Nikita1821 thanks for opening this issue. Could you please let us know what version of Vault (found using vault status) you're experiencing this with?
As @Nikita1821 noted, this occurs due to the type string assertion performed in mapstructure.StringToSliceHookFunc when the input is of type json.Number. A similar issue used to occur with framework.TypeCommaStringSlice. The parsing for that type is handled by ParseCommaStringSlice in github.com/hashicorp/go-secure-stdlib/parseutil. The issue was fixed in #14522. If the type of the input is json.Number then we simply call String(). We can likely add the same conversion for framework.TypeCommaIntSlice.
I use framework.TypeCommaIntSlice for get emloyeeID and add it in group AD in my engine.
Send: curl -X POST -H "X-Vault-Request:..." -H "X-Vault-Token: $(vault print token)" -d '{"param": 213}' http://127.0.0.1:8200/v1/
In vault system log: interface conversion: interface {} is json.Number, not string
You use StringToSliceHookFunc() in DecodeHook();
if reflect1.Kind != reflect.String || reflect2.Kind != reflect.Slice {return data, nil}
you do it : raw := data.(string)
reflect.ValueOf(json.Number), reflect.Kind() => string, reflect.Type() => json.Number
sdk/framework/field_data.go, maybe remove function mapstructure.StringToSliceHookFunc(",") from DecodeHook
commit: Brian Kassouf, 4 years ago (March 3rd, 2018 2:01 AM) logical/framework: add a field data type for parsing integer arrays, [83a7d20]
The text was updated successfully, but these errors were encountered: