magma / domain-proxy

A Domain proxy for Magma
BSD 3-Clause "New" or "Revised" License
1 stars 6 forks source link

[stretch] Handle Grant 401 response with grantId #506

Closed xbend closed 2 years ago

xbend commented 2 years ago

If Domain Proxy receives a 401 error for grantRequest, and grantId is in the payload, it means that there is a grant already on the SAS side that Domain Proxy is unaware of.

This is an indication that Domain Proxy is out-of-sync with SAS state for given CBSD.

In such case, CC should create UNSYNC grants with first grantID value returned in the error response that is not already in the DB. This UNSYNC grant will be picked up by AMC and relinquished.

Example grantRequest:

{'cbsdId': '2AG32PBS310101202000291213VB0009', 'operationParam': {'maxEirp': 14, 'operationFrequencyRange': {'lowFrequency': 3590000000, 'highFrequency': 3610000000}}}

Received grantResponse with 401 error:

{'cbsdId': '2AG32PBS310101202000291213VB0009', 'response': {'responseCode': 401, 'responseData': ['61469335152205000031659341147']}}

When creating those UNSYNC grants in DB, please assign those grants the following values: cbsd_id - same as for request
state_id - UNSYNC grant_id - one item from grantId list returned in grantResponse responseData list grant_expire_time - null transmit_expire_time - null heartbeat_interval - null last_heartbeat_request_time - null channel_type - null created_date - this will be filled automaticaly updated_date - this will be filled automaticaly low_frequency - copy from grantRequest high_frequency - copy from grantRequest max_eirp - copy from grantRequest