py_volumn_test
This simple volumn testing framework for linux platform.
Requirements
The application requires
- python 3.12+
- requires
dfcommand - hashicorp vault
Setup
Hashicorp Vault
Assume
- we create secret on mount point (mp)
- we create secret on path (abc)
- we create a policy of
policy-mp-abc - we create a approle of
ar-mp-abc
Create policy
by creating a hashicorp policy xxx.hcl
# assume `{mount_point}` is `mp`
# assume `{path}` is `abc`
# access the secret in cli `vault kv get mp/abc`
# The actual path of the secret is `mp/data/abc`
path "{mount_point}/data/{path}/*" {
capabilities = ["read"]
}
Insert or update the policy by
vault policy write {policy_name} {policy_file}
# vault policy write policy-mp-abc xxx.hcl
Create app role
# ------ create app role
vault write auth/approle/role/{app role name} token_policies="{policy name}" token_ttl="15m" token_max_ttl="2h"
# vault write auth/approle/role/ar-mp-abc token_policies="policy-mp-abc" token_ttl="15m" token_max_ttl="2h"
vault write auth/approle/role/{app role name} token_policies="{policy name}" token_ttl="15m" token_max_ttl="2h"
# ------ get role id
# The command return the role id
vault read auth/approle/role/{app role name}/role-id
# vault read auth/approle/role/ar-mp-abc/role-id
# ------ get secret id
# The command return the secret id (the secret is force to be generated, without re-view the secret id)
vault write -f auth/approle/role/{app role name}/secret-id
# vault write -f auth/approle/role/ar-mp-abc/secret-id
# ------ login the vault in env
# assume the role_id is `vault_role_id`
# assume the secret_id is `vault_secret_id`
export VAULT_TOKEN="$(vault write -format=json auth/approle/login role_id=$vault_role_id secret_id=$vault_secret_id | jq -r '.auth.client_token')"
Create secret
vault kv put mp/abc \
api_key=$api_key \ # api key is the api key for restdb.io
host=$host \ # host is url
collection_name=$collection_name \ # collection name is the collection name
filter_name=$filter_name \ # filter name is the configuration name to filter
bootstrap_id=$bootstrap_id # the entry point to access
Run application
df | \
docker run \
-e VAULT_ADDR="$VAULT_ADDR" \
-e vault_role_id="$vault_role_id" \
-e vault_secret_id=$vault_secret_id \
-e vault_mount_point=$vault_mount_point \
-e vault_secret_path=$vault_secret_path \
-i py-volumn-test
Metadata
Release files for py-volumn-test 0.0.2
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 | Actions |
|---|---|---|---|---|
| py_volumn_test-0.0.2.tar.gz | 16.7 kB | Without provenance | Details for py_volumn_test-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_volumn_test-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for py_volumn_test-0.0.2-py3-none-any.whl |
Total release size: 33.8 kB
Release files / py_volumn_test-0.0.2.tar.gz
| Download URL | py_volumn_test-0.0.2.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aee22ff780f84624b6f8a2d4220e5e045bc74e24de899ef70c81b71c1bccaf7d
|
|
BLAKE2b-256 checksum How to use checksums |
bea4920a7466a1027d851537cf255452bb8777fe99a375d6f3b40523e6c46e4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / py_volumn_test-0.0.2-py3-none-any.whl
| Download URL | py_volumn_test-0.0.2-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e276ae338e2c2dc60d6a0a9a62a22f519a3f7e8d6f2d6300ac66857216e7bbd1
|
|
BLAKE2b-256 checksum How to use checksums |
cc5ea41e41e2b87f87ccc7e324465ec55051d73a80bdc6e759c9efb0cebb3065
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for py-volumn-test 0.0.2
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.