Add Radius Vendor
Developmentadd-radius-vendorAdd Radius Vendor is an Agent Skill for development published in the talkincode/toughradius repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Add or extend vendor VSA parsing and response enhancement (TR-F005). Use when ToughRADIUS must recognize a vendor's request VSAs, or emit that vendor's proprietary attributes in Access-Accept.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/talkincode/toughradius/blob/HEAD/.agents/skills/add-radius-vendor/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/add-radius-vendor, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Skill: Add Vendor VSA Parsing / Response Enhancement
Feature ID:
TR-F005| Milestone: M5
When to use
When ToughRADIUS must recognize a vendor's request VSAs, or emit that vendor's specific attributes in Access-Accept.
Pre-research (read before writing)
grep_search "VendorCode" --include internal/radiusd/**
file_search "internal/radiusd/plugins/vendorparsers/parsers/*_parser.go"
file_search "internal/radiusd/plugins/auth/enhancers/*_enhancer.go"
view internal/radiusd/plugins/vendorparsers/parsers/init.go # registration point
view internal/radiusd/vendors/<existing-vendor>/ # dictionary & constants
Key insight: a dictionary != a parser. A dictionary only describes attributes; without a parser they are never extracted.
Implementation steps
- Constants / dictionary: define the VendorCode and VSA constants under
internal/radiusd/vendors/<vendor>/(reference huawei). If thevendorspackage lacks theCode<Vendor>constant, add it first. - Parser: implement the parser at
internal/radiusd/plugins/vendorparsers/parsers/<vendor>_parser.go, mirroringhuawei_parser.go's interface and field extraction. - Register the parser: in
parsers/init.go'sinit(), callvendors.Register(&vendors.VendorInfo{Code: vendors.Code<Vendor>, ...Parser: &<Vendor>Parser{}}). - Enhancer (if emitting response attributes): implement
internal/radiusd/plugins/auth/enhancers/<vendor>_enhancer.go, mirroringhuawei_enhancer.go(rate, VLAN, etc.). - Sample-based tests: add
<vendor>_parser_test.go/<vendor>_enhancer_test.gocovering parsing and emission with real attribute samples.
Conventions
- Vendor bandwidth-unit differences and binary-vs-decimal conversions must carry inline comments explaining the "why".
- Rate / VLAN / MAC-binding behavior must be semantically consistent with existing vendors.
Acceptance
-
go test ./internal/radiusd/...passes -
golangci-lint runreports no new issues - Both new vendor parsing and response have sample test coverage
- PR references
TR-F005and the milestone ID