Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 2.5 KB

File metadata and controls

60 lines (40 loc) · 2.5 KB

Weather API demo

Status

  • REST integration:

    • a REST API exposed via the API Gateway allows to query weather events.
    • a CLI client app queries this REST endpoint
    • API keys are configured to limit traffic (usage/quotas)
    • authentication is based on mutual TLS
  • websocket integration:

    • a websocket endpoint is exposed on the API Gateway
    • the on-connect lambda keeps track of the currently connected websocket clients
    • the ws-push lambda is notified when events are added to DynamoDB and forwards them to all currently connected websocket clients
    • a CLI websocket client streams weather events from the websocket endpoint and prints them
  • both the REST and websocket endpoints are exposed on a custom DNS domain

  • a data generator lambda, triggered every minute, adds random weather events to DynamoDB

TODO (maybe)

  • handle SIGINT correcty in ws socket client
  • add Webocket security: API key? Or first request a temp token through REST, then pass it in the connect ws phase
  • add OpenAPI spec to REST endpoint

References

Go AWS SDK

Go DynamoDB SDK

Security