Skip to main content

Authorization engine providing fine grained access while you control the data. Aimed at being easy to use and implement without overtaking other parts of your system.

Project description

Scopie-py

PyPI - Version Static Badge

Python implementation of scopie.

from scopie import is_allowed

users = {
    "elsa": {
        "rules": ["allow/blog/create|update"],
    },
    "bella": {
        "rules": ["allow/blog/create"],
    },
}

blogPosts = {}

def create_blog(username, blogSlug, blogContent):
    user = users[username]
    if is_allowed(["blog/create"], user["rules"]):
        blogPosts[blogSlug] = {
            "author": user,
            "content": blogContent,
        }

def update_blog(username, blogSlug, blogContent):
    user = users[username]
    if is_allowed(["blog/update"], user["rules"]):
        blogPosts[blogSlug] = {
            "author": user,
            "content": blogContent,
        }

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

scopie-0.3.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scopie-0.3.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file scopie-0.3.0.tar.gz.

File metadata

  • Download URL: scopie-0.3.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scopie-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a0f40e39b5b840a51a65ea27e1d044673ec5e4f545483ec23c3f5b1ee5aac443
MD5 46d84979db525228a2307fefac917bc9
BLAKE2b-256 9c1a465014e6fd1c3909a239131eb3cfc2031dbdfaac7f2e753cd4b7ac5a204b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopie-0.3.0.tar.gz:

Publisher: release.yml on miniscruff/scopie-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scopie-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: scopie-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scopie-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9afc65a37961f3a03ff7c88ba938dd5f21a7918f859d7c44af4b9c9de93632a5
MD5 93d0f4b20f93c2738e92d230675bd810
BLAKE2b-256 7cffe133b1c43124be1b9b969d087773077cb60a087cd97766fb0332f75a1be4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopie-0.3.0-py3-none-any.whl:

Publisher: release.yml on miniscruff/scopie-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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