| 1 | // Copyright The Notary Project Authors. |
| 2 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | // you may not use this file except in compliance with the License. |
| 4 | // You may obtain a copy of the License at |
| 5 | // |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | // |
| 8 | // Unless required by applicable law or agreed to in writing, software |
| 9 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | // See the License for the specific language governing permissions and |
| 12 | // limitations under the License. |
| 13 | |
| 14 | // Package plugin defines the protocol layer for communication between notation |
| 15 | // and notation external plugin. |
| 16 | package pluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/ |
| 17 | |
| 18 | // BinaryPrefix is the prefix required on all plugin binary names. |
| 19 | const BinaryPrefixscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/BinaryPrefix. = "notation-" |
| 20 | |
| 21 | // ContractVersion is the <major>.<minor> version of the plugin contract. |
| 22 | const ContractVersionscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/ContractVersion. = "1.0" |
| 23 | |
| 24 | // Capability is a feature available in the plugin contract. |
| 25 | type Capabilityscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Capability# string |
| 26 | |
| 27 | const ( |
| 28 | // CapabilitySignatureGenerator is the name of the capability |
| 29 | // for a plugin to support generating raw signatures. |
| 30 | CapabilitySignatureGeneratorscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CapabilitySignatureGenerator. Capabilityscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Capability# = "SIGNATURE_GENERATOR.RAW" |
| 31 | |
| 32 | // CapabilityEnvelopeGenerator is the name of the capability |
| 33 | // for a plugin to support generating envelope signatures. |
| 34 | CapabilityEnvelopeGeneratorscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CapabilityEnvelopeGenerator. Capabilityscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Capability# = "SIGNATURE_GENERATOR.ENVELOPE" |
| 35 | |
| 36 | // CapabilityTrustedIdentityVerifier is the name of the |
| 37 | // capability for a plugin to support verifying trusted identities. |
| 38 | CapabilityTrustedIdentityVerifierscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CapabilityTrustedIdentityVerifier. Capabilityscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Capability# = "SIGNATURE_VERIFIER.TRUSTED_IDENTITY" |
| 39 | |
| 40 | // CapabilityRevocationCheckVerifier is the name of the |
| 41 | // capability for a plugin to support verifying revocation checks. |
| 42 | CapabilityRevocationCheckVerifierscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CapabilityRevocationCheckVerifier. Capabilityscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Capability# = "SIGNATURE_VERIFIER.REVOCATION_CHECK" |
| 43 | ) |
| 44 | |
| 45 | // Command is a CLI command available in the plugin contract. |
| 46 | type Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# string |
| 47 | |
| 48 | // Request defines a plugin request, which is always associated to a command. |
| 49 | type Requestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Request# interface { |
| 50 | Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Request#Command.() Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# |
| 51 | Validatescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Request#Validate.() error |
| 52 | } |
| 53 | |
| 54 | const ( |
| 55 | // CommandGetMetadata is the name of the plugin command |
| 56 | // which must be supported by every plugin and returns the |
| 57 | // plugin metadata. |
| 58 | CommandGetMetadatascip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandGetMetadata. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "get-plugin-metadata" |
| 59 | |
| 60 | // CommandDescribeKey is the name of the plugin command |
| 61 | // which must be supported by every plugin that has the |
| 62 | // SIGNATURE_GENERATOR.RAW capability. |
| 63 | CommandDescribeKeyscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandDescribeKey. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "describe-key" |
| 64 | |
| 65 | // CommandGenerateSignature is the name of the plugin command |
| 66 | // which must be supported by every plugin that has the |
| 67 | // SIGNATURE_GENERATOR.RAW capability. |
| 68 | CommandGenerateSignaturescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandGenerateSignature. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "generate-signature" |
| 69 | |
| 70 | // CommandGenerateEnvelope is the name of the plugin command |
| 71 | // which must be supported by every plugin that has the |
| 72 | // SIGNATURE_GENERATOR.ENVELOPE capability. |
| 73 | CommandGenerateEnvelopescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandGenerateEnvelope. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "generate-envelope" |
| 74 | |
| 75 | // CommandVerifySignature is the name of the plugin command |
| 76 | // which must be supported by every plugin that has |
| 77 | // any SIGNATURE_VERIFIER.* capability |
| 78 | CommandVerifySignaturescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandVerifySignature. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "verify-signature" |
| 79 | |
| 80 | Versionscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Version. Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# = "version" |
| 81 | ) |