trustregistry

package
v0.0.0-...-8d5b3bf Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInteractionRestricted = errors.New("interaction restricted")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(httpClient *http.Client, host string) *Client

func (*Client) ValidateIssuer

func (c *Client) ValidateIssuer(
	ctx context.Context,
	issuerDID string,
	issuerDomain string,
	credentialOffers []CredentialOffer,
) (bool, error)

ValidateIssuer validates that the issuer is trusted according to policy.

func (*Client) ValidateVerifier

func (c *Client) ValidateVerifier(
	ctx context.Context,
	verifierDID,
	verifierDomain string,
	credentials []*verifiable.Credential,
) (bool, error)

type CredentialMatch

type CredentialMatch struct {
	CredentialID        string                 `json:"credential_id,omitempty"`
	CredentialTypes     []string               `json:"credential_types,omitempty"`
	ExpirationDate      string                 `json:"expiration_date,omitempty"`
	IssuanceDate        string                 `json:"issuance_date,omitempty"`
	IssuerID            string                 `json:"issuer_id,omitempty"`
	CredentialClaimKeys map[string]interface{} `json:"credential_claim_keys,omitempty"`
	CredentialFormat    string                 `json:"credential_format,omitempty"`
}

type CredentialOffer

type CredentialOffer struct {
	ClientAttestationRequested bool   `json:"client_attestation_requested,omitempty"`
	CredentialFormat           string `json:"credential_format,omitempty"`
	CredentialType             string `json:"credential_type,omitempty"`
}

CredentialOffer contains the data for a credential in a wallet issuance request.

type PolicyEvaluationResponse

type PolicyEvaluationResponse struct {
	Allowed     bool                    `json:"allowed"`
	DenyReasons *[]string               `json:"deny_reasons,omitempty"`
	Payload     *map[string]interface{} `json:"payload,omitempty"`
}

type WalletIssuanceRequest

type WalletIssuanceRequest struct {
	IssuerDID        string            `json:"issuer_did"`
	IssuerDomain     string            `json:"issuer_domain,omitempty"`
	CredentialOffers []CredentialOffer `json:"credential_offers"`
}

WalletIssuanceRequest is a request model for wallet issuance policy evaluation.

type WalletPresentationRequest

type WalletPresentationRequest struct {
	CredentialMatches []CredentialMatch `json:"credential_matches"`
	VerifierDID       string            `json:"verifier_did"`
	VerifierDomain    string            `json:"verifier_domain,omitempty"`
}

WalletPresentationRequest is a request model for wallet presentation policy evaluation.

Jump to

Keyboard shortcuts

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