Commit Graph

22 Commits

Author SHA1 Message Date
39a45a2151 fixes 2025-12-24 22:18:05 +05:00
2acf4636bb 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>
2025-12-24 09:09:13 +05:00
b6c12a5e36 Fix attribute path: use *req.Password like CGRateS tutorial
Changed Attributes.csv to use *req.Password path (like tutorial)
Updated config to read password from ~*req.Password
Removed PasswordFromAttributes complexity

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 08:59:31 +05:00
41847a0793 Fix filter to match User-Name instead of Account
RADIUS packets have User-Name attribute, not Account.
Changed filters to use ~*req.User-Name for matching.
Added *log flag to first processor for debugging.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 08:56:17 +05:00
cab4ca64fb 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>
2025-12-24 00:26:10 +05:00
0d78fcf681 Switch to authorization-only approach (like sample config)
CGRateS PAP has null-padding bug that requires newer version with
*strip fix. Using *authorize + *attributes instead of *radauth.

This checks if account exists (authorization) but does NOT verify
passwords (authentication). Same approach as the working sample.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:33:21 +05:00
8e7894cd30 Simplify: Single PAP auth processor with hardcoded password
Testing if *radauth + *pap works with hardcoded password "test"
before adding attributes complexity.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:32:11 +05:00
d2068924c9 Fix: Add *none request type flag to AuthGetPassword processor
Each processor needs a request type flag (*none, *authorize, *radauth, etc.)
The *attributes flag is just a modifier, not a request type.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:31:08 +05:00
9c21307ad3 Add proper PAP authentication with *strip fix for null padding
Two-processor approach:
1. AuthGetPassword: Fetches user password from attributes
2. AuthPAP: Uses *radauth + *pap with *strip:*suffix:*nil converter
   to remove null padding from PAP passwords before comparison

Uses ~*req.User-Password{*strip:*suffix:*nil} as recommended by
CGRateS maintainers to fix the null-padding comparison bug.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:29:57 +05:00
dd335be7f5 Bypass auth with *none flag - workaround for PAP null-padding bug
CGRateS has a bug where PAP passwords are compared with null padding
intact ("test\0\0\0..." != "test"). Using *none flag to accept all
auth requests while returning Session-Timeout.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:24:01 +05:00
11ee815a44 Simplify PAP auth - hardcode password to test basic flow
Single processor with hardcoded password "test" to verify PAP works.
Removed Acct-Interim-Interval (not in dictionary).
Once PAP works, will add attributes lookup.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:21:25 +05:00
03f47078de Use *message flag instead of *dry_run for attributes fetch
*dry_run was not recognized. Using *message which is a valid
request type that works with *attributes flag.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:20:13 +05:00
ca09317856 Simplify to PAP authentication only for initial testing
Two-step auth flow:
1. AuthGetPassword: Fetches password from attributes using *dry_run
2. AuthPAP: Performs PAP authentication with *radauth + *pap

Will add CHAP and MS-CHAPv1 after PAP is confirmed working.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:15:24 +05:00
f6bcdccf9c Workaround CGRateS MS-CHAPv2 bug - use *event instead of *radauth
CGRateS has a bug where *radauth + *mschapv2 looks for MS-CHAP-Response
(attribute 1) instead of MS-CHAP2-Response (attribute 25).
MikroTik sends MS-CHAP2-Response, causing MANDATORY_IE_MISSING error.

This workaround uses *event + *attributes to validate user existence
via attributes subsystem. The actual password validation is NOT done
server-side - MikroTik will handle MS-CHAPv2 locally.

TODO: Report bug to CGRateS - librad.go line 130 should use
MS-CHAP2-Response for MetaMSCHAPV2 case.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:13:38 +05:00
918e9c8cff Simplify MS-CHAPv2 auth - remove accounts check that requires MaxUsage
Removed *accounts flag and mandatory MaxUsage field that was causing
NOT_FOUND:MaxUsage error. Using fixed Session-Timeout instead.
First processor now just fetches attributes (password) for auth.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:08:52 +05:00
dfb925494c Implement proper MS-CHAPv2 authentication for MikroTik PPPoE
Two-processor approach:
1. MSCHAPv2GetPassword: Uses *authorize + *attributes to fetch password
   from CGRateS attributes subsystem and get MaxUsage for session timeout
2. MSCHAPv2Auth: Uses *radauth + *mschapv2 to perform actual MS-CHAPv2
   authentication with cryptographic proof (MS-CHAP2-Success)

The password is read from ~*cgrep.Attributes.Password (set via Attributes.csv)
and placed in *vars.UserPassword for the *radauth to use.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:07:05 +05:00
73753b5bc3 Add *none flag to request_processor to fix unknown request type error
The processor must have a request type flag (*none, *authorize, *radauth, etc.)
not just *log. Without it, reqType stays empty and hits the default switch case
returning "unknown request type: <>".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:03:40 +05:00
9a7430cbe5 Move processor to cgrates.json, disable separate files 2025-12-23 20:56:52 +05:00
751723ee48 radius auth fix 2025-12-23 19:56:17 +05:00
dad5a4ca01 radius auth fix 2025-12-23 19:43:36 +05:00
82aba07b01 pppoe addition 2025-12-23 18:36:36 +05:00
a67f3609c4 first commit 2025-12-23 18:08:31 +05:00