Skip to content
Snippets Groups Projects
Unverified Commit fea8bd51 authored by Stephen J Day's avatar Stephen J Day Committed by GitHub
Browse files

Merge pull request #2471 from GarageDeveloper/master

fixes #2249: sanitize tenant and tenantid
parents 85b4d46b 8777e97b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -142,6 +142,19 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
InsecureSkipVerify: false,
}
 
// Sanitize some entries before trying to decode parameters with mapstructure
// TenantID and Tenant when integers only and passed as ENV variables
// are considered as integer and not string. The parser fails in this
// case.
_, ok := parameters["tenant"]
if ok {
parameters["tenant"] = fmt.Sprint(parameters["tenant"])
}
_, ok = parameters["tenantid"]
if ok {
parameters["tenantid"] = fmt.Sprint(parameters["tenantid"])
}
if err := mapstructure.Decode(parameters, &params); err != nil {
return nil, err
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment