Gateway to the Kafka REST Proxy to do additional validation
786
Gateway to the Confluent Kafka REST Proxy. It does the authentication and authorization, content validation and decompression if needed.
The RADAR-Auth library is used for authentication and authorization of users. Refer to the documentation there for a full description of the configuration options.
Start the REST Proxy with
docker-compose up -d
Also make sure an instance of ManagementPortal is running. Set the details of that server in src/main/resources/radar-is.yml. Then run the local servlet with
./gradlew jettyRun
Now the gateway is accessible through http://localhost:8080/radar-gateway/.
Now you can access the REST proxy via the gateway:
curl -H 'Authorization: Bearer myAccessToken' http://localhost:8080/radar-gateway/topics
The access token should be generated by the aforementioned Management portal. The gateway does content validation for posted data. It requires to use the Avro format with JSON serialization, using the application/vnd.kafka.avro.v1+json or application/vnd.kafka.avro.v2+json media types, as described in the REST Proxy documentation. It also requires messages to have both a key and a value with schemas. The key should have a userId and sourceId field. The userId should match the sub field in the OAuth2 JWT access token. That JWT should also contain a sources array claim which should contain the given sourceId. Sources can be added in the ManagementPortal or be generated by the app dynamically and then registered with the ManagementPortal.
Data compressed with GZIP is decompressed if the Content-Encoding: gzip header is provided. With
curl, use the -H "Content-Encoding: gzip" --data-binary @data.json.gz flags.
Content type
Image
Digest
Size
77.5 MB
Last updated
almost 9 years ago
docker pull radarcns/radar-gateway