An Omnivector initiative
Armasec Subscriptions
This plugin for Armasec provides a means to verify that a user accessing a secured endpoint also has an active submission.
The plugin verifies an active subscription by calling an endpoint that checking that the
user embedded in the auth token is an active subscriber. To enable the plugin, you need
only install it in your project's environment and set the environment variable
ARMASEC_SUB_URL to point to an endpoint that checks the user's subscription status by
comparing the sub claim in the access token against a list of subscribed users. The
endpoint should return a 200 if the user should have access and a 404 if the
subscription could not be found.
That's it! Once installed and configured, every secure endpoint will check for a subscription.
Quickstart
- Install
armasec-subscriptions
pip install armasec-subscriptions
- Set the
ARMSEC_SUB_URLenvironment variable:
export ARMSEC_SUB_URL=https://my-api.io/sub-check
Additional Options
The Armasec Subscriptions plugin caches requests to the ARMASEC_SUB_URL for
performance reasons. The cache key is the auth token itself. By default, the requests
are cached for 15 minutes. A typical auth token's access lifespan is shorter than 15
minutes, so it's probable that the token would be expired and require a refresh before
it expires in the cache. The cache automatically removes entries that are older than
the configured "Time to live" (TTL). If you wish to change the TTL for the cache, you
may set the environment variable ARMASEC_SUB_CACHE_TTL. The expected values are
integers representing the number of seconds for which each entry should be retained.
The cache retains a maximum of ~1 million entries by default. If you wish to change the
maximum size of the cache, you may set the environment varaible ARMASEC_SUB_CACHE_MAX.
The expected values are integers representing the maximum number of entries the cache
should retain.
You may also configure the plugin to allow READ operations for all routes. To enable
this, set the ARMASEC_SUB_ALLOW_READS environment variable flag.
You may also configure the plugin to allow DELETE operations for all routes. To enable
this, set the ARMASEC_SUB_ALLOW_DELETES environment variable flag.
License
Distributed under the MIT License. See LICENSE for more information.
Metadata
Release files for armasec-subscriptions 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| armasec_subscriptions-0.1.1.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| armasec_subscriptions-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / armasec_subscriptions-0.1.1.tar.gz
| Download URL | armasec_subscriptions-0.1.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ec964a57629291c28640c1c2649599d7cc0b0e75ee493b40e3df23bdadab1b0
|
|
BLAKE2b-256 checksum How to use checksums |
7e17eed09f5bacc7f5a539efca7619d369910b59f6da0fd1c593e9a6cd00d119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.8.17 Linux/6.5.0-1025-azure
|
Release files / armasec_subscriptions-0.1.1-py3-none-any.whl
| Download URL | armasec_subscriptions-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9facda2dd396117021f178449b72ef69c76035d084933cd45e85b2e5de6b1a81
|
|
BLAKE2b-256 checksum How to use checksums |
d8744763b9e965bf0899e21c7c01833c6898959cc3643188d745d620f37d144b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.8.17 Linux/6.5.0-1025-azure
|
Security for armasec-subscriptions 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.