Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
/ apigateway Public archive

⛩️ Unvarnished API Gateway with minimal features. Supports HTTP(S) and WebSocket traffic out of the box.

License

Notifications You must be signed in to change notification settings

baturalpk/apigateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@baturalpk/api-gateway ⛩️

✈ Getting started

go get github.com/baturalpk/apigateway

See examples/ folder for sample config.yaml and main.go files.

🔥 Works well with @baturalpk/auth-service as intended to be.

⚙ How does it work?

  1. Each request that matches with /auth/:intent schema, is forwarded to the auth service endpoints depending on the intents (i.e., signin, signout, signup).

  2. Each request that begins with /api/..., is evaluated to match with predefined paths (matchPaths[].value property in config.yaml):

    • If matching occurs, the gateway determines whether end-user is authorized by interacting with the auth service endpoint

    • If claimed authorization is valid:

      • Binds the unique identifier (i.e., ID) of verified user to the predefined header (auth.internal.idHeader property in config.yaml). By that way, internal services can trust this header to recognize the authenticated end-user.
      • Ultimately, the request of end-user is forwarded to the target service by reverse proxy.

😒 Some limitations

  • All auth service paths (e.g., signupPath) must allow HTTP POST method

  • After the successful validation of an end-user session, auth service must return a JSON response with the following property:

    id: "System-wide strictly unique identifier" of an end-user.

  • All requests, which are going towards internal services, must be fully authorized. For the time being, different paths that belong to same service cannot be excluded from authorization process conditionally. In brief, no public API endpoints yet!

About

⛩️ Unvarnished API Gateway with minimal features. Supports HTTP(S) and WebSocket traffic out of the box.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages