diff --git a/README.md b/README.md index 41599b1..7e50d80 100644 --- a/README.md +++ b/README.md @@ -155,26 +155,27 @@ To change the data in the static server (simulating your backend API), edit, add The following endpoints are worth noticing: -| Feature | Endpoint | Description | -|---------------------------------------------------------|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Simple request | [`/public`](http://localhost:8080/public) | A simple request calling an internal service and returning a JSON response | -| Data aggregation and manipulation | [`/git/{user}`](http://localhost:8080/git/krakendio) | Aggregating multiple calls concurrently and manipulating some data from GitHub API | -| Advanced data manipulation with JMESPATH Query Language | [`/crypto/{currency}`](http://localhost:8080/crypto/eur) | Get first 5 crypto by market capitalization, then reverse sort them by name, finally filter and rename some fields | -| Data masking | [`/user/creditcard`](http://localhost:8080/user/creditcard) | Apply data masking to some sensible data. We'll obfuscate credit card information in this case. | -| Dynamic routing based on Headers | [`/dynamic/header`](http://localhost:8080/dynamic/header) | Use information coming in the headers to dynamically route your request to internal service. You can use `curl -iG -H 'X-Route: hello' 'http://localhost:8080/dynamic/header'` to test it. | -| GraphQL to REST transformation | [`/starwars_films/{movie_id}`](http://localhost:8080/starwars_films/1) | Transforming a GraphQL query into a regular REST API endpoint | -| Request to gRPC backends | [`/travel`](http://localhost:8080/travel?lat=1.2&lon=3.4) | Aggregates flights and trains data from two different gRPC services. | -| Connection to WebSockets | [`/chat/ws/{room}`](ws://localhost:8080/chat/room/foo) | Example WebSockets implementation to illustrate WS connectivity. The WS service will broadcast received messages to all connected users in the chat. Use the [Chat UI](http://localhost:8080/chat) to test how it works. | -| Caching backend responses | [`/market/cached`](http://localhost:8080/market/cached) | Caching a backend response (based on cache headers provided by the backend) | -| Concurrent requests | [`/market/concurrent`](http://localhost:8080/market/concurrent) | Using [concurrent requests](https://www.krakend.io/docs/endpoints/concurrent-requests/) to gather data from Coingecko API | -| Sequential calls | [`/sequential`](http://localhost:8080/sequential) | Using [sequential proxy](https://www.krakend.io/docs/endpoints/sequential-proxy/) to build a pipe of sequential calls, using values from 1st call response into 2nd call request | -| An aggregated requests with a failing backend | [`/fail`](http://localhost:8080/fail) | An example of how the `X-KrakenD-complete` header works when a backend fails on an aggregated response | -| Convert a legacy SOAP XML into REST JSON | [`/capital-of/{country-code}`](http://localhost:8080/capital-of/US) | Convert the XML returned by a SOAP service that requires a POST of an XML body and answers with a complex XML into a GET REST endpoint answering with a simple JSON | -| Wildcards | [`/fake-api/*`](http://localhost:8080/fake-api/user/1.json) | Expose all sub-paths under a common location using a single endpoint definition | +| Feature | Endpoint | Description | +|---------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Simple request | [`/public`](http://localhost:8080/public) | A simple request calling an internal service and returning a JSON response | +| Data aggregation and manipulation | [`/git/{user}`](http://localhost:8080/git/krakend) | Aggregating multiple calls concurrently and manipulating some data from GitHub API | +| Advanced data manipulation with JMESPATH Query Language | [`/cryptos/{currency}`](http://localhost:8080/cryptos/eur) | Get first 5 crypto by market capitalization, then reverse sort them by name, finally filter and rename some fields | +| Data masking | [`/user/creditcard`](http://localhost:8080/user/creditcard) | Apply data masking to some sensible data. We'll obfuscate credit card information in this case. | +| Dynamic routing based on Headers | [`/dynamic/header`](http://localhost:8080/dynamic/header) | Use information coming in the headers to dynamically route your request to internal service. You can use `curl -iG -H 'X-Route: hello' 'http://localhost:8080/dynamic/header'` to test it. | +| GraphQL to REST transformation | [`/starwars_films/{movie_id}`](http://localhost:8080/starwars_films/1) | Transforming a GraphQL query into a regular REST API endpoint | +| Applying Security Policies | [`/track-user`](http://localhost:8080/track-user) | Enforce security policies at your discretion for any request. You can use `curl -iG -H'Cookie: GDPR=yes' 'http://localhost:8080/track-user'` to test it. | +| Request to gRPC backends | [`/travel`](http://localhost:8080/travel?lat=1.2&lon=3.4) | Aggregates flights and trains data from two different gRPC services. | +| Connection to WebSockets | [`/chat/ws/{room}`](ws://localhost:8080/chat/ws/foo) | Example WebSockets implementation to illustrate WS connectivity. The WS service will broadcast received messages to all connected users in the chat. Use the [Chat UI](http://localhost:8080/chat) to test how it works. | +| Caching backend responses | [`/market/cached`](http://localhost:8080/market/cached) | Caching a backend response (based on cache headers provided by the backend) | +| Concurrent requests | [`/market/concurrent`](http://localhost:8080/market/concurrent) | Using [concurrent requests](https://www.krakend.io/docs/endpoints/concurrent-requests/) to gather data from Coingecko API | +| Sequential calls | [`/sequential`](http://localhost:8080/sequential) | Using [sequential proxy](https://www.krakend.io/docs/endpoints/sequential-proxy/) to build a pipe of sequential calls, using values from 1st call response into 2nd call request | +| An aggregated requests with a failing backend | [`/fail`](http://localhost:8080/fail) | An example of how the `X-KrakenD-complete` header works when a backend fails on an aggregated response | +| Convert a legacy SOAP XML into REST JSON | [`/capital-of/{country-code}`](http://localhost:8080/capital-of/US) | Convert the XML returned by a SOAP service that requires a POST of an XML body and answers with a complex XML into a GET REST endpoint answering with a simple JSON | +| Wildcards | [`/fake-api/*`](http://localhost:8080/fake-api/user/1.json) | Expose all sub-paths under a common location using a single endpoint definition | | Basic authentication | [`/fake-api-auth/*`](http://localhost:8080/fake-api-auth/user/1.json) | Expose information from internal service at fake API using wildcard and adding Basic Authentication | | Geolocation / Geofencing | [`/fake-api-geofence/*`](http://localhost:8080/fake-api-geofence/user/1.json) | Expose information from internal service at fake API using wildcard and applying geofencing (only accessible )
_Note: to use geofencing, you should download a [Maxmind GeoIP City database](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en) (commercial or free) and store it on `config/krakend/geoip/`_ | -| JWT-based Authentication | [`/private/auth0`](http://localhost:8080/private/auth0) | Protects and endpoint validating JWT tokens issued by Auth0 | -| API Keys based Authentication | [`/api-key`](http://localhost:8080/api-key) | Protects and endpoint using an API-Key | +| JWT-based Authentication | [`/private/auth0`](http://localhost:8080/private/auth0) | Protects and endpoint validating JWT tokens issued by Auth0. You can access http://localhost:3000/ to test it. | +| API Keys based Authentication | [`/api-key`](http://localhost:8080/api-key) | Protects and endpoint using an API-Key. You can use `curl -iG -H 'Authorization: Bearer 58427514-be32-0b52-b7c6-d01fada30497' 'http://localhost:8080/api-key'` to test it. | You will find more examples with comments in `config/krakend/krakend.json` diff --git a/docker-compose.yml b/docker-compose.yml index 40deba6..1fd3b73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3" services: krakend_ee: # The :watch image restarts the service automatically when the configuration files change.