Skip to main content

A graph based authorization library

Project description

permission-graph

A graph based authorization library

Overview

The permissions graph consists of Vertices and Edges.

Vertices

  • Resource: a resource with predefined actions requiring authorization
  • Actor: an identity that will take actions on resources
  • Group: a named collection of Actors
  • Action: an action on a resource

Edges

  • MemberOf: indicates membership in a collection
    • Actor -> MemberOf -> Group
    • Action -> MemberOf -> Resource
  • Allow: indicates positive permission to act on a resource
    • Actor -> Allow -> Action
    • Group -> Allow -> Action
    • Action -> Allow -> Action
  • Deny: indicates negative permission to act on a resource
    • Actor -> Deny -> Action
    • Group -> Deny -> Action
    • Action -> Deny -> Action
flowchart
    Actor -->|MemberOf|Group -->|Deny| Action -->|MemberOf| Resource
    Actor -->|Allow| Action -->|Allow| Action2 -->|MemberOf| Resource2

Authorizing Access

Authorization to act on a resource is decided by finding the shortest path between a actor and the action to be performed. If that shortest path is an ALLOW rule, the actor is authorized. If that shortest path is a DENY rule, or if there is no path between the actor and the action, the actor is not authorized.

In the event there is a tie for shortest path, the access will be denied only if all shortest paths are DENY rules. This behavior can be controlled when initializing the permission graph via the tie_breaker_policy parameter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

permission_graph-0.1.0a1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

permission_graph-0.1.0a1-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page