Git Product home page Git Product logo

authzerizer's Introduction

authzerizer

A simple API AuthZ subsystem when your IdP doesn't support OAuth2 scopes

Context

  • You have an API that's called by processes or other APIs.
  • You must authorize access to API routes.
  • You aren't using an API gateway.
  • Your OAuth2 provider doesn't support scopes.
  • Your OAuth2 provider uses client ids that aren't supported by any available authorization system.
  • Your list of client ids and scopes is relatively small.

This context may sound strange, but maybe there's a reason I think this is worth building.

Planned solution

  • Maintain a list of allowed scopes and scopes granted to OAuth2 client ids in a database.
  • Cache the list in memory on startup.
  • Provide admin endpoints to GET, POST, PUT (update), DELETE client id scope grants in the database.
    • On POST, PUT, DELETE, update cache
  • Get admin client id(s) from an environment variable.

For development and proof of concept, I'll start with a simple API with a couple of demo endpoints, then build the code and endpoints that use it.

Technology decisions

  • API: Node, TypeScript, Express
  • ORM: probably Prisma (because next point)
  • Database: Given the implications of the context, something SQL
    • In my case, Postgres because I already have one handy (in Docker).

Ideas for the future

  • Fastify version
  • No-cache option (always read database)
  • AuthN features ???
  • UI for admin ???
  • Alternative to SQL ??? (excuse to dig into micro-database options)
  • Admin endpoints to GET, POST, PUT (update), DELETE allowed scopes in the database ???
    • On DELETE, remove scopes from any client id grants.

License

MIT.

Request, not a requirement: If you use this, port it to some other Node web framework, Java, C#, Carbon, Lua, AAAAAAAAAAAAAA!!!!, whatever, I'd appreciate a credit and a link if possible.

authzerizer's People

Contributors

jmjf avatar

Watchers

 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.