services

package
v0.0.0-...-d8f4819 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceHeader string = "x-namespace"
	GroupHeader     string = "x-group"
	DIDHeader       string = "x-did"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptedCredential

type AcceptedCredential struct {
	Format          string      `json:"format"`
	Credential      interface{} `json:"credential,omitempty"`
	TransactionID   string      `json:"transaction_id,omitempty"`
	CNonce          string      `json:"c_nonce,omitempty"`
	CNonceExpiresIn int         `json:"c_nonce_expires_in,omitempty"`
}

type CredentialOffer

type CredentialOffer struct {
	GroupId   string                               `json:"groupId"`
	RequestId string                               `json:"requestId"`
	MetaData  credential.IssuerMetadata            `json:"metadata"`
	Offering  credential.CredentialOfferParameters `json:"offering"`
	Status    string                               `json:"status"`
	TimeStamp time.Time                            `json:"timestamp"`
}

type CredentialOfferPayload

type CredentialOfferPayload struct {
	CredentialOfferUri string `json:"credential_offer_uri,omitempty"`
	CredentialOffer    string `json:"credential_offer,omitempty"`
}

type CredentialRetrieval

type CredentialRetrieval struct {
	// contains filtered or unexported fields
}

func GetCredentialRetrieval

func GetCredentialRetrieval(client common.HttpClient) *CredentialRetrieval

func (*CredentialRetrieval) AcceptOffer

func (c *CredentialRetrieval) AcceptOffer(groupId string, requestId string, acceptanceData OfferAcceptanceData) (*AcceptedCredential, error)

func (*CredentialRetrieval) CreateOffer

func (c *CredentialRetrieval) CreateOffer(groupId string, offer CredentialOfferPayload) (string, error)

func (*CredentialRetrieval) GetOffers

func (c *CredentialRetrieval) GetOffers(groupId string) (*[]CredentialOffer, error)

type CredentialVerification

type CredentialVerification struct {
	// contains filtered or unexported fields
}

func GetCredentialVerification

func GetCredentialVerification(client common.HttpClient) *CredentialVerification

func (*CredentialVerification) AssignProof

func (cv *CredentialVerification) AssignProof(requestId string, userId string) error

func (*CredentialVerification) CreateProof

func (cv *CredentialVerification) CreateProof(requestId string, filterResults []presentation.FilterResult, namespace string, group string, signKey string, holderDid string) error

func (*CredentialVerification) GetProofRequest

func (cv *CredentialVerification) GetProofRequest(requestId string) (*PresentationRequest, error)

func (*CredentialVerification) GetProofRequestByProofRequestId

func (cv *CredentialVerification) GetProofRequestByProofRequestId(proofRequestId string) (*PresentationRequest, error)

type DIDComm

type DIDComm struct {
	// contains filtered or unexported fields
}

func GetDIDComm

func GetDIDComm(client common.HttpClient) *DIDComm

func NewDIDComm

func NewDIDComm(url string, httpClient common.HttpClient) *DIDComm

func (*DIDComm) BlockConnection

func (s *DIDComm) BlockConnection(did string) error

func (*DIDComm) DeleteConnection

func (s *DIDComm) DeleteConnection(did string) error

func (*DIDComm) GetConnectionList

func (s *DIDComm) GetConnectionList(accountID string, search string) ([]DIDCommConnection, error)
func (s *DIDComm) GetInviteLink(reqBody InvitationRequestBody) (string, error)

type DIDCommConnection

type DIDCommConnection struct {
	RemoteDid     string            `json:"remoteDid"`
	RoutingKey    string            `json:"routingKey"`
	Protocol      string            `json:"protocol"`
	Topic         string            `json:"topic"`
	EventType     string            `json:"eventType"`
	Properties    map[string]string `json:"properties"`
	RecipientDids []string          `json:"recipientDids"`
	Added         time.Time         `json:"added"`
	Group         string            `json:"group"`
}

type DIDVerificationMethod

type DIDVerificationMethod struct {
	// ID of verification method.
	ID string
	// Type of verification method key.
	Type string
	// Controller of verification method specified as DID.
	Controller string
	// Public Key encoded in JWK format.
	PublicKeyJwk any
}

DIDVerificationMethod Public Key represented as DID Verification Method.

type DataFetcher

type DataFetcher interface {
	GetUserInfo(ctx context.Context, accessToken string, realm string) (*gocloak.UserInfo, error)
}

type DidDocument

type DidDocument struct {
	// did of the document
	ID string
	// controller of the document
	Controller string
	// methods of the document
	VerificationMethod []*DIDVerificationMethod
	// service endpoints
	Service []*ServiceEndpoint
}

