Commit Graph

27 Commits

Author SHA1 Message Date
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
05b2f9832c Rename old config files to .json.old to prevent conflicts 2025-12-23 20:54:36 +05:00
b34c36323a Minimal auth processor - just return Access-Accept 2025-12-23 20:51:28 +05:00
df56fe456b Add default auth processor for testing 2025-12-23 20:49:58 +05:00
28e9c0fe06 Remove *auth flag causing unknown request type error 2025-12-23 20:47:10 +05:00
ae41322355 Fix attributes filter matching - use named filters
- Changed context from *sessions to *any for all attribute profiles
- Created explicit filter definitions in Filters.csv
- Changed from inline filters to named filters (FLTR_ACCOUNT_*)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:42:19 +05:00
ce3ae559a2 fixes 2025-12-23 20:37:06 +05:00
f1f09bda53 radius auth fix 2025-12-23 20:01:46 +05:00
5be08977bc radius auth fix 2025-12-23 19:59:49 +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
943621c016 radius auth fix 2025-12-23 19:23:52 +05:00
82aba07b01 pppoe addition 2025-12-23 18:36:36 +05:00
a67f3609c4 first commit 2025-12-23 18:08:31 +05:00