travelping / capwap

Erlang CAPWAP AC implementation.
GNU Affero General Public License v3.0
13 stars 8 forks source link

Custom ergw_aaa handler for location checking #54

Open javiermtorres opened 2 years ago

javiermtorres commented 2 years ago

CAPWAP needs to retrieve a Location element from an HTTP service and add it to its RADIUS requests (LI-Location). This item is already present in the dictionaries for ergw_aaa.

A custom handler has to be developed that makes the HTTP call, retrieves the Location element and adds it to the session so that the ergw_aaa handler can send it forward.

RoadRunnr commented 2 years ago

That handler should never, ever become a part of ergw_aaa. Make it a standalone App or borrow ergw_sbi, but ergw_aaa is the wrong place for this.

javiermtorres commented 2 years ago

No, it won't. It will be just a module from capwap called from a specific step in the same procedure where the RADIUS request is sent. What I mean is that this step will include in the session the attribute that will be sent in the RADIUS request.

RoadRunnr commented 2 years ago

That still sounds like you want to use the ergw_aaa_session mechanism. And that should not be done at all.

javiermtorres commented 2 years ago

No, it'd be by configuration. The ergw_aaa_session would not be modified either.

        {session, ['Default']},
        {procedures, [
          {authenticate, ['Load-Location', 'RADIUS-Auth-Station']},
          {authorize, []},
          {start,   ['Load-Location', 'RADIUS-Acct-Station']},
          {interim, ['Load-Location', 'RADIUS-Acct-Station']},
          {stop,    ['Load-Location', 'RADIUS-Acct-Station']}
        ]}