Skip to content

Commit

Permalink
feat: added allow_referrers_api inputs (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Two-Hearts authored Aug 4, 2023
1 parent 9b1ca53 commit eb44e15
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 26 deletions.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ For example,
target_artifact_reference: <target_artifact_reference_in_remote_registry>
signature_format: <signature_envelope_format>
plugin_config: <list_of_plugin_defined_configs>
allow_referrers_api: <boolean_flag_for_referrers_api>
```
For example,
```yaml
Expand All @@ -49,6 +50,25 @@ For example,
ca_certs=.github/cert-bundle/cert-bundle.crt
self_signed=false
```
Example of using the [Referrers API](https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc.3/spec.md#listing-referrers),
```yaml
- name: sign releasd artifact with notation-azure-kv plugin
uses: notaryproject/notation-action/sign@main
env:
NOTATION_EXPERIMENTAL: 1 # this is requried by Notation to use Referrers API
with:
allow_referrers_api: 'true'
plugin_name: azure-kv
plugin_url: https://github.com/Azure/notation-azure-kv/releases/download/v1.0.0-rc.2/notation-azure-kv_1.0.0-rc.2_linux_amd64.tar.gz
plugin_checksum: 4242054463089f4b04019805f2c009267dbcc9689e386bc88d3c4fc4E095e52c
key_id: https://testnotationakv.vault.azure.net/keys/notationLeafCert/c585b8ad8fc542b28e41e555d9b3a1fd
target_artifact_reference: myRegistry.azurecr.io/myRepo@sha256:aaabbb
signature_format: cose
plugin_config: |-
ca_certs=.github/cert-bundle/cert-bundle.crt
self_signed=false
```
### Notation: Verify
```yaml
- name: verify released artifact
Expand All @@ -57,6 +77,7 @@ For example,
target_artifact_reference: <target_artifact_reference_in_remote_registry>
trust_policy: <file_path_to_user_defined_trustpolicy.json>
trust_store: <dir_to_user_trust_store>
allow_referrers_api: <boolean_flag_for_referrers_api>
```
For example,
```yaml
Expand All @@ -67,9 +88,9 @@ For example,
trust_policy: .github/trustpolicy/trustpolicy.json
trust_store: .github/truststore
```
where `.github/truststore` MUST follow the Notation [trust store specs](https://github.com/notaryproject/notaryproject/blob/main/specs/trust-store-trust-policy.md#trust-store).
`.github/trustpolicy/trustpolicy.json` MUST follow the Notation [trust policy specs](https://github.com/notaryproject/specifications/blob/v1.0.0-rc.2/specs/trust-store-trust-policy.md#trust-policy).

For example,
`.github/truststore` MUST follow the Notation [trust store specs](https://github.com/notaryproject/specifications/blob/v1.0.0-rc.2/specs/trust-store-trust-policy.md#trust-store). For example,
```
.github/truststore
└── x509
Expand All @@ -80,4 +101,17 @@ For example,
└── signingAuthority
└── <my_trust_store2>
├── <my_certificate3>
└── <my_certificate4>
└── <my_certificate4>
```
Example of using the [Referrers API](https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc.3/spec.md#listing-referrers),
```yaml
- name: verify released artifact
uses: notaryproject/notation-action/verify@main
env:
NOTATION_EXPERIMENTAL: 1 # this is requried by Notation to use Referrers API
with:
allow_referrers_api: 'true'
target_artifact_reference: myRegistry.azurecr.io/myRepo@sha256:aaabbb
trust_policy: .github/trustpolicy/trustpolicy.json
trust_store: .github/truststore
```
13 changes: 7 additions & 6 deletions dist/sign.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/sign.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions dist/verify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/verify.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ branding:
color: blue
inputs:
version:
description: Version of official Notation CLI [release](https://github.com/notaryproject/notation/releases). This field is ignored if 'url' is present.
description: version of official Notation CLI [release](https://github.com/notaryproject/notation/releases). This field is ignored if 'url' is present.
required: false
default: 1.0.0-rc.7
url:
description: URL of customized Notation CLI to install.
description: url of customized Notation CLI to install
required: false
checksum:
description: SHA256 of the customized Notation CLI. Required if 'url' is present.
Expand Down
Loading

0 comments on commit eb44e15

Please sign in to comment.