mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed Path sanitization when migrating from user into AttributeProfile
This commit is contained in:
committed by
Dan Christian Bogos
parent
d4db1b13e9
commit
076558469e
@@ -73,7 +73,7 @@ func userProfile2attributeProfile(user *v1UserProfile) (attr *engine.AttributePr
|
||||
fieldName = utils.RequestType
|
||||
}
|
||||
if utils.IsSliceMember(usrFltr, fieldName) {
|
||||
attr.FilterIDs = append(attr.FilterIDs, fmt.Sprintf("*string:~%s:%s", fieldName, substitute))
|
||||
attr.FilterIDs = append(attr.FilterIDs, fmt.Sprintf("*string:~*req.%s:%s", fieldName, substitute))
|
||||
continue
|
||||
}
|
||||
var path string
|
||||
|
||||
@@ -194,7 +194,7 @@ func testUsrITMigrateAndMove(t *testing.T) {
|
||||
}
|
||||
|
||||
expUsrIdx := map[string]utils.StringSet{
|
||||
"*string:Account:1002": {
|
||||
"*string:*req.Account:1002": {
|
||||
"1001": struct{}{},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func TestUserProfile2attributeProfile(t *testing.T) {
|
||||
Tenant: defaultTenant,
|
||||
ID: "1001",
|
||||
Contexts: []string{utils.MetaAny},
|
||||
FilterIDs: []string{"*string:~Account:1002"},
|
||||
FilterIDs: []string{"*string:~*req.Account:1002"},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
@@ -122,7 +122,7 @@ func TestUserProfile2attributeProfile(t *testing.T) {
|
||||
ID: "1001",
|
||||
Contexts: []string{utils.MetaAny},
|
||||
FilterIDs: []string{
|
||||
"*string:~Account:1002",
|
||||
"*string:~*req.Account:1002",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
@@ -144,7 +144,7 @@ func TestUserProfile2attributeProfile(t *testing.T) {
|
||||
Tenant: defaultTenant,
|
||||
ID: "1001",
|
||||
Contexts: []string{utils.MetaAny},
|
||||
FilterIDs: []string{"*string:~Account:1002"},
|
||||
FilterIDs: []string{"*string:~*req.Account:1002"},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
@@ -166,7 +166,7 @@ func TestUserProfile2attributeProfile(t *testing.T) {
|
||||
ID: "acstmusername",
|
||||
Contexts: []string{utils.MetaAny},
|
||||
FilterIDs: []string{
|
||||
"*string:~Account:acnt63",
|
||||
"*string:~*req.Account:acnt63",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
|
||||
Reference in New Issue
Block a user