PANSA API GATEWAY

Gdańsk 22.07.2020

Preview

Andrzej Goławski @pansa

PANSA API GATEWAY

Rest API

AMQP 1.0 API 

Versioning

Authentication

Documentation

Versioning

Documentation

Queues & Events

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.cloud.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

flights endpoint request

curl \
  -H "Accept: application/v1+json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  https://api-dev.cloud.pansa.pl/acdm/flights/AAA0000

response

{
 id: "123",
 csgn: "LOT9MP",
 des4: "EPPO",
 org4: "EPGD",
 act5: "E190",
 eobt: "2020-07-07T13:55:00Z",
 psta: "10R",
 pstd: null
}

REST API

Documentation

https://api-dev.cloud.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.cloud.pansa.pl/acdm/flights/AAA0000

Version 1

"Accept: application/v1+json"

Version 2

"Accept: application/v2+json"

AMQP API

Authentication

Documentation

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

Documentation

TBA

AMQP API

Queues & Events 

Queue

<version>.<client-id>.<domain>.<events-type>

v1.epgd.acdm.flights

Events

event-type: TargetTimeOfArrivalChanged

properties

payload

{
 "oldValue" : "2020-07-21T07:55:00Z",
 "newValue" : "2020-07-21T08:05:00Z",
 "flight" : {
   id: "123",
   csgn: "LOT9MP",
   des4: "EPPO",
   ...
 }
}

Questions

Thank you

Made with Slides.com