Skip to content

Commit 41b0a1c

Browse files
sigstore: Bump to v0.7.0 (#36)
* sigstore: Bump to v0.7.0 Signed-off-by: Alex Cameron <[email protected]> * README, action: re-enable verify-cert-email with a deprecation warning Signed-off-by: William Woodruff <[email protected]> * workflows: enable identity selftest Signed-off-by: William Woodruff <[email protected]> * workflows/selftest: add a verify-cert-email test Signed-off-by: William Woodruff <[email protected]> * action.py: add a URL Signed-off-by: William Woodruff <[email protected]> Signed-off-by: Alex Cameron <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
1 parent 30771cf commit 41b0a1c

File tree

5 files changed

+73
-17
lines changed

5 files changed

+73
-17
lines changed

.github/workflows/selftest.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,32 @@ jobs:
7373
certificate: ./test/custom_certificate.crt
7474
staging: true
7575

76-
# NOTE(alex): `sigstore-python` doesn't support verifying URI SANs yet.
77-
# selftest-verify-san:
78-
# runs-on: ubuntu-latest
79-
# if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
80-
# steps:
81-
# - uses: actions/checkout@v3
82-
# - name: Sign artifact and publish signature
83-
# uses: ./
84-
# id: sigstore-python
85-
# with:
86-
# inputs: ./test/artifact.txt
87-
# verify-cert-email: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
88-
# staging: true
76+
selftest-verify-cert-identity:
77+
runs-on: ubuntu-latest
78+
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
79+
steps:
80+
- uses: actions/checkout@v3
81+
- name: Sign artifact and publish signature
82+
uses: ./
83+
id: sigstore-python
84+
with:
85+
inputs: ./test/artifact.txt
86+
verify-cert-identity: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
87+
staging: true
88+
89+
# NOTE(ww): Remove once `verify-cert-email` is removed.
90+
selftest-verify-cert-email:
91+
runs-on: ubuntu-latest
92+
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
93+
steps:
94+
- uses: actions/checkout@v3
95+
- name: Sign artifact and publish signature
96+
uses: ./
97+
id: sigstore-python
98+
with:
99+
inputs: ./test/artifact.txt
100+
verify-cert-email: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
101+
staging: true
89102

90103
selftest-verify-issuer:
91104
runs-on: ubuntu-latest

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ Example:
268268

269269
**Default**: Empty
270270

271+
**This option is deprecated, with [`verify-cert-identity`](#verify-cert-identity) as a replacement.
272+
It will be removed in an upcoming release.**
273+
271274
The `verify-cert-email` setting controls whether to verify the Subject Alternative Name (SAN) of the
272275
signing certificate after signing has taken place. If it is set, `sigstore-python` will compare the
273276
certificate's SAN against the provided value.
@@ -278,7 +281,24 @@ This setting only applies if `verify` is set to `true`.
278281
- uses: sigstore/[email protected]
279282
with:
280283
inputs: file.txt
281-
verify-cert-email: [email protected]
284+
verify-cert-identity: [email protected]
285+
```
286+
287+
### `verify-cert-identity`
288+
289+
**Default**: Empty
290+
291+
The `verify-cert-identity` setting controls whether to verify the Subject Alternative Name (SAN) of the
292+
signing certificate after signing has taken place. If it is set, `sigstore-python` will compare the
293+
certificate's SAN against the provided value.
294+
295+
This setting only applies if `verify` is set to `true`.
296+
297+
```yaml
298+
- uses: sigstore/[email protected]
299+
with:
300+
inputs: file.txt
301+
verify-cert-identity: [email protected]
282302
```
283303

284304
### `verify-oidc-issuer`

action.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def _sigstore_verify(*args):
6161
return ["python", "-m", "sigstore", "verify", *args]
6262

6363

64+
def _warning(msg):
65+
print(f"::warning::⚠️ {msg}")
66+
67+
6468
def _fatal_help(msg):
6569
print(f"::error::❌ {msg}")
6670
sys.exit(1)
@@ -143,8 +147,19 @@ def _fatal_help(msg):
143147

144148
verify_cert_email = os.getenv("GHA_SIGSTORE_PYTHON_VERIFY_CERT_EMAIL")
145149
if verify_cert_email != "":
150+
_warning(
151+
"verify-cert-email has been deprecated and will be removed in the next release; "
152+
"use verify-cert-identity instead. "
153+
"See: https://github.com/sigstore/gh-action-sigstore-python#verify-cert-identity"
154+
)
155+
# NOTE: This will cause sigstore-python to fail if the user passes the identity
156+
# via both `--cert-email` and `--cert-identity`, but that's acceptable.
146157
sigstore_verify_args.extend(["--cert-email", verify_cert_email])
147158

159+
verify_cert_identity = os.getenv("GHA_SIGSTORE_PYTHON_VERIFY_CERT_IDENTITY")
160+
if verify_cert_identity != "":
161+
sigstore_verify_args.extend(["--cert-identity", verify_cert_identity])
162+
148163
verify_oidc_issuer = os.getenv("GHA_SIGSTORE_PYTHON_VERIFY_OIDC_ISSUER")
149164
if verify_oidc_issuer != "":
150165
sigstore_verify_args.extend(["--cert-oidc-issuer", verify_oidc_issuer])

action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,18 @@ inputs:
6565
required: false
6666
default: true
6767
verify-cert-email:
68-
description: "verify the email address to in the signing certificate's Subject Alternative Name (only applies when `verify` is on)"
68+
description: |
69+
verify the email in the signing certificate's Subject Alternative Name (only applies when `verify` is enabled)
70+
71+
this option is DEPRECATED and will be removed in an upcoming release of this action.
72+
required: false
73+
default: ""
74+
verify-cert-identity:
75+
description: "verify the identity in the signing certificate's Subject Alternative Name (only applies when `verify` is enabled)"
6976
required: false
7077
default: ""
7178
verify-oidc-issuer:
72-
description: "verify the issuer extension of the signing certificate"
79+
description: "verify the issuer extension of the signing certificate (only applies when `verify` is enabled)"
7380
required: false
7481
default: ""
7582
upload-signing-artifacts:
@@ -111,6 +118,7 @@ runs:
111118
GHA_SIGSTORE_PYTHON_STAGING: "${{ inputs.staging }}"
112119
GHA_SIGSTORE_PYTHON_VERIFY: "${{ inputs.verify }}"
113120
GHA_SIGSTORE_PYTHON_VERIFY_CERT_EMAIL: "${{ inputs.verify-cert-email }}"
121+
GHA_SIGSTORE_PYTHON_VERIFY_CERT_IDENTITY: "${{ inputs.verify-cert-identity }}"
114122
GHA_SIGSTORE_PYTHON_VERIFY_OIDC_ISSUER: "${{ inputs.verify-oidc-issuer }}"
115123
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
116124
shell: bash

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sigstore==0.6.8
1+
sigstore==0.7.0

0 commit comments

Comments
 (0)