model

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateManifestRequest

type CreateManifestRequest struct {
	Name              *string                        `json:"name,omitempty"`
	Description       *string                        `json:"description,omitempty"`
	IssuerDID         string                         `json:"issuerDid" validate:"required"`
	IssuerKID         string                         `json:"issuerKid" validate:"required"`
	IssuerName        *string                        `json:"issuerName,omitempty"`
	OutputDescriptors []manifestsdk.OutputDescriptor `json:"outputDescriptors" validate:"required,dive"`
	ClaimFormat       *exchange.ClaimFormat          `json:"format" validate:"required,dive"`
	// TODO: Allow for specifying the presentation definition only by id. https://github.com/TBD54566975/ssi-service/issues/491
	PresentationDefinition *exchange.PresentationDefinition `json:"presentationDefinition,omitempty" validate:"omitempty,dive"`
}

type CreateManifestResponse

type CreateManifestResponse struct {
	Manifest manifestsdk.CredentialManifest `json:"manifest"`
}

type CreateRequestRequest

type CreateRequestRequest struct {
	ManifestRequest Request `json:"manifestRequest"`
}

type CreateRequestResponse

type CreateRequestResponse struct {
	ManifestRequest Request `json:"manifestRequest"`
}

type CredentialOverride

type CredentialOverride struct {
	// Data that will be used to determine credential claims.
	Data map[string]any `json:"data"`

	// Parameter to determine the expiry of the credential.
	Expiry *time.Time `json:"expiry"`

	// Whether the credentials created should be revocable.
	Revocable bool `json:"revocable"`
}

type DeleteApplicationRequest

type DeleteApplicationRequest struct {
	ID string `json:"id,omitempty" validate:"required"`
}

type DeleteManifestRequest

type DeleteManifestRequest struct {
	ID string `json:"id" validate:"required"`
}

type DeleteRequestRequest

type DeleteRequestRequest struct {
	ID string `json:"id" validate:"required"`
}

type DeleteResponseRequest

type DeleteResponseRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetApplicationRequest

type GetApplicationRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetApplicationResponse

type GetApplicationResponse struct {
	// One of "pending", "fulfilled", "rejected". When Status is either fulfilled or rejected, a corresponding
	// SubmissionApplicationResponse is guaranteed to exist.
	Status      string
	Application manifestsdk.CredentialApplication `json:"application"`
}

type GetManifestRequest

type GetManifestRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetManifestResponse

type GetManifestResponse struct {
	Manifest manifestsdk.CredentialManifest `json:"manifest"`
}

type GetRequestRequest

type GetRequestRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetRequestResponse

type GetRequestResponse struct {
	ID              string  `json:"id"`
	ManifestRequest Request `json:"manifestRequest"`
}

type GetResponseRequest

type GetResponseRequest struct {
	ID string `json:"id,omitempty" validate:"required"`
}

type GetResponseResponse

type GetResponseResponse struct {
	Response    manifestsdk.CredentialResponse `json:"response"`
	Credentials any
	ResponseJWT keyaccess.JWT
}

type ListApplicationsResponse

type ListApplicationsResponse struct {
	Applications []manifestsdk.CredentialApplication `json:"applications,omitempty"`
}

type ListManifestsResponse

type ListManifestsResponse struct {
	Manifests []GetManifestResponse `json:"manifests,omitempty"`
}

type ListRequestsResponse

type ListRequestsResponse struct {
	ManifestRequests []Request `json:"manifestRequests"`
}

type ListResponsesResponse

type ListResponsesResponse struct {
	Responses []manifestsdk.CredentialResponse `json:"responses,omitempty"`
}

type Request

type Request struct {
	common.Request

	// ID of the credential manifest used for this request.
	ManifestID string `json:"manifestId" validate:"required"`

	// CredentialManifestJWT is a JWT token with a "presentation_definition" claim within it. The
	// value of the field named "presentation_definition.id" matches PresentationDefinitionID.
	// This is an output only field.
	CredentialManifestJWT keyaccess.JWT `json:"credentialManifestJwt"`
}

type ReviewApplicationRequest

type ReviewApplicationRequest struct {
	// ID of the application.
	ID       string `json:"id" validate:"required"`
	Approved bool   `json:"approved" validate:"required"`
	// Reason is only used upon denial
	Reason string `json:"reason"`

	CredentialOverrides map[string]CredentialOverride `json:"credentialOverrides,omitempty"`
}

ReviewApplicationRequest is something foobar

type SubmitApplicationRequest

type SubmitApplicationRequest struct {
	ApplicantDID    string                            `json:"applicantDid" validate:"required"`
	Application     manifestsdk.CredentialApplication `json:"application" validate:"required"`
	Credentials     []cred.Container                  `json:"credentials,omitempty"`
	ApplicationJWT  keyaccess.JWT                     `json:"applicationJwt,omitempty" validate:"required"`
	ApplicationJSON map[string]any                    `json:"applicationJson,omitempty"`
}

type SubmitApplicationResponse

type SubmitApplicationResponse struct {
	Response    manifestsdk.CredentialResponse `json:"response" validate:"required"`
	Credentials []any                          `json:"credentials,omitempty"`
	ResponseJWT keyaccess.JWT                  `json:"responseJwt,omitempty" validate:"required"`
}

func ServiceModel

func ServiceModel(storedResponse *storage.StoredResponse) SubmitApplicationResponse

ServiceModel creates a SubmitApplicationResponse from a given StoredResponse.

type VerifyManifestRequest

type VerifyManifestRequest struct {
	// ManifestJWT contains a `CredentialManifestWrapper` with a top level `credential_manifest` claim
	ManifestJWT keyaccess.JWT `json:"manifestJwt"`
}

type VerifyManifestResponse

type VerifyManifestResponse struct {
	Verified bool   `json:"verified"`
	Reason   string `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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