Giter Site home page Giter Site logo

stn1slv / meetup-authorization Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 7.0 6.41 MB

Sources for "Unified authorization in microservices (HTTP and Kafka-based interactions)" meetup

License: MIT License

Java 23.22% Dockerfile 12.17% Go 64.62%
kafka sasl golang oidc

meetup-authorization's Introduction

Demo case

The presentation from the meetup.

Demo case Demo case

Preparing

You have to add some entries to your /etc/hosts file:

127.0.0.1            keycloak
127.0.0.1            kafka

That's needed for host resolution because Kafka brokers and Kafka clients connecting to Keycloak have to use the same hostname to ensure the compatibility of generated access tokens. Also, when Kafka client connects to Kafka broker running inside docker image, the broker will redirect the client to kafka:9092.

Start infrastructure

Cleanup

docker rm keycloak kafka zookeeper

Startup

Go to docker directory of the repo:

cd docker

All the following docker-compose commands should be run from this directory.

Starting infra:

docker-compose -f compose.yml -f keycloak/compose.yml -f keycloak-import/compose.yml -f kafka-oauth-strimzi/compose-authz.yml up --build

Run and test

Console tools

โš ๏ธ Before using Kafka console apps, you should add strimzi libs to your Kafka libs directory. To do this, clone strimzi-kafka-oauth repository and follow the steps on the link.

Produce

Service-A

kafka-console-producer.sh --broker-list kafka:9092 --topic a_messages --producer.config=service-a.properties

Service-C

kafka-console-producer.sh --broker-list kafka:9092 --topic a_messages --producer.config=service-c.properties
Consume

Service-B

kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic a_messages --from-beginning --consumer.config=service-b.properties --group a_consumer_group_1

Run demo apps

Service-A
cd service-a
mvn spring-boot:run
Service-B
cd service-b
mvn spring-boot:run
Service-C
cd service-c
go run main.go
Service-D
cd service-d
go run main.go

meetup-authorization's People

Contributors

stn1slv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.