Skip to content

rewrite eradius#241

Open
RoadRunnr wants to merge 12 commits intomasterfrom
feature/next-major
Open

rewrite eradius#241
RoadRunnr wants to merge 12 commits intomasterfrom
feature/next-major

Conversation

@RoadRunnr
Copy link
Member

v3 rewrite of eradius, major changes:

  • clients and servers are now started and configured through APIs, not
    app env settings any more
  • IPv6 support
  • supports multiple server and client instances
  • metrics are optional and callback based (allows the easy use of other
    metrics frameworks)
  • distributed handlers are no longer support, use erpc to replicate in
    use case specific code if needed.
  • removed proxy support (use freeradius or similar instead)

@RoadRunnr RoadRunnr force-pushed the feature/next-major branch from 0ab0e31 to e6f81cb Compare May 6, 2024 07:32
RoadRunnr added 7 commits May 6, 2024 10:14
Seperate concerns better. Socket managing is not in the mngr module,
while the sending logic is in the client module.
There was no logic in place to remove entries from the pending
registry once the timeout hits. The client side timeout would only
handle re-transmission, but not the cleanup.

Move the timeout logic to the sender and let it also cleanup the
pending registry.
Fully prepare client suite for full IPv6 support and add some minor
tweaks to the others to move them closer to IPv6 support.
@RoadRunnr RoadRunnr force-pushed the feature/next-major branch from e6f81cb to a2c9a75 Compare May 6, 2024 08:15
@0xAX
Copy link
Member

0xAX commented May 6, 2024

removed proxy support (use freeradius or similar instead)

Was it approved for the use-cases where it was is used?

clients and servers are now started and configured through APIs, not
app env settings any more

What does it give? The projects that are using old configuration need to have adjustments to handle previous eradius configuration by themselves (or to completely change/remove it what is not always possible) and to call API instead of eradius did it automatically (start servers/clients 'manually' via API). What is the purpose of it? To have some ability to do things in runtime? The old version reconfigure API, why not to add API/wrappers around set_env like add_server,remove_server and so on but break the behaviour?

@RoadRunnr RoadRunnr force-pushed the feature/next-major branch 3 times, most recently from 022331f to dc3bc8e Compare May 6, 2024 10:20
@RoadRunnr
Copy link
Member Author

removed proxy support (use freeradius or similar instead)

Was it approved for the use-cases where it was is used?

There is no need to move existing use-case to the new code. If there is something that uses proxing, it can continue to use the old version.
However, I would strongly recommend to move those project to something else.

clients and servers are now started and configured through APIs, not
app env settings any more

What does it give? The projects that are using old configuration need to have adjustments to handle previous eradius configuration by themselves (or to completely change/remove it what is not always possible) and to call API instead of eradius did it automatically (start servers/clients 'manually' via API). What is the purpose of it? To have some ability to do things in runtime? The old version reconfigure API, why not to add API/wrappers around set_env like add_server,remove_server and so on but break the behaviour?

Again, existing projects can stay with the version they are using. There is nothing that forces them to move.
The changes in configuration are just to big to provide sensible compatibility mappers. It is saner if projects want to use the version, that they migrate to the new API.

@RoadRunnr RoadRunnr force-pushed the feature/next-major branch 2 times, most recently from ec43b3c to 5a4066d Compare May 7, 2024 15:41
@RoadRunnr RoadRunnr marked this pull request as ready for review May 8, 2024 07:02
@RoadRunnr RoadRunnr requested a review from a team as a code owner May 8, 2024 07:02
ebengt
ebengt previously approved these changes May 8, 2024
Copy link

@ebengt ebengt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

v3 rewrite of eradius, major changes:
* clients and servers are now started and configured through APIs, not
  app env settings any more
* IPv6 support
* supports multiple server and client instances
* metrics are optional and callback based (allows the easy use of other
  metrics frameworks)
* distributed handlers are no longer support, use erpc to replicate in
  use case specific code if needed.
* removed proxy support (use freeradius or similar instead)
…ent field

- packet/1: pre-generate random authenticator for 'request' cmd before
  encoding attributes, so that scramble encryption (User-Password) and
  Message-Authenticator HMAC computation both use the same authenticator
  value that will be written into the packet header

- encode_body/2 for 'request': use pre-generated authenticator from packet/1
  if present, instead of always generating a new one

- encode_message_authenticator/2: fix typo 'reqid' -> 'req_id' in pattern
  match, so Message-Authenticator HMAC is actually computed when msg_hmac=true

- request/4: make 'client' field optional in NAS map (fall back to <<>>),
  since NAS maps often only carry 'secret' and omitting 'client' caused a
  function_clause crash on the server side when decoding incoming packets
- handle_call({reconfigure, ...}): also update #state.servers when
  reconfiguring, so that new servers are actually used for sending requests
  (previously only config was updated, leaving servers empty → no_active_servers)

- start_client/1: return the client manager pid instead of the supervisor pid,
  so callers can pass it directly to eradius_client:send_request/3,4
  (previously the supervisor pid was returned, causing send_request to crash
  with {wanna_send,...} arriving at the supervisor gen_server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants