Repository navigation
Releases
Releases · entirius/entirius-django-regon-api
v3.0.1
- The app is listed in the module registry: its AppConfig sets
is_volkanos = True, so django-munin's
GET /api/munin/v2/reports it under the keyregon_api. Before, the registry left it out although it was
installed. Its label there and in the Django admin is "Company Registry Lookup" (was "Django_Regon_Api"). - The lookup routes
nip/<nip>/andregon/<regon>/check the identifier first: spaces and dashes are removed, then a
NIP must have 10 digits and a REGON 9 or 14. Anything else answers 400 (data"Invalid NIP" / "Invalid REGON",
codes 5001 / 5003) without a registry call. A NIP or REGON written with spaces or dashes is now looked up. - The lookup routes are throttled per client address, both routes in one bucket: scope
regon_lookup_ipin
REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"],30/hourwhen the scope is missing or malformed. Over the limit the
answer is 429 withRetry-After(meta.status"THROTTLED"). The address comes from
django_utils.api.client_ip.get_client_ip(CLIENT_IP_HEADER; behind a storefront that proxies the API
server-side,CLIENT_IP_TRUSTED_PROXIES+CLIENT_IP_FORWARDED_HEADERgive each visitor its own bucket). - Requires
entirius-django-utils>=2.4.2(was>=2.0.0) for that helper. - The lookup routes answer through the Django cache (
GET_GOV_DATA_CACHE_TIMEOUT): a repeated NIP or REGON is
served without a registry call.raw_gus_dataanswers are cached under their own key. The answer of a first lookup
is unchanged; failed lookups are not cached. - New
output.search_gov_registry(kind, number, raw=False): the cached VAT registry lookup behind the routes and
get_nip_from_gov(same cache key as before for NIP).