mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 00:28:44 +05:00
RADIUS update for shared secrets and dicts between auth and accounting
This commit is contained in:
@@ -44,19 +44,21 @@ const (
|
||||
)
|
||||
|
||||
func NewRadiusAgent(cgrCfg *config.CGRConfig, smg rpcclient.RpcClientConnection) (ra *RadiusAgent, err error) {
|
||||
dicts := make(map[string]*radigo.Dictionary, len(cgrCfg.RadiusAgentCfg().ClientDictionaries))
|
||||
dts := make(map[string]*radigo.Dictionary, len(cgrCfg.RadiusAgentCfg().ClientDictionaries))
|
||||
for clntID, dictPath := range cgrCfg.RadiusAgentCfg().ClientDictionaries {
|
||||
if dicts[clntID], err = radigo.NewDictionaryFromFolderWithRFC2865(dictPath); err != nil {
|
||||
if dts[clntID], err = radigo.NewDictionaryFromFolderWithRFC2865(dictPath); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
dicts := radigo.NewDictionaries(dts)
|
||||
ra = &RadiusAgent{cgrCfg: cgrCfg, smg: smg}
|
||||
secrets := radigo.NewSecrets(cgrCfg.RadiusAgentCfg().ClientSecrets)
|
||||
ra.rsAuth = radigo.NewServer(cgrCfg.RadiusAgentCfg().ListenNet,
|
||||
cgrCfg.RadiusAgentCfg().ListenAuth, cgrCfg.RadiusAgentCfg().ClientSecrets, dicts,
|
||||
cgrCfg.RadiusAgentCfg().ListenAuth, secrets, dicts,
|
||||
map[radigo.PacketCode]func(*radigo.Packet) (*radigo.Packet, error){
|
||||
radigo.AccessRequest: ra.handleAuth}, nil)
|
||||
ra.rsAcct = radigo.NewServer(cgrCfg.RadiusAgentCfg().ListenNet,
|
||||
cgrCfg.RadiusAgentCfg().ListenAcct, cgrCfg.RadiusAgentCfg().ClientSecrets, dicts,
|
||||
cgrCfg.RadiusAgentCfg().ListenAcct, secrets, dicts,
|
||||
map[radigo.PacketCode]func(*radigo.Packet) (*radigo.Packet, error){
|
||||
radigo.AccountingRequest: ra.handleAcct}, nil)
|
||||
return
|
||||
|
||||
2
glide.lock
generated
2
glide.lock
generated
@@ -18,7 +18,7 @@ imports:
|
||||
- name: github.com/cgrates/osipsdagram
|
||||
version: 3d6beed663452471dec3ca194137a30d379d9e8f
|
||||
- name: github.com/cgrates/radigo
|
||||
version: b3ea6cb087f3ecdc1b4e611df206521d96af1472
|
||||
version: 4351b1d135e822472a2759ae1c95f103cf51df60
|
||||
- name: github.com/cgrates/rpcclient
|
||||
version: dddae42e9344e877627cd4b7aba075d63b452c0b
|
||||
- name: github.com/ChrisTrenkamp/goxpath
|
||||
|
||||
Reference in New Issue
Block a user