Debian Codegraph @

plugin/describekey.go

raw symbols SCIP
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 pluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/
15
16 // DescribeKeyRequest contains the parameters passed in a describe-key request.
17 type DescribeKeyRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest# struct {
18 ContractVersionscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#ContractVersion. string `json:"contractVersion"`
19 KeyIDscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#KeyID. string `json:"keyId"`
20 PluginConfigscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#PluginConfig. map[string]string `json:"pluginConfig,omitempty"`
21 }
22
23 func (DescribeKeyRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#) Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#Command().() Commandscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Command# {
24 return CommandDescribeKeyscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/CommandDescribeKey.
25 }
26
27 // Validate validates DescribeKeyRequest struct
28 func (r DescribeKeyRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#) Validatescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#Validate().() error {
29 if r.ContractVersionscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#ContractVersion. == "" {
30 return NewValidationErrorscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/NewValidationError().("contractVersion cannot be empty")
31 }
32
33 if r.KeyIDscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#KeyID. == "" {
34 return NewValidationErrorscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/NewValidationError().("keyId cannot be empty")
35 }
36
37 return nil
38 }
39
40 // DescribeKeyResponse is the response of a describe-key request.
41 type DescribeKeyResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyResponse# struct {
42 // The same key id as passed in the request.
43 KeyIDscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyResponse#KeyID. string `json:"keyId"`
44
45 // One of following supported key types:
46 // https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#algorithm-selection
47 KeySpecscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyResponse#KeySpec. KeySpecscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/KeySpec# `json:"keySpec"`
48 }