github.com/hyperledger/aries-framework-go@v0.3.2/pkg/didcomm/protocol/presentproof/models.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package presentproof
     8  
     9  import "github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/decorator"
    10  
    11  // ProposePresentationV2 is an optional message sent by the prover to the verifier to initiate a proof presentation
    12  // process, or in response to a request-presentation message when the prover wants to propose
    13  // using a different presentation format or request.
    14  type ProposePresentationV2 struct {
    15  	ID   string `json:"@id,omitempty"`
    16  	Type string `json:"@type,omitempty"`
    17  	// Comment is a field that provides some human readable information about the proposed presentation.
    18  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
    19  	Comment string `json:"comment,omitempty"`
    20  	// Formats contains an entry for each proposal~attach array entry, including an optional value of the
    21  	// attachment @id (if attachments are present) and the verifiable presentation format and version of the attachment.
    22  	Formats []Format `json:"formats,omitempty"`
    23  	// ProposalsAttach is an array of attachments that further define the presentation request being proposed.
    24  	// This might be used to clarify which formats or format versions are wanted.
    25  	ProposalsAttach []decorator.Attachment `json:"proposals~attach,omitempty"`
    26  }
    27  
    28  // ProposePresentationV3 is an optional message sent by the prover to the verifier to initiate a proof presentation
    29  // process, or in response to a request-presentation message when the prover wants to propose
    30  // using a different presentation format or request.
    31  type ProposePresentationV3 struct {
    32  	ID   string                    `json:"id,omitempty"`
    33  	Type string                    `json:"type,omitempty"`
    34  	Body ProposePresentationV3Body `json:"body,omitempty"`
    35  	// Attachments is an array of attachments that further define the presentation request being proposed.
    36  	// This might be used to clarify which formats or format versions are wanted.
    37  	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
    38  }
    39  
    40  // ProposePresentationV3Body represents body for ProposePresentationV3.
    41  type ProposePresentationV3Body struct {
    42  	GoalCode string `json:"goal_code,omitempty"`
    43  	// Comment is a field that provides some human readable information about the proposed presentation.
    44  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
    45  	Comment string `json:"comment,omitempty"`
    46  }
    47  
    48  // RequestPresentationV2 describes values that need to be revealed and predicates that need to be fulfilled.
    49  type RequestPresentationV2 struct {
    50  	ID   string `json:"@id,omitempty"`
    51  	Type string `json:"@type,omitempty"`
    52  	// Comment is a field that provides some human readable information about the proposed presentation.
    53  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
    54  	Comment string `json:"comment,omitempty"`
    55  	// WillConfirm is a field that defaults to "false" to indicate that the verifier will or will not
    56  	// send a post-presentation confirmation ack message.
    57  	WillConfirm bool `json:"will_confirm,omitempty"`
    58  	// Formats contains an entry for each request_presentations~attach array entry, providing the the value of the
    59  	// attachment @id and the verifiable presentation request format and version of the attachment.
    60  	Formats []Format `json:"formats,omitempty"`
    61  	// RequestPresentationsAttach is an array of attachments containing the acceptable verifiable presentation requests.
    62  	RequestPresentationsAttach []decorator.Attachment `json:"request_presentations~attach,omitempty"`
    63  }
    64  
    65  // RequestPresentationV3 describes values that need to be revealed and predicates that need to be fulfilled.
    66  type RequestPresentationV3 struct {
    67  	ID   string                    `json:"id,omitempty"`
    68  	Type string                    `json:"type,omitempty"`
    69  	Body RequestPresentationV3Body `json:"body,omitempty"`
    70  	// Attachments is an array of attachments containing the acceptable verifiable presentation requests.
    71  	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
    72  }
    73  
    74  // RequestPresentationV3Body represents body for RequestPresentationV3.
    75  type RequestPresentationV3Body struct {
    76  	GoalCode string `json:"goal_code,omitempty"`
    77  	// Comment is a field that provides some human readable information about the proposed presentation.
    78  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
    79  	Comment string `json:"comment,omitempty"`
    80  	// WillConfirm is a field that defaults to "false" to indicate that the verifier will or will not
    81  	// send a post-presentation confirmation ack message.
    82  	WillConfirm bool `json:"will_confirm,omitempty"`
    83  }
    84  
    85  // PresentationV2 is a response to a RequestPresentationV2 message and contains signed presentations.
    86  // TODO: Add ~please_ack decorator support for the protocol [Issue #2047].
    87  type PresentationV2 struct {
    88  	ID   string `json:"@id,omitempty"`
    89  	Type string `json:"@type,omitempty"`
    90  	// Comment is a field that provides some human readable information about the proposed presentation.
    91  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300].
    92  	Comment string `json:"comment,omitempty"`
    93  	// Formats contains an entry for each presentations~attach array entry, providing the the value of the attachment
    94  	// @id and the verifiable presentation format and version of the attachment.
    95  	Formats []Format `json:"formats,omitempty"`
    96  	// PresentationsAttach an array of attachments containing the presentation in the requested format(s).
    97  	PresentationsAttach []decorator.Attachment `json:"presentations~attach,omitempty"`
    98  }
    99  
   100  // Format contains the value of the attachment @id and the verifiable credential format of the attachment.
   101  type Format struct {
   102  	AttachID string `json:"attach_id,omitempty"`
   103  	Format   string `json:"format,omitempty"`
   104  }
   105  
   106  // PresentationV3 is a response to a RequestPresentationV3 message and contains signed presentations.
   107  type PresentationV3 struct {
   108  	Type string             `json:"type,omitempty"`
   109  	Body PresentationV3Body `json:"body,omitempty"`
   110  	// Attachments is an array of attachments that further define the presentation request being proposed.
   111  	// This might be used to clarify which formats or format versions are wanted.
   112  	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
   113  }
   114  
   115  // PresentationV3Body represents body for PresentationV3.
   116  type PresentationV3Body struct {
   117  	GoalCode string `json:"goal_code,omitempty"`
   118  	// Comment is a field that provides some human readable information about the proposed presentation.
   119  	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
   120  	Comment string `json:"comment,omitempty"`
   121  }