oscal-bindings 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oscal_bindings-0.1.0/.gitignore +32 -0
- oscal_bindings-0.1.0/DEVELOPING.md +191 -0
- oscal_bindings-0.1.0/LICENSE +202 -0
- oscal_bindings-0.1.0/NOTICE +15 -0
- oscal_bindings-0.1.0/PKG-INFO +271 -0
- oscal_bindings-0.1.0/README.md +243 -0
- oscal_bindings-0.1.0/pyproject.toml +200 -0
- oscal_bindings-0.1.0/requirements/requirements-hatch-build.txt +30 -0
- oscal_bindings-0.1.0/requirements/requirements-hatch-test.py3.11.txt +477 -0
- oscal_bindings-0.1.0/requirements/requirements-hatch-test.py3.12.txt +477 -0
- oscal_bindings-0.1.0/requirements.txt +776 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_assessment-plan_schema.json +3320 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_assessment-results_schema.json +3473 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_catalog_schema.json +1295 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_complete_schema.json +6022 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_component-definition_schema.json +1821 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_mapping-collection_schema.json +1569 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_plan-of-action-and-milestones_schema.json +3383 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_profile_schema.json +1616 -0
- oscal_bindings-0.1.0/schemas/1.2.3/oscal_system-security-plan_schema.json +2331 -0
- oscal_bindings-0.1.0/scripts/postprocess_models.py +642 -0
- oscal_bindings-0.1.0/src/oscal_bindings/__init__.py +46 -0
- oscal_bindings-0.1.0/src/oscal_bindings/extensions/__init__.py +18 -0
- oscal_bindings-0.1.0/src/oscal_bindings/models.py +15 -0
- oscal_bindings-0.1.0/src/oscal_bindings/parser.py +64 -0
- oscal_bindings-0.1.0/src/oscal_bindings/py.typed +0 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/__init__.py +118 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/extensions/__init__.py +35 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/extensions/builders.py +79 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/extensions/document.py +216 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/extensions/validate_element.py +96 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/models.py +6972 -0
- oscal_bindings-0.1.0/src/oscal_bindings/v1/parser.py +193 -0
- oscal_bindings-0.1.0/tests/support/__init__.py +8 -0
- oscal_bindings-0.1.0/tests/support/corpus.py +312 -0
- oscal_bindings-0.1.0/tests/support/version_package.py +96 -0
- oscal_bindings-0.1.0/tests/test_builders.py +108 -0
- oscal_bindings-0.1.0/tests/test_document.py +395 -0
- oscal_bindings-0.1.0/tests/test_lint_config.py +204 -0
- oscal_bindings-0.1.0/tests/test_oscal_bindings.py +193 -0
- oscal_bindings-0.1.0/tests/test_parser.py +330 -0
- oscal_bindings-0.1.0/tests/test_postprocess.py +587 -0
- oscal_bindings-0.1.0/tests/test_prop_lint_config.py +598 -0
- oscal_bindings-0.1.0/tests/test_prop_postprocess.py +359 -0
- oscal_bindings-0.1.0/tests/test_prop_version_package.py +204 -0
- oscal_bindings-0.1.0/tests/test_validate_element.py +104 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Build artifacts
|
|
2
|
+
/build/
|
|
3
|
+
/dist/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
|
|
6
|
+
# Hatch / venv
|
|
7
|
+
/.hatch/
|
|
8
|
+
.venv/
|
|
9
|
+
|
|
10
|
+
# Coverage
|
|
11
|
+
.coverage
|
|
12
|
+
.coverage.*
|
|
13
|
+
/htmlcov/
|
|
14
|
+
|
|
15
|
+
# Python
|
|
16
|
+
__pycache__/
|
|
17
|
+
*.py[cod]
|
|
18
|
+
.mypy_cache
|
|
19
|
+
.ruff_cache
|
|
20
|
+
.pytest_cache
|
|
21
|
+
|
|
22
|
+
# Property-based testing: remote corpus cache and Hypothesis example database
|
|
23
|
+
/tests/.corpus_cache/
|
|
24
|
+
.hypothesis/
|
|
25
|
+
|
|
26
|
+
# Kiro: per-machine editor settings and spec execution history. Specs
|
|
27
|
+
# (requirements/design/tasks) and steering are committed.
|
|
28
|
+
/.kiro/settings/
|
|
29
|
+
/.kiro/specs/**/tasks.meta.json
|
|
30
|
+
|
|
31
|
+
.DS_Store
|
|
32
|
+
tmp
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Developing oscal-bindings (Python)
|
|
2
|
+
|
|
3
|
+
## Workspace Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
mise install --locked python uv pypi:hatch # toolchain from mise.toml / mise.lock
|
|
7
|
+
hatch run release # generates models, runs tests, builds docs
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Hatch comes only from mise (see "Locked Environments"). If you have Hatch from pip,
|
|
11
|
+
pipx, or brew, uninstall it so there's a single Hatch on the machine.
|
|
12
|
+
|
|
13
|
+
## Development Workflow
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
hatch run generate # regenerate models from schema + post-process
|
|
17
|
+
hatch test --all --cover # run tests with coverage across Python 3.11/3.12
|
|
18
|
+
hatch run lint # ruff check . && ruff format --check . (read-only)
|
|
19
|
+
hatch run ruff format . # apply formatting
|
|
20
|
+
hatch run docs # generate pdoc API docs
|
|
21
|
+
hatch run release # full pipeline: generate + lint + typing + test + coverage + docs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`hatch run lint` is the only lint/format entry point. It uses the Ruff pinned in the
|
|
25
|
+
default env and the `[tool.ruff]` config in `pyproject.toml`, and `release` runs it
|
|
26
|
+
right after `generate`. `hatch fmt` and `hatch check code` are not used here: they run
|
|
27
|
+
in Hatch's `hatch-static-analysis` environment, which has Hatch's own ruleset and a
|
|
28
|
+
line length of 120. That environment is intentionally left unrepaired, so don't fix it.
|
|
29
|
+
Repairing it would bring back a second lint path with a different config.
|
|
30
|
+
|
|
31
|
+
## Locked Environments
|
|
32
|
+
|
|
33
|
+
Every Hatch env installs from a hashed lockfile generated by `hatch-pip-compile`
|
|
34
|
+
(resolved and installed with `uv`): `requirements.txt` for `default`,
|
|
35
|
+
`requirements/requirements-hatch-test.py3.{11,12}.txt` for the test matrix, and
|
|
36
|
+
`requirements/requirements-hatch-build.txt` for the build frontend. `hatch-test` is
|
|
37
|
+
constrained by `default`, so shared packages resolve to the same versions. The build
|
|
38
|
+
backend is pinned exactly in `[build-system]`, because build isolation fetches it
|
|
39
|
+
outside any lockfile.
|
|
40
|
+
|
|
41
|
+
The locks matter for more than test stability. `datamodel-code-generator` formats its
|
|
42
|
+
output with black and isort, which are its transitive dependencies. Without the lock,
|
|
43
|
+
a new black release could change `v1/models.py` with no change in this repo.
|
|
44
|
+
|
|
45
|
+
- Hatch re-locks an env automatically when its declared dependencies in
|
|
46
|
+
`pyproject.toml` change. Commit the updated lockfile with that change.
|
|
47
|
+
- To upgrade on purpose: `PIP_COMPILE_UPGRADE=1 hatch env run --env default -- python --version`,
|
|
48
|
+
then the same with `--env hatch-test`. Afterwards, run `hatch run generate` and
|
|
49
|
+
review any `models.py` diff as formatter drift.
|
|
50
|
+
- Hatch itself comes from mise, pinned in `mise.toml` together with the
|
|
51
|
+
`hatch-pip-compile` plugin and locked with its full dependency graph in `mise.lock`
|
|
52
|
+
and `.mise/locks/`. CI installs from the same files. Don't install Hatch any other
|
|
53
|
+
way (pip, pipx, brew). To bump it, edit the version in `mise.toml` and run
|
|
54
|
+
`mise lock` and then `mise install --locked python uv pypi:hatch`. The `hatch-test`
|
|
55
|
+
lockfiles depend on the Hatch version, because Hatch supplies that env's default
|
|
56
|
+
pytest/coverage ranges, so also run `hatch test --all` and commit the re-locked
|
|
57
|
+
`requirements-hatch-test.*.txt` files.
|
|
58
|
+
- Do not add `mypy --install-types`: it installs stubs at run time, outside the lock.
|
|
59
|
+
Declare any stub packages mypy needs in the default env's `dependencies`.
|
|
60
|
+
|
|
61
|
+
## Code Generation Pipeline
|
|
62
|
+
|
|
63
|
+
1. `datamodel-codegen` converts the OSCAL JSON Schema to Pydantic v2 models (`src/oscal_bindings/v1/models.py`)
|
|
64
|
+
- Key flags: `--collapse-root-models`, `--use-annotated`, `--field-constraints`, `--reuse-model`
|
|
65
|
+
2. `scripts/postprocess_models.py` renames classes from schema namespace paths to clean short names and renames the root model to `OscalDocument`
|
|
66
|
+
|
|
67
|
+
Both steps take the schema and models paths explicitly — the `generate` script in
|
|
68
|
+
`pyproject.toml` passes `--input`/`--output` to the generator and `--schema`/`--models`
|
|
69
|
+
to the post-processor. Omitting either post-processor argument falls back to that
|
|
70
|
+
argument's own default (`schemas/<ACTIVE_SCHEMA_RELEASE>/oscal_complete_schema.json`
|
|
71
|
+
and `src/oscal_bindings/v1/models.py`); a missing path is a non-zero exit, not a
|
|
72
|
+
silent no-op.
|
|
73
|
+
|
|
74
|
+
The wrapper rename map is **schema-derived, not positional**. The post-processor scans
|
|
75
|
+
the generated source for wrapper classes, reads each one's single body field (ignoring
|
|
76
|
+
the `$schema` directive field), and publishes `<RootKey in PascalCase>Document` — so
|
|
77
|
+
`catalog` → `CatalogDocument` regardless of the `Model1..8` ordinal the generator
|
|
78
|
+
happened to assign. Two guards back it: an ambiguous wrapper (more than one body
|
|
79
|
+
field) fails fast on the first offender, and a derived wrapper count that disagrees
|
|
80
|
+
with the number of document types in the schema's top-level `oneOf` exits non-zero
|
|
81
|
+
with both counts. A third guard catches duplicate `class <Name>(` definitions after
|
|
82
|
+
all renames, accumulating every collision not covered by `COLLISION_OVERRIDES` into a
|
|
83
|
+
single report rather than writing a file with colliding definitions.
|
|
84
|
+
|
|
85
|
+
## Refreshing to a new OSCAL release
|
|
86
|
+
|
|
87
|
+
Schemas are vendored per release under `schemas/<release>/`, filenames unchanged. The
|
|
88
|
+
active bundle is selected **by explicit path only** — nothing scans, globs, or orders
|
|
89
|
+
the `schemas/` directory, so adding a bundle changes nothing until the paths change.
|
|
90
|
+
|
|
91
|
+
1. Add the new release's schema set under `schemas/<release>/` (keep the existing
|
|
92
|
+
bundle in place; the directories are a visible, reviewable history).
|
|
93
|
+
2. Point the three references at the new release: `ACTIVE_SCHEMA_RELEASE` in
|
|
94
|
+
`scripts/postprocess_models.py`, and the `--input` / `--schema` paths in the
|
|
95
|
+
`generate` script in `pyproject.toml`.
|
|
96
|
+
3. Update `__oscal_schema_version__` in `src/oscal_bindings/v1/__init__.py` to the new
|
|
97
|
+
release. It must match the release element of the schema `$id`
|
|
98
|
+
(`ns/oscal/1.0/<release>/…`).
|
|
99
|
+
4. Run `hatch run generate` and review the `models.py` diff as schema-driven change
|
|
100
|
+
only. If the collision guard fires, add the new names to `COLLISION_OVERRIDES`
|
|
101
|
+
deliberately rather than suppressing the guard.
|
|
102
|
+
5. Confirm all eight wrapper names survive and run `hatch test --all`.
|
|
103
|
+
|
|
104
|
+
A minor or patch refresh regenerates `oscal_bindings.v1` in place. The package name
|
|
105
|
+
changes only for a new OSCAL **major** version.
|
|
106
|
+
|
|
107
|
+
## Key Design Decisions
|
|
108
|
+
|
|
109
|
+
- **No RootModel wrappers for scalars** — fields like `uuid` are plain `str` with `Annotated` constraints, not wrapper objects.
|
|
110
|
+
- **Clean class names** — derived from the part after `:` in the schema `$id` (e.g., `Parameter` not `OscalCompleteOscalControlCommonParameter`).
|
|
111
|
+
- **Typed parser functions** — `parse_catalog()`, `parse_profile()`, etc. for type-safe document access.
|
|
112
|
+
- **Collision handling** — 5 name collisions use module prefix (e.g., `SspControlImplementation` vs `ComponentDefinitionControlImplementation`).
|
|
113
|
+
- **Hand-written extensions, not patched generated code** — uniform accessors (`OscalDoc`) and back-matter builders live under `extensions/` rather than being injected into `models.py`. This keeps the codegen pipeline a pristine `datamodel-codegen` run + a rename-only post-pass; convenience layers can evolve without touching generated output.
|
|
114
|
+
- **Major-version namespace** — the bindings live in `oscal_bindings.v1`, named for the OSCAL major version with no minor or patch component. OSCAL is backward-compatible within a major version (newer schemas accept older documents; minor bumps have not added required fields), so the compatibility boundary is the major version and one binding set covers every 1.x producer. A minor-version namespace (`v1_2`, `v1_3`) was considered and rejected: it would encode a break at each routine refresh that does not exist. `__oscal_schema_version__` records the exact release the models were generated from. This mirrors NIST's own schema `$id` (`ns/oscal/1.0/1.2.2/...`), which scopes the namespace to the major line and hangs the release off it. OSCAL 2.0 is the trigger for a second version package; nothing is factored out between version packages before then, because the seam is unknowable until 2.0's differences are in hand.
|
|
115
|
+
- **Strict models tie coverage to the vendored release** — every model carries `extra='forbid'`, so bindings generated from 1.2.3 reject a later 1.x document that uses a new field. "Supports OSCAL 1.x" therefore means "supports the vendored release and earlier"; `__oscal_schema_version__` makes that gap visible. `extra='ignore'` was rejected because `serialize_oscal` would silently drop unknown fields. An opt-in lenient mode is deferred, not rejected.
|
|
116
|
+
- **Top level re-exports the version package** — `oscal_bindings/__init__.py` and the alias modules `oscal_bindings/models.py`, `oscal_bindings/parser.py`, `oscal_bindings/extensions/__init__.py` are pure re-exports from their `v1` counterparts. Names reached through either path are the same objects, so `oscal_bindings.X` and `oscal_bindings.v1.X` are interchangeable.
|
|
117
|
+
|
|
118
|
+
## File Structure
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
src/oscal_bindings/
|
|
122
|
+
__init__.py # Re-exports oscal_bindings.v1
|
|
123
|
+
models.py # Alias module → v1.models
|
|
124
|
+
parser.py # Alias module → v1.parser
|
|
125
|
+
extensions/__init__.py # Alias module → v1.extensions
|
|
126
|
+
v1/ # OSCAL 1.x version package (the implementation)
|
|
127
|
+
__init__.py # Public API re-exports + __oscal_schema_version__
|
|
128
|
+
models.py # Generated + post-processed Pydantic models
|
|
129
|
+
parser.py # parse/serialize/validate + per-type typed parsers
|
|
130
|
+
extensions/ # Hand-written helpers layered on the generated models
|
|
131
|
+
__init__.py
|
|
132
|
+
document.py # OscalDoc facade (uniform accessors)
|
|
133
|
+
builders.py # make_hash / make_rlink / make_resource
|
|
134
|
+
validate_element.py # Element-level schema validation
|
|
135
|
+
schemas/
|
|
136
|
+
1.2.2/ # Vendored schema bundles, one directory per OSCAL release
|
|
137
|
+
1.2.3/ # Active bundle (selected by explicit path)
|
|
138
|
+
scripts/
|
|
139
|
+
postprocess_models.py # Class renaming, rename derivation, and guards
|
|
140
|
+
tests/
|
|
141
|
+
test_parser.py # Parser / serializer / validator tests
|
|
142
|
+
test_document.py # OscalDoc facade tests
|
|
143
|
+
test_builders.py # back-matter builder tests
|
|
144
|
+
test_validate_element.py # validate_element tests
|
|
145
|
+
test_oscal_bindings.py # Import smoke + top-level/v1 path parity tests
|
|
146
|
+
test_postprocess.py # Post-processor derivation and guard tests
|
|
147
|
+
test_prop_postprocess.py # Property tests for derivation and guards
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Adding an extension
|
|
151
|
+
|
|
152
|
+
Hand-written helpers go under `src/oscal_bindings/v1/extensions/`:
|
|
153
|
+
|
|
154
|
+
1. Add your module (e.g., `v1/extensions/foo.py`).
|
|
155
|
+
2. Re-export public symbols from `v1/extensions/__init__.py`.
|
|
156
|
+
3. Re-export from `src/oscal_bindings/v1/__init__.py` so callers can `from oscal_bindings.v1 import ...`.
|
|
157
|
+
4. Add tests under `tests/`.
|
|
158
|
+
|
|
159
|
+
Nothing else is needed for the top-level path: `oscal_bindings` takes its `__all__` from
|
|
160
|
+
`oscal_bindings.v1.__all__`, so a name added to the version package surfaces at
|
|
161
|
+
`from oscal_bindings import ...` automatically and the two surfaces cannot drift.
|
|
162
|
+
Neither the version package nor the top-level package defines symbols of its own — that keeps the
|
|
163
|
+
public API auditable in one file.
|
|
164
|
+
|
|
165
|
+
## Testing
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
hatch test # quick test on default Python
|
|
169
|
+
hatch test --all # test across all matrix versions
|
|
170
|
+
hatch test --all --cover # with coverage (terminal report + htmlcov/)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
With `--cover`, the combined coverage report prints to the terminal and is also
|
|
174
|
+
written as HTML to `htmlcov/` (git-ignored). CI uploads it as the `coverage-html`
|
|
175
|
+
artifact.
|
|
176
|
+
|
|
177
|
+
## Releasing
|
|
178
|
+
|
|
179
|
+
PyPI receives the exact wheel and sdist that CI built and tested; nothing rebuilds
|
|
180
|
+
after CI.
|
|
181
|
+
|
|
182
|
+
1. Bump `version` in `pyproject.toml` and merge it to `main`.
|
|
183
|
+
2. Tag that commit `v<version>` (e.g. `v0.2.0`) and push the tag.
|
|
184
|
+
3. CI (`build.yml`) fails fast if the tag isn't `v$(hatch version)`, runs the full
|
|
185
|
+
release chain, builds, and creates a **draft** GitHub release with the wheel and
|
|
186
|
+
sdist attached.
|
|
187
|
+
4. Review the draft and publish it. That triggers `release.yml`, which downloads the
|
|
188
|
+
attached files, checks their filenames match the tag, and uploads them to PyPI
|
|
189
|
+
via trusted publishing.
|
|
190
|
+
|
|
191
|
+
To retry a failed PyPI upload, run the `publish` workflow manually with the tag.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
oscal-bindings (Python)
|
|
2
|
+
Copyright 2026 Always August, LLC
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
This product includes the OSCAL JSON Schemas (schemas/<release>/) developed by
|
|
7
|
+
the National Institute of Standards and Technology (NIST),
|
|
8
|
+
https://github.com/usnistgov/OSCAL. The schemas are vendored unmodified.
|
|
9
|
+
src/oscal_bindings/v1/models.py is generated from them by
|
|
10
|
+
datamodel-code-generator and scripts/postprocess_models.py.
|
|
11
|
+
|
|
12
|
+
As a work of the United States government, the NIST OSCAL materials are in the
|
|
13
|
+
public domain within the United States and are made available worldwide under
|
|
14
|
+
the CC0 1.0 Universal public domain dedication. NIST is acknowledged as the
|
|
15
|
+
source of these materials; see https://www.nist.gov/open/license.
|