consent

package
v0.0.0-...-47fbb7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Consent protocol
	Consent = "consent"
	// PIURI stores the URI for the message type
	PIURI         = "https://dedis.epfl.ch/consent/1.0"
	InviteMsgType = PIURI + "/information/invite"
	// InformationRequestMsgType represents the information request message
	InformationRequestMsgType = PIURI + "/information/request"
	// InformationResponseMsgType represents the information response message
	InformationResponseMsgType = PIURI + "/information/response"
	// InformationFailureMsgType represents the information failure message
	InformationFailureMsgType = PIURI + "/information/failure"
	// ConsentGrantMsgType represents the consent grant message
	ConsentGrantMsgType = PIURI + "/consent/grant"
	// ConsentDenyMsgType represents the consent deny message
	ConsentDenyMsgType = PIURI + "/consent/deny"
	// DecryptionSuccessMsgType represents the decryption success message
	DecryptionSuccessMsgType = PIURI + "/decryption/success"
	// DecryptionFailureMsgType represents the decryption failure message
	DecryptionFailureMsgType = PIURI + "/decryption/failure"
)
View Source
const (

	// StateInfoRequested marks the info-request phase of consent protocol.
	StateInfoRequested = "inforequested"
	// StateInfoSent marks the info-sent phase of the consent protocol.
	StateInfoSent = "infosent"
	// StateInfoFailure marks the info-failure phase of the consent protocol.
	StateInfoFailure = "infofailure"
	// StateConsentGranted marks the consent-granted phase of the consent protocol.
	StateConsentGranted = "consentgranted"
	// StateConsentDenied marks the conent-denied phase of the consent protocol.
	StateConsentDenied = "consentdenied"
	// StateDecrypted marks the succesful decryption in consent protocol
	StateDecrypted = "decrypted"
	// StateDecryptError marks an error in decryption in consent protocol
	StateDecryptError = "decrypterror"
	// StateAbandoned marks the abandoned phase of the did-exchange protocol.
	StateAbandoned = "abandoned"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsentDeny

type ConsentDeny struct {
	ID     string            `json:"@id"`
	Type   string            `json:"@type"`
	Thread *decorator.Thread `json:"~thread,omitempty"`
}

ConsentDeny denotes consent grant message.

type ConsentGrant

type ConsentGrant struct {
	ID              string            `json:"@id"`
	Type            string            `json:"@type"`
	WriteInstanceID string            `json:"writeInstanceID"`
	Filename        string            `json:"filename"`
	Thread          *decorator.Thread `json:"~thread,omitempty"`
}

ConsentGrant denotes consent grant message.

type ConsentInvitation

type ConsentInvitation struct {
	ID       string                 `json:"@id"`
	Type     string                 `json:"@type"`
	Invite   didexchange.Invitation `json:"invitation"`
	Synopsis string                 `json:"synopsis"`
	CohortID string                 `json:"cohortID"`
}

type ContinueOptions

type ContinueOptions struct {
	InformationResponse *InformationResponse
	InformationFailure  *InformationFailure
	DecryptionSuccess   *DecryptionSuccess
	DecryptionFailure   *DecryptionFailure
}

ContinueOptions represents options that may be passed in the call to `Continue` on an action event.

type DecryptionFailure

type DecryptionFailure struct {
	ID     string            `json:"@id"`
	Type   string            `json:"@type"`
	Thread *decorator.Thread `json:"~thread,omitempty"`
}

DecryptionFailure denotes failure decrypting patient's data.

type DecryptionSuccess

type DecryptionSuccess struct {
	ID     string            `json:"@id"`
	Type   string            `json:"@type"`
	Thread *decorator.Thread `json:"~thread,omitempty"`
}

DecryptionSuccess denotes success decrypting patient's data.

type InformationFailure

type InformationFailure struct {
	ID     string            `json:"@id"`
	Type   string            `json:"@type"`
	Thread *decorator.Thread `json:"~thread,omitempty"`
}

InformationFailure contains the study retrieval failure cause.

type InformationRequest

type InformationRequest struct {
	ID       string            `json:"@id"`
	Type     string            `json:"@type"`
	CohortID string            `json:"cohortID"`
	Thread   *decorator.Thread `json:"~thread,omitempty"`
}

InformationRequest contains the paramters for the requested study.

type InformationResponse

type InformationResponse struct {
	ID           string            `json:"@id"`
	Type         string            `json:"@type"`
	Synopsis     string            `json:"synopsis"`
	Description  string            `json:"description"`
	MoreInfoLink string            `json:"moreInfoLink"`
	AcceptText   string            `json:"acceptText"`
	DenyText     string            `json:"denyText"`
	Contact      string            `json:"contact"`
	Thread       *decorator.Thread `json:"~thread,omitempty"`
}

InformationResponse contains the detailed study information.

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

Service for Consent protocol

func New

func New(prov provider) (*Service, error)

New returns a new instance of Consent Service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept returns true for supported incoming message types.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)

HandleInbound handles incoming DIDComm Messages for the Consent protocol.

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(msg service.DIDCommMsg, _, _ string) (string, error)

HandleOutbound handles outbound consent messages.

func (*Service) Name

func (s *Service) Name() string

Name returns the name of the service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL