Setup PAP auth exactly like CGRateS test configuration

Two-processor approach from radagent_it_test.go:
1. CGRPAPAuth: *authorize, *attributes, *accounts, *continue
   - Fetches PasswordFromAttributes using *attributes marker
2. RadiusPAPAuthProcessor: *radauth, *pap
   - Uses password from ~*cgrep.Attributes.PasswordFromAttributes

Updated Attributes.csv to use *cgrep.PasswordFromAttributes path.

🤖 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 00:26:10 +05:00
parent 0d78fcf681
commit cab4ca64fb
2 changed files with 28 additions and 10 deletions

View File

@@ -82,23 +82,40 @@
},
"request_processors": [
{
"id": "Authorization",
"id": "CGRPAPAuth",
"filters": ["*string:~*vars.*radReqType:*radAuth"],
"flags": ["*authorize", "*attributes", "*log"],
"flags": ["*authorize", "*attributes", "*accounts", "*continue"],
"request_fields": [
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "data"},
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true},
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id", "mandatory": true},
{"tag": "Account", "path": "*cgreq.Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true},
{"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": "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": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes", "type": "*constant", "value": "*attributes"}
],
"reply_fields": []
},
{
"id": "RadiusPAPAuthProcessor",
"filters": ["*string:~*vars.*radReqType:*radAuth"],
"flags": ["*radauth", "*pap", "*log"],
"request_fields": [
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
"value": "~*cgrep.Attributes.PasswordFromAttributes"}
],
"reply_fields": [
{"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"},
{"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*constant", "value": "AccessReject"},
{"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"],
"type": "*variable", "value": "~*cgrep.Error"},
{"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "type": "*constant", "value": "3600"},
{"tag": "AcctInterimInterval", "path": "*rep.Acct-Interim-Interval", "type": "*constant", "value": "30"}
{"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "filters": ["*empty:~*cgrep.Error:"],
"type": "*constant", "value": "3600"},
{"tag": "AcctInterimInterval", "path": "*rep.Acct-Interim-Interval", "filters": ["*empty:~*cgrep.Error:"],
"type": "*constant", "value": "30"}
]
}
]