Skip to main content

AARC Entitlement Library

This package provides python classes to create, parse and compare entitlements according to the AARC recommendations G002 and G069.

Installation

Install using pip:

pip install aarc-entitlement

Documentation

The documentation is available at https://aarcentitlement.readthedocs.io.

The G002 recommendation can be found at https://aarc-community.org/guidelines/aarc-g002.

Examples

Check if a user entitlement permits usage of a service

import aarc_entitlement

# This entitlement is needed to use a service
required = aarc_entitlement.G002("urn:geant:h-df.de:group:aai-admin")

# This entitlement is held by a user who wants to use the service
actual =   aarc_entitlement.G002("urn:geant:h-df.de:group:aai-admin:role=member")

# Is the user permitted to use the service, because of its entitlement `actual`?
permitted = actual.satisfies(required)
# -> True here

# Are the two entitlements the same?
equals = required == actual
# -> False here

G069 Entitlement Normalization

Starting with recommendation G069 the specification requires normalization of entitlements. When using AarcEntitlementG069 the library produces normalized representations.

import aarc_entitlement

not_normalized = "UrN:NiD:ExAmPlE.oRg:group:Minun%20Ryhm%c3%a4ni"

normalized = repr(aarc_entitlement.G069(not_normalized))
# -> "urn:nid:example.org:group:Minun%20Ryhm%C3%A4ni"

Tests, Linting and Documentation

Run tests for all supported python versions:

# run tests, coverage and linter
tox

# build docs
tox -e docs

# After this, the documentation should be located at `doc/build/index.html`.

Packaging

To upload a new package version to pypi use the Makefile:

# build the package
make dist

# upload the package to pypi
make upload

Funding Notice

The AARC project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 653965 and 730941.

Metadata

Release files for aarc-entitlement 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aarc-entitlement 1.0.5
File Size Uploaded
aarc_entitlement-1.0.5.tar.gz 26.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aarc-entitlement 1.0.5
File Interpreter ABI Platform
aarc_entitlement-1.0.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 36.9 kB

Release files / aarc_entitlement-1.0.5.tar.gz

Download URL aarc_entitlement-1.0.5.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b149c7ac00124d4d0951eeaf9970f8def6798f6b88def454e720356645fd8204
BLAKE2b-256 checksum
How to use checksums
57f6a44c4845da0c9b6145124020b35f2422669fd51f7ac0b509cbf5f6ee556a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release files / aarc_entitlement-1.0.5-py2.py3-none-any.whl

Download URL aarc_entitlement-1.0.5-py2.py3-none-any.whl
Size 10.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8debce4f8d37227decfaec0a1d5f93a39e63c531d6511d1117bc14f1ac36da56
BLAKE2b-256 checksum
How to use checksums
a1b6258a1aeb103f535f5d4f0149b04a27d2f8c35a688ff2933b0992366b1dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page