No project description provided
Project description
Assertions Mate
assertions-mate validates CWL workflow inputs against assertion hints embedded in the workflow definition.
It adds policy and rule checks on top of CWL typing by supporting:
- JSON Schema validation
- Rego policy validation (OPA)
- CQL2 expression validation
Documentation site: https://terradue.github.io/assertions-mate/
Why Use It
When a CWL workflow needs stricter runtime checks (business rules, policy constraints, geospatial conditions), assertions-mate lets you define them as workflow hints and evaluate them against an input payload before execution.
Installation
From source (recommended for development)
git clone https://github.com/Terradue/assertions-mate.git
cd assertions-mate
pip install -e .
Runtime requirements
- Python
>= 3.10 - Dependencies are managed in
pyproject.toml
Command Line Usage
After installation, run:
assertions-mate path/to/workflow.cwl --inputs path/to/inputs.yaml
What happens:
- The CWL document is loaded.
- Assertion hints are discovered from
workflow.hints. - Matching validators are built and executed against the input mapping.
- Validation issues are reported with pointer and detail messages.
Supported Assertion Hints
The tool maps eoap: hint classes to internal validators:
eoap:JSONSchemaHinteoap:RegoPolicyHinteoap:Cql2FilterHint
Example hints snippet
hints:
- class: eoap:JSONSchemaHint
json_schema:
type: object
required: [count]
properties:
count:
type: integer
minimum: 1
- class: eoap:RegoPolicyHint
module: |
package workflow
deny contains "count must be <= 10" if {
input.count > 10
}
queries:
- data.workflow.deny[_]
- class: eoap:Cql2FilterHint
queries:
- id: cql-rule-1
cql2: "count > 0"
message: "count must be greater than zero"
Development
This project uses Hatch environments and pytest.
# Run tests
hatch run test:test-q
# Run formatting check
hatch run dev:lint
# Run lint checks with fixes
hatch run dev:check
If you use Taskfile:
task test
task lint
task check
Project Layout
src/assertions_mate/core package and CLItests/unit testsschemas/CWL hint schema definitionsdocs/notebooks and documentation sources
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file assertions_mate-0.2.0.tar.gz.
File metadata
- Download URL: assertions_mate-0.2.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caea0cbd1c9e707b2f2e62b45d1340970c9546a3288c5ef8c0230bd3c8bc4e49
|
|
| MD5 |
f57ee65023f6b4832124e51a6c1efe16
|
|
| BLAKE2b-256 |
7dd2f89e063f24280feb9fa0ddc7d68909d910a6590f4ef3f5a52cbbec961527
|
Provenance
The following attestation bundles were made for assertions_mate-0.2.0.tar.gz:
Publisher:
package.yaml on Terradue/assertions-mate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
assertions_mate-0.2.0.tar.gz -
Subject digest:
caea0cbd1c9e707b2f2e62b45d1340970c9546a3288c5ef8c0230bd3c8bc4e49 - Sigstore transparency entry: 1051220431
- Sigstore integration time:
-
Permalink:
Terradue/assertions-mate@a9367b55d93ecb1d912026e930708123fd55f659 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Terradue
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@a9367b55d93ecb1d912026e930708123fd55f659 -
Trigger Event:
push
-
Statement type:
File details
Details for the file assertions_mate-0.2.0-py3-none-any.whl.
File metadata
- Download URL: assertions_mate-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f1418e4edd0bfcab3854c29dbd646cbd7381e98427131c26f4833c5f9b49968
|
|
| MD5 |
ece9142cd8f339faabb2a5f4511a1ece
|
|
| BLAKE2b-256 |
3d1db6f0d182e4b031931d5a0bec92d0e83ca4b00916891d0d91e13c8968a92a
|
Provenance
The following attestation bundles were made for assertions_mate-0.2.0-py3-none-any.whl:
Publisher:
package.yaml on Terradue/assertions-mate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
assertions_mate-0.2.0-py3-none-any.whl -
Subject digest:
6f1418e4edd0bfcab3854c29dbd646cbd7381e98427131c26f4833c5f9b49968 - Sigstore transparency entry: 1051220505
- Sigstore integration time:
-
Permalink:
Terradue/assertions-mate@a9367b55d93ecb1d912026e930708123fd55f659 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Terradue
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@a9367b55d93ecb1d912026e930708123fd55f659 -
Trigger Event:
push
-
Statement type: