Auth module is one of the CBD3 python packages.
Provides functionality for authorization.
CBD3 uses the auth.yml
file to store broker's credentials
{group_name}:
{broker_name}:
token: {encrypted_token}
broker_info:
legal_name:
uk_UA: {broker_legal_name_ua}
en_US: {broker_legal_name_en}
ips:
- {broker_ip}
- {broker_ip}
procedures:
{procedure_type}:
- {access_right}
- {access_right}
{procedure_type}:
- {access_right}
- {access_right}
{group_name}
- name of brokers group{broker_name}
- name of broker{encrypted_token}
- encrypted broker's token{broker_legal_name_ua}
- legal name of broker (UA lang){broker_legal_name_en}
- legal name of broker (EN lang){broker_ip}
- broker ip/ips with accessIf ips
key does not exist - broker has access from any ip.
If ips: []
- broker does not have access.
{procedure_type}
- type of procedure
Options:
{access_right}
- access permission
Options:
auth.yml
brokers:
some_broker:
token: 123encryptedtoken123
broker_info:
legal_name:
uk_UA: Якийсь Брокер
en_US: Some Broker
ips:
- 255.255.255.255
- 0.0.0.0/24
procedures:
renewables:
- procedure
- bids
timber:
- procedure
- bids
subsoil:
- procedure
- bids
railwayCargo:
- procedure
- bids
System dependencies:
make run
make docker-build
make test-integration
To install package add it in Pipfile to package's group:
[packages]
- for minimally required packages[dev-packages]
- for development-only packages (test-requirements)If you don’t have any specific version requirements for your dependencies, you can use the wildcard character * to tell Pipenv that any version can be installed:
[packages]
numpy = "*"
If you want specify exact versions of requirements:
[packages]
numpy = "==1.14.1"
To specify greater than or equal version requirement:
[packages]
numpy = ">=1.14.1"
After adding package to Pipfile, you should update Pipfile.lock file in appropriate directory:
pipenv lock
You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead with required python version.
PIPENV_IGNORE_VIRTUALENVS=1 pipenv lock --python 3.9
Pipfile.lock file enables deterministic builds by specifying the exact requirements for reproducing an environment. It contains exact versions for packages and hashes to support more secure verification. Do not update this file manually!
There are two sources for packages:
pypi
- https://pypi.org/simple (default)prozorro
- https://pypi-int.prozorro.sale/If you’d like a specific package to be installed with a specific package index (e.g. from https://pypi-int.prozorro.sale/), you can do the following:
[packages]
prozorro-tools = {version="==0.14.0", index="prozorro"}
To generate sphinx docs
pip install -r requirements/docs.txt
make dev-docs