CAT-DAC
API GATEWAY
Andrzej Goławski @pansa
CAT-DAC API GATEWAY
Rest API
AMQP 1.0 API
Versioning
Authentication
Documentation
Versioning
Documentation
Queues & Events
CatDac Architecture
CAT-DAC Architecture
cat dac
sso
messaging
API
Ingress
LB
Integration for validation
Rest
?
Import so6
api ?
WOC
CAT
RNEST
?
REST API
Authentication
Documentation
Versioning
REST API
Authentication
oAuth offline token
eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiMzI5NTcxYS0
TFmLTRiYTgtOWM1Zi03ZTI5YjY3OTMxNjUifQ
.eyJqdGkiOiIwNTZjZDJkMi0zMjVmLTRmYmEtODc3OS0wOWEwOTAxNGMyNDUiLC
leHAiOjAsIm5iZiI6MCwiaWF0IjoxNTk1MzY3MzU2LCJpc3MiOiJodHRwczov
3Nzby1kZXYuY2xvdWQucGFuc2EucGwvYXV0aC9yZWFsbXMvYXBpIiwiYXVkIj
iaHR0cHM6Ly9zc28tZGV2LmNsb3VkLnBhbnNhLnBsL2F1dGgvcmVhbG1zL2Fw
SIsInN1YiI6ImQzOTllMjE2LWJiYjYtNGQ4OC1iNTEwLWFkZDgxZDc1ODVmYS
sInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJhcGktZ2F0ZXdheSIsImF1dGhfdGlt
SI6MCwic2Vzc2lvbl9zdGF0ZSI6IjQ0MDcwZjU5LTBkYjYtNDMwMS04YjNhLW
iNzM5MWUyMGM0YyIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5l
2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3
iOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFn
S1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbW
pbCBvZmZsaW5lX2FjY2VzcyBwcm9maWxlIn0
.rK0TYGJm7a_ANkLiWAMSdakkU6NMDtpuMoz_7myos
REST API
Authentication
client
access token request
curl \
-d "client_id=api-gateway" \
-d "grant_type=refresh_token" \
-d "refresh_token=$OFFLINE_TOKEN" \
https://sso.dev.pansa.pl/auth/realms/api/protocol/openid-connect/token
access token
{
"access_token": "eyJhbGciOiJSUzIwczooiY....",
"expires_in": 300,
"refresh_expires_in": 0,
"refresh_token": "eyJhbGciOiJIUzI1.....",
"token_type": "bearer",
"not-before-policy": 0,
"session_state": "44070f59-0db6-4301-8b3a-ab7391e20c4c",
"scope": "offline_access"
}
sso
api gateway
dmas endpoint request
curl \
-H "Accept: application/v1+json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://api.dev.pansa.pl/dac/dmas/AAA0000
response
{
"id": "AAA0000",
"designator": "DMA01",
"actualUpperLimit": {"uinit": "F", "value": "300"},
"actualLowerLimit": {"uinit": "F", "value": "100"},
"actualStartTime": "2020-10-07T13:55:00Z",
....
}
REST API
Documentation
https://api.dev.pansa.pl/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config
REST API
Versioning
HTTP header
curl \ -H "Accept: application/v1+json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://api.dev.pansa.pl/dac/dmas/AAA0000
Version 1
"Accept: application/v1+json"
Version 2
"Accept: application/v2+json"
AMQP API
Authentication
Queues & Events
AMQP API
Authentication
oAuth offline token
eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiMzI5NTcxYS00Y
TFmLTRiYTgtOWM1Zi03ZTI5YjY3OTMxNjUifQ
.eyJqdGkiOiIwNTZjZDJkMi0zMjVmLTRmYmEtODc3OS0wOWEwOTAxNGMyNDUiLCJ
leHAiOjAsIm5iZiI6MCwiaWF0IjoxNTk1MzY3MzU2LCJpc3MiOiJodHRwczovL
3Nzby1kZXYuY2xvdWQucGFuc2EucGwvYXV0aC9yZWFsbXMvYXBpIiwiYXVkIjo
iaHR0cHM6Ly9zc28tZGV2LmNsb3VkLnBhbnNhLnBsL2F1dGgvcmVhbG1zL2Fwa
SIsInN1YiI6ImQzOTllMjE2LWJiYjYtNGQ4OC1iNTEwLWFkZDgxZDc1ODVmYSI
sInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJhcGktZ2F0ZXdheSIsImF1dGhfdGltZ
SI6MCwic2Vzc2lvbl9zdGF0ZSI6IjQ0MDcwZjU5LTBkYjYtNDMwMS04YjNhLWF
iNzM5MWUyMGM0YyIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX
2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3M
iOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZ
S1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbWF
pbCBvZmZsaW5lX2FjY2VzcyBwcm9maWxlIn0
.rK0TYGJm7a_ANkLiWAMSdakkU6NMDtpuMoz_7myosqo
AMQP API
Queues & Events
Queue
<version>.<client-id>.<domain>.<events-type>
v1.airbus.dac.atc-volume
Events
event-type: AtcVolumeAdded
properties
payload
{
"id": "BBB0001",
"designator": "ATC-VOLUME-01"
"actualUpperLimit": {"uinit": "F", "value": "300"},
"actualLowerLimit": {"uinit": "F", "value": "100"},
"actualStartTime": "2020-10-07T13:55:00Z",
....
}
Questions
Thank you
cat api gateway
By andipansa
cat api gateway
- 148