Coder Social home page Coder Social logo

sidecus / authzyin Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 5.66 MB

asp.net core library and React library enables server & client policy based authorization by defining just once and code less

License: MIT License

C# 99.39% Dockerfile 0.61%
asp-net-core authorization authorization-framework react typescript hooks policy

authzyin's People

Contributors

dependabot[bot] avatar sidecus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

authzyin's Issues

Important - pkg manager changed to yarn after 6/17/2020

I've been battling for a day with building this on both my Mac and PC due to this known npm issue.
After a day with no luck I decided to switch to yarn instead with this PR #6 .

If you have this repo before, this will cause an interruption to your local build after syncing the new commits.
Please make sure you install yarn and clean up the npm build related files first (please make sure you don't have any uncommitted changes):

npm install -g yarn
git clean -xdf

Then just F5 from VSCode or dotnet run from the sample folder. I added custom dotnet build tasks to help with automatic yarn dependency restore and authzyin.js lib building in the same commit.

Provide an option for Client to handle camel case and Pascal case

By default asp.net core serializes AuthZyinContext property names as camel case. To reuse the JSON path requirement definitions on the client, right now a brute force ToLowerCase is done on the client for each property name reference before the JSON path evaluation.

We should:

  1. Give user an option to turn on/off this behavior (e.g. user website might have a global setting to use Pascal case for JSON serialization and in that case there is no need for special JsonPath processing on the client).
  2. Use a more efficient way to process the JSON pathes instead of doing that before each evaluation.

Simplify client lib usage

Right now the client lib is a bit harder to use - for example user is responsible for loading and saving the AuthZyinContext to some global state which can be used by the useAuthorize hooks.

We need to make it simpler.

Need an option for users to use the client lib only

This repo contains both a server library and a client library to share policy/requirement based authorization.
Certain users might only want to use the client library - for example the server stack might not be using asp.net core.
Providing an option for users to use the client library standalone will maximize the potential benefits.

One potential solution is to let user provide their AuthZyinContext object as part of the initializeAuthZyinContext call.

Reduce network traffic when there are a lot of policies and requirements

Now we are serializing all policies and their requirements to the client. If there are many policies the data can be big - there is unnecessary network bandwidth used when a lot of requirements are being reused in different policies.

It can be optimized by putting all requirement definitions to an array and use references to requirements (like an id) in the policy definitions.

It's low pri but can be a future enhancement.

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.