Match exact CGRateS oldtutorial PAP auth pattern

Attributes.csv: Use *req.PasswordFromAttributes path (like oldtutorial)
Config: Add PasswordFromAttributes field with *attributes marker
Second processor reads from ~*cgrep.Attributes.PasswordFromAttributes

This matches the exact pattern from CGRateS test configurations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-24 09:09:13 +05:00
parent b6c12a5e36
commit 2acf4636bb
2 changed files with 7 additions and 6 deletions

View File

@@ -93,7 +93,8 @@
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*composed", "value": "~*req.User-Name", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "*any", "mandatory": true},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp;*now", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp;*now", "mandatory": true}
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp;*now", "mandatory": true},
{"tag": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes", "type": "*constant", "value": "*attributes"}
],
"reply_fields": []
},
@@ -103,7 +104,7 @@
"flags": ["*radauth", "*pap", "*log"],
"request_fields": [
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
"value": "~*req.Password"}
"value": "~*cgrep.Attributes.PasswordFromAttributes"}
],
"reply_fields": [
{"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"},

View File

@@ -3,13 +3,13 @@
# User: test - Test user for MikroTik PPPoE
cgrates.org,ATTR_PPPOE_TEST,*any,FLTR_ACCOUNT_TEST,,,,,,false,20
cgrates.org,ATTR_PPPOE_TEST,,,,,*req.Password,*constant,test,,
cgrates.org,ATTR_PPPOE_TEST,,,,,*req.PasswordFromAttributes,*constant,test,,
cgrates.org,ATTR_PPPOE_TEST,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_TEST,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
# User: pppoe_user1 - 10Mbps plan with static IP
cgrates.org,ATTR_PPPOE_USER1,*any,FLTR_ACCOUNT_USER1,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.Password,*constant,SecurePass123,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.PasswordFromAttributes,*constant,SecurePass123,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPAddress,*constant,10.0.0.101,,
cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
@@ -17,7 +17,7 @@ cgrates.org,ATTR_PPPOE_USER1,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
# User: pppoe_user2 - 20Mbps plan with static IP
cgrates.org,ATTR_PPPOE_USER2,*any,FLTR_ACCOUNT_USER2,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.Password,*constant,SecurePass456,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.PasswordFromAttributes,*constant,SecurePass456,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPAddress,*constant,10.0.0.102,,
cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
@@ -25,6 +25,6 @@ cgrates.org,ATTR_PPPOE_USER2,,,,,*req.MikrotikRateLimit,*constant,20M/20M,,
# User: pppoe_user3 - 50Mbps plan with dynamic IP
cgrates.org,ATTR_PPPOE_USER3,*any,FLTR_ACCOUNT_USER3,,,,,,false,20
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.Password,*constant,SecurePass789,,
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.PasswordFromAttributes,*constant,SecurePass789,,
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.RequestType,*constant,*prepaid,,
cgrates.org,ATTR_PPPOE_USER3,,,,,*req.MikrotikRateLimit,*constant,50M/50M,,
1 #Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,Path,Type,Value,Blocker,Weight
3 # User: test - Test user for MikroTik PPPoE
4 cgrates.org,ATTR_PPPOE_TEST,*any,FLTR_ACCOUNT_TEST,,,,,,false,20
5 cgrates.org,ATTR_PPPOE_TEST,,,,,*req.Password,*constant,test,, cgrates.org,ATTR_PPPOE_TEST,,,,,*req.PasswordFromAttributes,*constant,test,,
6 cgrates.org,ATTR_PPPOE_TEST,,,,,*req.RequestType,*constant,*prepaid,,
7 cgrates.org,ATTR_PPPOE_TEST,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
8 # User: pppoe_user1 - 10Mbps plan with static IP
9 cgrates.org,ATTR_PPPOE_USER1,*any,FLTR_ACCOUNT_USER1,,,,,,false,20
10 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.Password,*constant,SecurePass123,, cgrates.org,ATTR_PPPOE_USER1,,,,,*req.PasswordFromAttributes,*constant,SecurePass123,,
11 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.RequestType,*constant,*prepaid,,
12 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPAddress,*constant,10.0.0.101,,
13 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
14 cgrates.org,ATTR_PPPOE_USER1,,,,,*req.MikrotikRateLimit,*constant,10M/10M,,
15 # User: pppoe_user2 - 20Mbps plan with static IP
17 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.Password,*constant,SecurePass456,, cgrates.org,ATTR_PPPOE_USER2,,,,,*req.PasswordFromAttributes,*constant,SecurePass456,,
18 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.RequestType,*constant,*prepaid,,
19 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPAddress,*constant,10.0.0.102,,
20 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.FramedIPNetmask,*constant,255.255.255.0,,
21 cgrates.org,ATTR_PPPOE_USER2,,,,,*req.MikrotikRateLimit,*constant,20M/20M,,
22 # User: pppoe_user3 - 50Mbps plan with dynamic IP
23 cgrates.org,ATTR_PPPOE_USER3,*any,FLTR_ACCOUNT_USER3,,,,,,false,20
25 cgrates.org,ATTR_PPPOE_USER3,,,,,*req.RequestType,*constant,*prepaid,,
26 cgrates.org,ATTR_PPPOE_USER3,,,,,*req.MikrotikRateLimit,*constant,50M/50M,,
27
28
29
30