DidDocument is the result type of the signer service didDoc method.

type GetCredentialModel

type GetCredentialModel struct {
	Credentials map[string]interface{} `json:"credentials"`
	Receipt     string                 `json:"receipt"`
}

type GetListCredentialModel

type GetListCredentialModel struct {
	Groups  []presentation.FilterResult `json:"groups"`
	Receipt string                      `json:"receipt"`
}

type InvitationRequestBody

type InvitationRequestBody struct {
	Protocol   string            `json:"protocol"`
	Topic      string            `json:"topic"`
	Group      string            `json:"group"`
	EventType  string            `json:"eventType"`
	Properties map[string]string `json:"properties"`
}

RequestBody struct represents the JSON structure for the request body

type ListDidItem

type ListDidItem struct {
	Did  string `json:"did"`
	Name string `json:"name"`
}

type ListDidResponse

type ListDidResponse struct {
	List []ListDidItem `json:"list"`
}

type NilType

type NilType struct {
	// contains filtered or unexported fields
}

type OIDCProvider

type OIDCProvider struct {
	*gocloak.GoCloak
	// contains filtered or unexported fields
}

func GetOidcProvider

func GetOidcProvider(f ...DataFetcher) *OIDCProvider

func (*OIDCProvider) GetUser

func (p *OIDCProvider) GetUser(token string) (*common.UserInfo, error)

type OfferAcceptanceData

type OfferAcceptanceData struct {
	Accept          bool   `json:"accept"`
	EncryptionKey   []byte `json:"encryptionKey,omitempty"`
	HolderKey       string `json:"holderKey"`
	HolderNamespace string `json:"holderNamespace"`
	HolderGroup     string `json:"holderGroup"`
}

type Plugin

type Plugin struct {
	Name  string `json:"name"`
	Route string `json:"route"`
	URL   string `json:"url"`
}

type PluginDiscovery

type PluginDiscovery struct {
	// contains filtered or unexported fields
}

func GetPluginsDiscovery

func GetPluginsDiscovery(client common.HttpClient) *PluginDiscovery

func (*PluginDiscovery) ListPlugins

func (c *PluginDiscovery) ListPlugins() (*[]Plugin, error)

type PresentationRequest

type PresentationRequest struct {
	Region                 string                              `json:"region"`
	Country                string                              `json:"country"`
	Id                     string                              `json:"id"`
	RequestId              string                              `json:"requestId"`
	GroupId                string                              `json:"groupid"`
	PresentationDefinition presentation.PresentationDefinition `json:"presentationDefinition"`
	Presentation           []interface{}                       `json:"presentation"`
	RedirectUri            string                              `json:"redirectUri"`
	ResponseUri            string                              `json:"responseUri"`
	ResponseMode           string                              `json:"responseMode"`
	ResponseType           string                              `json:"responseType"`
	State                  string                              `json:"state"`
	LastUpdateTimeStamp    time.Time                           `json:"lastUpdateTimeStamp"`
	Nonce                  string                              `json:"nonce"`
	ClientId               string                              `json:"clientId"`
}

type Proof

type Proof struct {
	Payload       []presentation.FilterResult
	SignNamespace string
	SignKey       string
	SignGroup     string
	HolderDid     string
}

type ServiceEndpoint

type ServiceEndpoint struct {
	// did of the document
	ID string
	// type of endpoint
	Type string
	// Endpoint URL
	ServiceEndpoint string
}

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func GetSigner

func GetSigner(client common.HttpClient) *Signer

func (*Signer) GetDidDoc

func (s *Signer) GetDidDoc(id string, namespace string, group string) (*DidDocument, error)

func (*Signer) ListDidDocs

func (s *Signer) ListDidDocs(namespace string, group string) (*ListDidResponse, error)

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func GetStorage

func GetStorage(client common.HttpClient) *Storage

func (*Storage) GetCredentials

func (s *Storage) GetCredentials(auth string, accountId string, constraints *presentation.PresentationDefinition) ([]presentation.FilterResult, error)

func (*Storage) GetPresentations

func (s *Storage) GetPresentations(auth string, accountId string, constraints *presentation.PresentationDefinition) ([]presentation.FilterResult, error)

func (*Storage) Register

func (s *Storage) Register(auth string, accountId string) error

type TransactionModel

type TransactionModel struct {
	Nonce  string `json:"nonce"`
	Expire int64  `json:"expire"`
}

Jump to

Keyboard shortcuts

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