sealform 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.
Files changed (93) hide show
  1. sealform-0.1.0/.github/dependabot.yml +15 -0
  2. sealform-0.1.0/.github/workflows/ci.yml +32 -0
  3. sealform-0.1.0/.github/workflows/prek.yml +105 -0
  4. sealform-0.1.0/.github/workflows/release.yml +35 -0
  5. sealform-0.1.0/.github/workflows/spec-drift.yml +22 -0
  6. sealform-0.1.0/.gitignore +25 -0
  7. sealform-0.1.0/.markdownlint-cli2.yaml +11 -0
  8. sealform-0.1.0/.python-version +1 -0
  9. sealform-0.1.0/.yamllint.yaml +12 -0
  10. sealform-0.1.0/LICENSE +80 -0
  11. sealform-0.1.0/PKG-INFO +154 -0
  12. sealform-0.1.0/PLAN.md +538 -0
  13. sealform-0.1.0/README.md +127 -0
  14. sealform-0.1.0/apm.lock.yaml +440 -0
  15. sealform-0.1.0/apm.yml +17 -0
  16. sealform-0.1.0/docs/configuration-repository.md +86 -0
  17. sealform-0.1.0/docs/configuration.md +155 -0
  18. sealform-0.1.0/docs/decisions/0000-use-markdown-architectural-decision-records.md +26 -0
  19. sealform-0.1.0/docs/decisions/0001-implement-sealform-in-python.md +57 -0
  20. sealform-0.1.0/docs/decisions/0002-declare-one-organization-per-configuration-root-with-one-file-per-project.md +60 -0
  21. sealform-0.1.0/docs/decisions/0003-share-project-defaults-through-organization-level-profiles.md +58 -0
  22. sealform-0.1.0/docs/decisions/0004-share-artifact-configuration-xml-through-a-library-and-compare-it-verbatim.md +54 -0
  23. sealform-0.1.0/docs/decisions/0005-reference-interactive-users-and-groups-without-managing-them.md +59 -0
  24. sealform-0.1.0/docs/decisions/0006-manage-pipeline-policies-and-reference-trusted-build-systems.md +58 -0
  25. sealform-0.1.0/docs/decisions/0007-declare-ci-users-explicitly-in-their-owning-project.md +60 -0
  26. sealform-0.1.0/docs/decisions/0008-hand-new-ci-user-tokens-to-the-operator.md +62 -0
  27. sealform-0.1.0/docs/decisions/0009-treat-deactivation-as-removal-and-prune-only-on-request.md +63 -0
  28. sealform-0.1.0/docs/decisions/0010-hand-write-lenient-api-models.md +51 -0
  29. sealform-0.1.0/docs/decisions/0011-use-conditional-requests-and-emulate-write-preconditions.md +60 -0
  30. sealform-0.1.0/docs/decisions/0012-read-the-api-token-from-environment-file-or-stdin-only.md +52 -0
  31. sealform-0.1.0/docs/decisions/0013-rename-the-project-to-sealform.md +59 -0
  32. sealform-0.1.0/docs/decisions/README.md +25 -0
  33. sealform-0.1.0/docs/decisions/adr-template.md +44 -0
  34. sealform-0.1.0/examples/basic/artifact-configurations/custom/example.beta-installer.xml +8 -0
  35. sealform-0.1.0/examples/basic/artifact-configurations/jar-signing.xml +7 -0
  36. sealform-0.1.0/examples/basic/organization.yaml +19 -0
  37. sealform-0.1.0/examples/basic/profiles/standard.yaml +23 -0
  38. sealform-0.1.0/examples/basic/projects/example.alpha.yaml +16 -0
  39. sealform-0.1.0/examples/basic/projects/example.beta.yaml +24 -0
  40. sealform-0.1.0/prek.toml +144 -0
  41. sealform-0.1.0/pyproject.toml +120 -0
  42. sealform-0.1.0/schemas/organization.schema.json +191 -0
  43. sealform-0.1.0/schemas/profile.schema.json +413 -0
  44. sealform-0.1.0/schemas/project.schema.json +544 -0
  45. sealform-0.1.0/scripts/update-spec.sh +33 -0
  46. sealform-0.1.0/src/sealform/__init__.py +9 -0
  47. sealform-0.1.0/src/sealform/__main__.py +4 -0
  48. sealform-0.1.0/src/sealform/api/__init__.py +0 -0
  49. sealform-0.1.0/src/sealform/api/client.py +272 -0
  50. sealform-0.1.0/src/sealform/api/errors.py +62 -0
  51. sealform-0.1.0/src/sealform/api/http.py +245 -0
  52. sealform-0.1.0/src/sealform/api/models.py +262 -0
  53. sealform-0.1.0/src/sealform/apply/__init__.py +0 -0
  54. sealform-0.1.0/src/sealform/apply/executor.py +333 -0
  55. sealform-0.1.0/src/sealform/auth.py +52 -0
  56. sealform-0.1.0/src/sealform/cli.py +551 -0
  57. sealform-0.1.0/src/sealform/config/__init__.py +0 -0
  58. sealform-0.1.0/src/sealform/config/desired.py +141 -0
  59. sealform-0.1.0/src/sealform/config/loader.py +580 -0
  60. sealform-0.1.0/src/sealform/config/merge.py +55 -0
  61. sealform-0.1.0/src/sealform/config/model.py +191 -0
  62. sealform-0.1.0/src/sealform/config/schema.py +23 -0
  63. sealform-0.1.0/src/sealform/config/xml.py +103 -0
  64. sealform-0.1.0/src/sealform/config/yamlio.py +131 -0
  65. sealform-0.1.0/src/sealform/diagnostics.py +65 -0
  66. sealform-0.1.0/src/sealform/importer/__init__.py +0 -0
  67. sealform-0.1.0/src/sealform/importer/export.py +475 -0
  68. sealform-0.1.0/src/sealform/live/__init__.py +0 -0
  69. sealform-0.1.0/src/sealform/live/fetch.py +199 -0
  70. sealform-0.1.0/src/sealform/live/state.py +118 -0
  71. sealform-0.1.0/src/sealform/plan/__init__.py +0 -0
  72. sealform-0.1.0/src/sealform/plan/actions.py +178 -0
  73. sealform-0.1.0/src/sealform/plan/diff.py +962 -0
  74. sealform-0.1.0/src/sealform/plan/render.py +99 -0
  75. sealform-0.1.0/src/sealform/plan/resolve.py +116 -0
  76. sealform-0.1.0/src/sealform/resources/artifact-configuration-v1.xsd +2159 -0
  77. sealform-0.1.0/src/sealform/resources/signpath-openapi.json +15412 -0
  78. sealform-0.1.0/src/sealform/tokens/__init__.py +0 -0
  79. sealform-0.1.0/src/sealform/tokens/sinks.py +104 -0
  80. sealform-0.1.0/tests/__init__.py +0 -0
  81. sealform-0.1.0/tests/conftest.py +96 -0
  82. sealform-0.1.0/tests/fake_signpath.py +743 -0
  83. sealform-0.1.0/tests/helpers.py +76 -0
  84. sealform-0.1.0/tests/test_apply.py +379 -0
  85. sealform-0.1.0/tests/test_cli_offline.py +43 -0
  86. sealform-0.1.0/tests/test_cli_plan.py +95 -0
  87. sealform-0.1.0/tests/test_http.py +174 -0
  88. sealform-0.1.0/tests/test_import.py +200 -0
  89. sealform-0.1.0/tests/test_loader.py +389 -0
  90. sealform-0.1.0/tests/test_merge.py +60 -0
  91. sealform-0.1.0/tests/test_plan.py +272 -0
  92. sealform-0.1.0/tests/test_xml.py +56 -0
  93. sealform-0.1.0/uv.lock +905 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
8
+ cooldown:
9
+ default-days: 7
10
+ - package-ecosystem: uv
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
14
+ cooldown:
15
+ default-days: 7
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.12", "3.13"]
18
+ steps:
19
+ - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
20
+ with:
21
+ egress-policy: audit
22
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ with:
24
+ persist-credentials: false
25
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+ - run: uv sync --locked
29
+ - run: uv run ruff check
30
+ - run: uv run ruff format --check
31
+ - run: uv run mypy
32
+ - run: uv run pytest --cov=sealform --cov-report=term-missing
@@ -0,0 +1,105 @@
1
+ # Runs the hooks from prek.toml, so the checks a developer gets from
2
+ # `prek install` also gate every pull request and every push to main.
3
+ name: prek
4
+
5
+ on:
6
+ pull_request:
7
+ push:
8
+ branches: [main]
9
+
10
+ permissions: {}
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ prek:
18
+ name: prek
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 15
21
+ permissions:
22
+ contents: read
23
+ steps:
24
+ - name: Harden the runner
25
+ uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
26
+ with:
27
+ egress-policy: audit
28
+
29
+ - name: Check out
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ # The pre-push and commit-msg stages need the commits of the range.
33
+ fetch-depth: 0
34
+ persist-credentials: false
35
+
36
+ # Some hooks run scripts from the APM-deployed skills (.agents/skills/), which
37
+ # are git-ignored: deploy them exactly as pinned in apm.lock.yaml.
38
+ - name: Install APM
39
+ uses: microsoft/apm-action@d723bb64ed70c135bbaf87d126b721dd2dae0439 # v1.10.0
40
+ with:
41
+ apm-version: "0.32.0"
42
+ setup-only: true
43
+
44
+ - name: Deploy the agent skills
45
+ run: apm install --frozen
46
+
47
+ - name: Install prek
48
+ uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0
49
+ with:
50
+ prek-version: "0.5.3" # keep in sync with minimum_prek_version in prek.toml
51
+ install-only: true
52
+
53
+ - name: Resolve the commit range
54
+ env:
55
+ EVENT_NAME: ${{ github.event_name }}
56
+ PR_BASE: ${{ github.event.pull_request.base.sha }}
57
+ PR_HEAD: ${{ github.event.pull_request.head.sha }}
58
+ PUSH_BEFORE: ${{ github.event.before }}
59
+ PUSH_AFTER: ${{ github.sha }}
60
+ run: |
61
+ if [ "$EVENT_NAME" = pull_request ]; then
62
+ from="$PR_BASE" to="$PR_HEAD"
63
+ else
64
+ from="$PUSH_BEFORE" to="$PUSH_AFTER"
65
+ fi
66
+ # A new branch or the first push has no "before": check the whole history.
67
+ if [ -z "${from//0/}" ] || ! git cat-file -e "${from}^{commit}" 2>/dev/null; then
68
+ from=""
69
+ fi
70
+ echo "Range: ${from:-<root>}..${to}"
71
+ {
72
+ echo "RANGE_FROM=${from}"
73
+ echo "RANGE_TO=${to}"
74
+ } >> "$GITHUB_ENV"
75
+
76
+ - name: pre-commit stage (all files)
77
+ if: ${{ !cancelled() }}
78
+ run: prek run --all-files --show-diff-on-failure --color=always
79
+
80
+ - name: pre-push stage (commit range)
81
+ if: ${{ !cancelled() }}
82
+ run: |
83
+ if [ -n "$RANGE_FROM" ]; then
84
+ prek run --stage pre-push --color=always --from-ref "$RANGE_FROM" --to-ref "$RANGE_TO"
85
+ else
86
+ prek run --stage pre-push --color=always --all-files
87
+ fi
88
+
89
+ - name: commit-msg stage (each commit of the range)
90
+ if: ${{ !cancelled() }}
91
+ run: |
92
+ msg="$RUNNER_TEMP/COMMIT_EDITMSG"
93
+ failed=""
94
+ for sha in $(git rev-list --no-merges --reverse "${RANGE_FROM:+$RANGE_FROM..}$RANGE_TO"); do
95
+ echo "::group::$(git log -1 --format='%h %s' "$sha")"
96
+ git log -1 --format=%B "$sha" > "$msg"
97
+ prek run --stage commit-msg --color=always --commit-msg-filename "$msg" || failed="$failed $sha"
98
+ echo "::endgroup::"
99
+ done
100
+ if [ -n "$failed" ]; then
101
+ for sha in $failed; do
102
+ echo "::error::Commit $sha does not follow Conventional Commits"
103
+ done
104
+ exit 1
105
+ fi
@@ -0,0 +1,35 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ pypi:
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+ permissions:
15
+ id-token: write # PyPI trusted publishing
16
+ steps:
17
+ - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
18
+ with:
19
+ egress-policy: audit
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ # the package version is derived from the tags and the history (uv-dynamic-versioning)
23
+ fetch-depth: 0
24
+ persist-credentials: false
25
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
26
+ - run: uv build
27
+ - name: Check that the built version matches the tag
28
+ run: |
29
+ expected="${GITHUB_REF_NAME#v}"
30
+ if [ ! -f "dist/sealform-${expected}-py3-none-any.whl" ]; then
31
+ ls dist
32
+ echo "::error::built version does not match tag ${GITHUB_REF_NAME}"
33
+ exit 1
34
+ fi
35
+ - run: uv publish --trusted-publishing always
@@ -0,0 +1,22 @@
1
+ name: SignPath spec drift
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "17 6 * * 1"
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ check:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
16
+ with:
17
+ egress-policy: audit
18
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+ with:
20
+ persist-credentials: false
21
+ - name: Compare vendored OpenAPI document and XSD with upstream
22
+ run: scripts/update-spec.sh --check
@@ -0,0 +1,25 @@
1
+ # Local credentials for manual sandbox exploration (never commit, never use in tests)
2
+ .sandbox_token
3
+ .sandbox_org_id
4
+
5
+ # APM dependencies and the files it deploys (apm install --frozen)
6
+ apm_modules/
7
+ .agents/
8
+ .claude/skills/
9
+
10
+ # Python
11
+ __pycache__/
12
+ *.py[cod]
13
+ .venv/
14
+ build/
15
+ dist/
16
+ *.egg-info/
17
+ .pytest_cache/
18
+ .mypy_cache/
19
+ .ruff_cache/
20
+ .coverage
21
+ coverage.xml
22
+ htmlcov/
23
+
24
+ # sealform outputs that may contain secrets
25
+ *.tokens.jsonl
@@ -0,0 +1,11 @@
1
+ # markdownlint-cli2 configuration: https://github.com/DavidAnson/markdownlint-cli2
2
+ # Rules follow the madr-adr skill's markdownlint.yml (from MADR itself).
3
+ config:
4
+ default: true
5
+ # One sentence per line; sentences with links often exceed 80 characters.
6
+ MD013: false
7
+ # MADR repeats headings such as the chosen option's title and "Examples".
8
+ MD024: false
9
+ # MADR uses asterisks as list markers (MADR ADR-0011).
10
+ MD004:
11
+ style: asterisk
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,12 @@
1
+ # yamllint configuration: https://yamllint.readthedocs.io
2
+ extends: default
3
+
4
+ rules:
5
+ # GitHub Actions' `on:` key is not a boolean.
6
+ truthy:
7
+ check-keys: false
8
+ document-start: disable
9
+ line-length:
10
+ max: 120
11
+ comments:
12
+ min-spaces-from-content: 1
sealform-0.1.0/LICENSE ADDED
@@ -0,0 +1,80 @@
1
+ Eclipse Public License - v 2.0
2
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
3
+
4
+ 1. DEFINITIONS
5
+ “Contribution” means:
6
+
7
+ a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and
8
+ b) in the case of each subsequent Contributor:
9
+ i) changes to the Program, and
10
+ ii) additions to the Program;
11
+ where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works.
12
+ “Contributor” means any person or entity that Distributes the Program.
13
+
14
+ “Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
15
+
16
+ “Program” means the Contributions Distributed in accordance with this Agreement.
17
+
18
+ “Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
19
+
20
+ “Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
21
+
22
+ “Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
23
+
24
+ “Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy.
25
+
26
+ “Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
27
+
28
+ “Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
29
+
30
+ 2. GRANT OF RIGHTS
31
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
32
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
33
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
34
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
35
+ e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
36
+ 3. REQUIREMENTS
37
+ 3.1 If a Contributor Distributes the Program in any form, then:
38
+
39
+ a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
40
+ b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
41
+ i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
42
+ ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
43
+ iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
44
+ iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
45
+ 3.2 When the Program is Distributed as Source Code:
46
+
47
+ a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
48
+ b) a copy of this Agreement must be included with each copy of the Program.
49
+ 3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (‘notices’) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
50
+
51
+ 4. COMMERCIAL DISTRIBUTION
52
+ Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
53
+
54
+ For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
55
+
56
+ 5. NO WARRANTY
57
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
58
+
59
+ 6. DISCLAIMER OF LIABILITY
60
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
61
+
62
+ 7. GENERAL
63
+ If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
64
+
65
+ If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
66
+
67
+ All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
68
+
69
+ Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version.
70
+
71
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
72
+
73
+ Exhibit A – Form of Secondary Licenses Notice
74
+ “This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.”
75
+
76
+ Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses.
77
+
78
+ If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
79
+
80
+ You may add additional accurate notices of copyright ownership.
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.5
2
+ Name: sealform
3
+ Version: 0.1.0
4
+ Summary: Manage SignPath.io organizations (projects, signing policies, artifact configurations, CI users) as code.
5
+ Project-URL: Homepage, https://github.com/eclipse-csi/sealform
6
+ Project-URL: Issues, https://github.com/eclipse-csi/sealform/issues
7
+ Author: Eclipse Foundation
8
+ License-Expression: EPL-2.0
9
+ License-File: LICENSE
10
+ Keywords: code-signing,configuration-as-code,gitops,signpath
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Security
18
+ Classifier: Topic :: System :: Systems Administration
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: click>=8.1
21
+ Requires-Dist: httpx>=0.27
22
+ Requires-Dist: lxml>=5.2
23
+ Requires-Dist: pydantic>=2.7
24
+ Requires-Dist: rich>=13.7
25
+ Requires-Dist: ruamel-yaml>=0.18
26
+ Description-Content-Type: text/markdown
27
+
28
+ # sealform
29
+
30
+ Manage a [SignPath.io](https://signpath.io) organization as code.
31
+
32
+ Projects, signing policies, artifact configurations, CI users and pipeline policies are declared in YAML
33
+ and reconciled against the SignPath REST API with a `plan` / `apply` workflow.
34
+ Certificates, interactive users, user groups and trusted build systems are referenced, never modified.
35
+
36
+ This repository contains the tool only.
37
+ Organization configurations (for example the Eclipse Foundation one) live in their own repositories.
38
+
39
+ sealform is an independent project: it is not affiliated with, endorsed by, or maintained by the makers of SignPath.
40
+
41
+ ## Install
42
+
43
+ ```console
44
+ uv tool run sealform --help # or uvx; uv fetches a suitable Python if needed
45
+ uv tool install sealform # or pipx install sealform
46
+ ```
47
+
48
+ ## Quick start
49
+
50
+ ```console
51
+ # 1. bootstrap a configuration from an existing organization
52
+ export SIGNPATH_API_TOKEN=... # never passed as a command-line argument
53
+ sealform --organization-id <uuid> import -o my-org
54
+ sealform -c my-org plan # expect: "No changes."
55
+
56
+ # 2. edit the YAML, then review and apply
57
+ sealform -c my-org validate # offline
58
+ sealform -c my-org plan
59
+ sealform -c my-org apply
60
+ ```
61
+
62
+ A minimal project file, inheriting everything else from a profile:
63
+
64
+ ```yaml
65
+ # projects/technology.cbi.yaml (the file name is the project slug)
66
+ name: Eclipse CBI
67
+ repositories: [https://github.com/eclipse-cbi/cbi]
68
+ ci_users:
69
+ technology.cbi:
70
+ signing_policies: [test-signing, release-signing]
71
+ signing_policies:
72
+ release-signing:
73
+ approval:
74
+ approvers: [alice@example.org, group:CBI leads]
75
+ ```
76
+
77
+ See [docs/configuration.md](docs/configuration.md) for the full reference and [examples/basic](examples/basic)
78
+ for a complete configuration root.
79
+
80
+ ## Commands
81
+
82
+ | Command | What it does |
83
+ | --- | --- |
84
+ | `validate` | Checks the configuration offline: schema, profile merge, references, XML against the SignPath XSD. |
85
+ | `plan` | Shows what `apply` would change. Read-only: it is designed for a Global Reader token (not yet verified). `-o json` and `--detailed-exitcode` are available for CI. |
86
+ | `apply` | Applies the plan after confirmation (`--yes` when not interactive). |
87
+ | `import -o DIR` | Writes the configuration of a live organization. `--profile NAME` writes projects relative to a profile. |
88
+ | `ci-user rotate-token NAME` | Regenerates a CI user's API token. |
89
+ | `schema [KIND]` | Prints the JSON Schema of `organization`, `profile` or `project` files, for editor completion. |
90
+
91
+ Scoping options for `plan` and `apply`:
92
+
93
+ | Option | Effect |
94
+ | --- | --- |
95
+ | `-p/--project SLUG` | Only these projects (repeatable). |
96
+ | `--org-only` | Only organization-level objects (pipeline policies, pruning). |
97
+ | `--prune` | Deactivate what is not declared, refused above `--max-deactivations` (default 10). |
98
+
99
+ ### API token
100
+
101
+ The administrator token is read from `--token-file PATH`, `--token-stdin` or `$SIGNPATH_API_TOKEN`, in that order.
102
+ There is deliberately no option to pass it on the command line ([ADR-0012](docs/decisions/0012-read-the-api-token-from-environment-file-or-stdin-only.md)).
103
+
104
+ ### New CI user tokens
105
+
106
+ SignPath returns a CI user's API token only once, when the user is created.
107
+ `apply` sends it to one destination, and it never appears on stdout or in logs:
108
+
109
+ * the terminal, by default when interactive;
110
+ * a file created with mode 0600 (`--ci-token-file PATH`);
111
+ * nowhere, with `--discard-new-ci-tokens`; run `ci-user rotate-token` later to get a usable token.
112
+
113
+ A non-interactive run that would create CI users without a destination stops before changing anything.
114
+
115
+ ## How it behaves
116
+
117
+ * **Deactivation instead of deletion.** The SignPath API cannot delete objects.
118
+ Undeclared objects are reported as drift and deactivated only with `--prune`.
119
+ Declaring an object whose slug matches an inactive one reactivates it.
120
+ * **Changes made in the web UI are not overwritten.** Before its first write, `apply` re-reads every resource it will modify.
121
+ If one changed since the plan was computed, that project is skipped as stale and the others are applied
122
+ ([ADR-0011](docs/decisions/0011-use-conditional-requests-and-emulate-write-preconditions.md)).
123
+ * **Requests are conditional and polite.** HTTP validators are used when SignPath provides them, concurrency is bounded,
124
+ `Retry-After` is honored, and nothing is written when nothing differs.
125
+ * **Artifact configuration XML is compared as text**, the way SignPath stores it, so the repository and the UI show the same document.
126
+
127
+ Design and decisions: [PLAN.md](PLAN.md) and [docs/decisions](docs/decisions/README.md).
128
+ Running the tool from a configuration repository: [docs/configuration-repository.md](docs/configuration-repository.md).
129
+
130
+ ## Development
131
+
132
+ ```console
133
+ uv sync
134
+ uv run pytest # unit and fake-API tests; never use a real token in tests
135
+ uv run ruff check && uv run ruff format --check
136
+ uv run mypy
137
+ scripts/update-spec.sh # refresh the vendored OpenAPI document and XSD
138
+ ```
139
+
140
+ ## Releasing
141
+
142
+ The version comes from git tags ([uv-dynamic-versioning](https://github.com/ninoseki/uv-dynamic-versioning)):
143
+ a commit tagged `vX.Y.Z` builds as `X.Y.Z`, any other commit as the next minor `.devN` pre-release.
144
+ To release, tag the commit on `main` and push the tag; the release workflow builds, checks that the
145
+ built version matches the tag, and publishes to PyPI.
146
+
147
+ ```console
148
+ git tag -s vX.Y.Z -m "vX.Y.Z"
149
+ git push origin vX.Y.Z
150
+ ```
151
+
152
+ ## License
153
+
154
+ [Eclipse Public License 2.0](LICENSE)