ЕСОЗ - публічна документація
RC (PCAB) [Internal] Apikey verify
Purpose
This method is designed to verify MIS/PIS apikey and return additional details of MIS/PIS.
Key points
This is an internal method, so it does not have endpoint. Method is used by Kong service.
Method verifies apikey and returns additional details of MIS/PIS: client_id, broker_scope list and client_type scope list.
In case if apikey is verified – verification result is also saved to Redis cache for configured amount of time.
Specification
Verify apikey
Check that apikey exists in
connections
table,mithril
database, with secret = hashedapi_key
from URLin case of error - return 422 ('API-KEY is invalid.')
Service logic
Obtain data from
connections
,clients
andclient_types
tables ofmithril
database.Prepare data for response, set values:
details.broker_scope = clients.priv_settings.broker_scope
details.client_id = connections.client_id
details.scope = client_types.scope
mis_client_id = connections.client_id
Render a response according to specification.
Save successful response to Redis cache database with key =
apikey_{api_key}
and TTL = value from APIKEY_VERIFY_TTL_SECONDS config parameter (in seconds).
ЕСОЗ - публічна документація