Skip to content

Latest commit

 

History

History
60 lines (32 loc) · 2.7 KB

architecture.md

File metadata and controls

60 lines (32 loc) · 2.7 KB

TL;DR;

The design is minimal and incomplete on purpose, so is the code too. Things would evolve around discussions, requirements changes, issues, etc.

Rationale

Scope

This project contains is a proxy for granting access to a micro-service via JWT token authentication.

Main functionality

The "Client/UI" authenticates the user against an IDP (Identity Provider-Oauth2) and then request data from a micro-service. Some "known urls" of the micro-service are to be protected from malicious access via JWT token authentication.

Solution design

Deployment view

The public facing Kubernetes "Service" of the micro-service would be connected to the sidecar (instead of the micro-service container itself).

  • The configuration is to be specified in a Kubernetes "DEPLOYMENT" YAML descriptor.
  • The sidecar runs within an embedded Jetty server. It initializes its configuration from environment variables injected in a Kubernetes "DEPLOYMENT".

Deployment

Process view

No authentication is performed against public URIs:

  • If the URI is protected, the request must contain a valid JWT token with expected claims.
  • Once the claims are extracted, user data is injected in the request and forwarded to the proxied micro-service.

Deployment

Detailed design

Main software libraries

Runtime dependencies

Embedded Jetty as app server, Nimbuds JOSE+JWT for JWT matters, Mitre Proxy servlet

Test dependencies

Hamcrest, Junit and JMockit

Components collaboration

The business logic is just driven by a servlet filter that relies on a "public URIs container" and a JWT authentication service. Additional sub-components and abstractions are left to the discretion of the implementer.

Flow

Class diagram

Please find below the core classes.

Core classes