router

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: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuerParam  string = "issuer"
	SubjectParam string = "subject"
	SchemaParam  string = "schema"
)
View Source
const (
	MethodParam  = "method"
	IDParam      = "id"
	DeletedParam = "deleted"
)
View Source
const (
	ParentParam string = "parent"
	FilterParam string = "filter"
)
View Source
const (
	DoneIdentifier = "done"
	True           = "true"
	False          = "false"
)
View Source
const FilterCharacterLimit = 1024
View Source
const (
	HealthOK string = "OK"
)

Variables

This section is empty.

Functions

func Health

func Health(c *gin.Context)

Health godoc

@Summary		Health Check
@Description	Health is a simple handler that always responds with a 200 OK
@Tags			HealthCheck
@Accept			json
@Produce		json
@Success		200	{object}	GetHealthCheckResponse
@Router			/health [get]

func Readiness

func Readiness(services []svcframework.Service) gin.HandlerFunc

Types

type CommonCreateRequestRequest

type CommonCreateRequestRequest struct {
	// Audience as defined in https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1.3
	// Optional
	Audience []string `json:"audience"`

	// Expiration as defined in https://www.rfc-editor.org/rfc/rfc7519.html#section-4.1.4
	// Optional. When not specified, the request will be valid for a default duration.
	Expiration string `json:"expiration"`

	// DID of the issuer of this presentation definition. The DID must have been previously created with the DID API,
	// or the PrivateKey must have been added independently.
	IssuerDID string `json:"issuerId" validate:"required"`

	// The privateKey associated with the KID will be used to sign an envelope that contains
	// the created presentation definition.
	IssuerKID string `json:"issuerKid" validate:"required"`
}

type CreateCredentialRequest

type CreateCredentialRequest struct {
	// The issuer id.
	Issuer string `json:"issuer" validate:"required" example:"did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp"`

	// The KID used to sign the credential.
	IssuerKID string `json:"issuerKid" validate:"required" example:"#z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp"`

	// The subject id.
	Subject string `json:"subject" validate:"required" example:"did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp"`

	// A context is optional. If not present, we'll apply default, required context values.
	Context string `json:"@context,omitempty"`

	// A schema ID is optional. If present, we'll attempt to look it up and validate the data against it.
	SchemaID string `json:"schemaId,omitempty"`

	// Claims about the subject. The keys should be predicates (e.g. "alumniOf"), and the values can be any object.
	Data map[string]any `json:"data" validate:"required" swaggertype:"object,string" example:"alumniOf:did_for_uni"`

	// Optional. Corresponds to `expirationDate` in https://www.w3.org/TR/vc-data-model/#expiration.
	Expiry string `json:"expiry,omitempty" example:"2020-01-01T19:23:24Z"`

	// Whether this credential can be revoked. When true, the created VC will have the "credentialStatus"
	// property set.
	Revocable bool `json:"revocable,omitempty"`

	// Whether this credential can be suspended. When true, the created VC will have the "credentialStatus"
	// property set.
	Suspendable bool `json:"suspendable,omitempty"`
}

type CreateCredentialResponse

type CreateCredentialResponse struct {
	credmodel.Container
}

type CreateDIDByMethodRequest

type CreateDIDByMethodRequest struct {
	// Identifies the cryptographic algorithm family to use when generating this key.
	// One of the following: "Ed25519", "X25519", "secp256k1", "P-224","P-256","P-384", "P-521", "RSA"
	KeyType crypto.KeyType `json:"keyType" validate:"required"`

	// Options for creating the DID. Implementation dependent on the method.
	Options any `json:"options,omitempty"`
}

type CreateDIDByMethodResponse

type CreateDIDByMethodResponse struct {
	DID didsdk.Document `json:"did,omitempty"`
}

type CreateIssuanceTemplateRequest

type CreateIssuanceTemplateRequest struct {
	issuance.Template
}

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"`
	ClaimFormat            *exchange.ClaimFormat            `json:"format" validate:"required,dive"`
	OutputDescriptors      []manifestsdk.OutputDescriptor   `json:"outputDescriptors" validate:"required,dive"`
	PresentationDefinition *exchange.PresentationDefinition `json:"presentationDefinition,omitempty" validate:"omitempty,dive"`
}

CreateManifestRequest is the request body for creating a manifest, which populates all remaining fields and builds a well-formed manifest object.

func (CreateManifestRequest) ToServiceRequest

func (c CreateManifestRequest) ToServiceRequest() model.CreateManifestRequest

type CreateManifestRequestRequest

type CreateManifestRequestRequest struct {
	*CommonCreateRequestRequest

	// ID of the credential manifest to use for this request.
	CredentialManifestID string `json:"credentialManifestId" validate:"required"`
}

type CreateManifestRequestResponse

type CreateManifestRequestResponse struct {
	Request *model.Request `json:"manifestRequest"`
}

type CreateManifestResponse

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

type CreatePresentationDefinitionRequest

type CreatePresentationDefinitionRequest struct {
	Name                   string                           `json:"name,omitempty"`
	Purpose                string                           `json:"purpose,omitempty"`
	Format                 *exchange.ClaimFormat            `json:"format,omitempty" validate:"omitempty,dive"`
	InputDescriptors       []exchange.InputDescriptor       `json:"inputDescriptors" validate:"required,dive"`
	SubmissionRequirements []exchange.SubmissionRequirement `json:"submissionRequirements,omitempty" validate:"omitempty,dive"`
}

type CreatePresentationDefinitionResponse

type CreatePresentationDefinitionResponse struct {
	PresentationDefinition exchange.PresentationDefinition `json:"presentation_definition,omitempty"`

	// Signed envelope that contains the PresentationDefinition created using the privateKey of the author of the
	// definition.
	PresentationDefinitionJWT keyaccess.JWT `json:"presentationDefinitionJwt,omitempty"`
}

type CreateRequestRequest

type CreateRequestRequest struct {
	*CommonCreateRequestRequest
	// ID of the presentation definition to use for this request.
	PresentationDefinitionID string `json:"presentationDefinitionId" validate:"required"`
}

type CreateRequestResponse

type CreateRequestResponse struct {
	Request *model.Request `json:"presentationRequest"`
}

type CreateSchemaRequest

type CreateSchemaRequest struct {
	// Name is a human-readable name for a schema
	Name string `json:"name" validate:"required"`
	// Description is an optional human-readable description for a schema
	Description string `json:"description,omitempty"`
	// Schema represents the JSON schema for the credential schema
	// If the schema has an $id field, it will be overwritten with an ID the service generates.
	// The schema must be against draft 2020-12, 2019-09, or 7.
	Schema schemalib.JSONSchema `json:"schema" validate:"required"`
}

type CreateSchemaResponse

type CreateSchemaResponse struct {
	ID               string               `json:"id"`
	Schema           schemalib.JSONSchema `json:"schema"`
	CredentialSchema *keyaccess.JWT       `json:"credentialSchema,omitempty"`
}

type CreateSubmissionRequest

type CreateSubmissionRequest struct {
	// A Verifiable Presentation that's encoded as a JWT.
	// Verifiable Presentation are described in https://www.w3.org/TR/vc-data-model/#presentations-0
	// JWT encoding of the Presentation as described in https://www.w3.org/TR/vc-data-model/#presentations-0
	SubmissionJWT keyaccess.JWT `json:"submissionJwt" validate:"required"`
}

type CreateWebhookRequest

type CreateWebhookRequest struct {
	// The noun (entity) for the new webhook.eg: Credential
	Noun webhook.Noun `json:"noun" validate:"required"`
	// The verb for the new webhook.eg: Create
	Verb webhook.Verb `json:"verb" validate:"required"`
	// The URL to post the output of this request to Noun.Verb action to.
	URL string `json:"url" validate:"required"`
}

CreateWebhookRequest In the context of webhooks, it's common to use noun.verb notation to describe events, such as "credential.create" or "schema.delete".

type CreateWebhookResponse

type CreateWebhookResponse struct {
	Webhook webhook.Webhook `json:"webhook"`
}

type CredentialRouter

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

func NewCredentialRouter

func NewCredentialRouter(s svcframework.Service) (*CredentialRouter, error)

func (CredentialRouter) CreateCredential

func (cr CredentialRouter) CreateCredential(c *gin.Context)

CreateCredential godoc

@Summary		Create Credential
@Description	Create a verifiable credential
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			request	body		CreateCredentialRequest	true	"request body"
@Success		201		{object}	CreateCredentialResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/credentials [put]

func (CredentialRouter) DeleteCredential

func (cr CredentialRouter) DeleteCredential(c *gin.Context)

DeleteCredential godoc

@Summary		Delete Credentials
@Description	Delete credential by ID
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID of the credential to delete"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/credentials/{id} [delete]

func (CredentialRouter) GetCredential

func (cr CredentialRouter) GetCredential(c *gin.Context)

GetCredential godoc

@Summary		Get Credential
@Description	Get credential by id
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetCredentialResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/credentials/{id} [get]

func (CredentialRouter) GetCredentialStatus

func (cr CredentialRouter) GetCredentialStatus(c *gin.Context)

GetCredentialStatus godoc

@Summary		Get Credential Status
@Description	Get credential status by id
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetCredentialStatusResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/credentials/{id}/status [get]

func (CredentialRouter) GetCredentialStatusList

func (cr CredentialRouter) GetCredentialStatusList(c *gin.Context)

GetCredentialStatusList godoc

@Summary		Get Credential Status List
@Description	Get credential status list by id.
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetCredentialStatusListResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/credentials/status/{id} [get]

func (CredentialRouter) ListCredentials

func (cr CredentialRouter) ListCredentials(c *gin.Context)

ListCredentials godoc

@Summary		List Credentials
@Description	Checks for the presence of a query parameter and calls the associated filtered get method. Only one parameter is allowed to be specified.
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			issuer	query		string	false	"The issuer id"	example(did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp)
@Param			schema	query		string	false	"The credentialSchema.id value to filter by"
@Param			subject	query		string	false	"The credentialSubject.id value to filter by"
@Success		200		{object}	ListCredentialsResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/credentials [get]

func (CredentialRouter) UpdateCredentialStatus

func (cr CredentialRouter) UpdateCredentialStatus(c *gin.Context)

UpdateCredentialStatus godoc

@Summary		Update Credential Status
@Description	Update a credential's status
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			request	body		UpdateCredentialStatusRequest	true	"request body"
@Success		201		{object}	UpdateCredentialStatusResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/credentials/{id}/status [put]

func (CredentialRouter) VerifyCredential

func (cr CredentialRouter) VerifyCredential(c *gin.Context)

VerifyCredential godoc

@Summary		Verify Credential
@Description	Verify a given credential by its id. The system does the following levels of verification:
@Description	1. Makes sure the credential has a valid signature
@Description	2. Makes sure the credential has is not expired
@Description	3. Makes sure the credential complies with the VC Data Model
@Description	4. If the credential has a schema, makes sure its data complies with the schema
@Tags			CredentialAPI
@Accept			json
@Produce		json
@Param			request	body		VerifyCredentialRequest	true	"request body"
@Success		200		{object}	VerifyCredentialResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/credentials/verification [put]

type DIDRouter

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

DIDRouter represents the dependencies required to instantiate a DID-HTTP service

func NewDIDRouter

func NewDIDRouter(s svcframework.Service) (*DIDRouter, error)

NewDIDRouter creates an HTP router for the DID Service

func (DIDRouter) CreateDIDByMethod

func (dr DIDRouter) CreateDIDByMethod(c *gin.Context)

CreateDIDByMethod godoc

@Summary		Create DID Document
@Description	Creates a fully custodial DID document with the given method. The document created is stored internally
@Description	and can be retrieved using the GetOperation. Method dependent registration (for example, DID web
@Description	registration) is left up to the clients of this API. The private key(s) created by the method are stored
@Description	internally never leave the service boundary.
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Param			request	body		CreateDIDByMethodRequest	true	"request body"
@Param			method	path		string						true	"Method"
@Success		201		{object}	CreateDIDByMethodResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/dids/{method} [put]

func (DIDRouter) GetDIDByMethod

func (dr DIDRouter) GetDIDByMethod(c *gin.Context)

GetDIDByMethod godoc

@Summary		Get DID
@Description	Get DID by method
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Param			request	body		CreateDIDByMethodRequest	true	"request body"
@Param			method	path		string						true	"Method"
@Param			id		path		string						true	"ID"
@Success		200		{object}	GetDIDByMethodResponse
@Failure		400		{string}	string	"Bad request"
@Router			/v1/dids/{method}/{id} [get]

func (DIDRouter) ListDIDMethods

func (dr DIDRouter) ListDIDMethods(c *gin.Context)

ListDIDMethods godoc

@Summary		List DID Methods
@Description	Get the list of supported DID methods
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListDIDMethodsResponse
@Router			/v1/dids [get]

func (DIDRouter) ListDIDsByMethod

func (dr DIDRouter) ListDIDsByMethod(c *gin.Context)

ListDIDsByMethod godoc

@Summary		List DIDs
@Description	List DIDs by method. Checks for an optional "deleted=true" query parameter, which exclusively returns DIDs that have been "Soft Deleted".
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Param			deleted	query		boolean	false	"When true, returns soft-deleted DIDs. Otherwise, returns DIDs that have not been soft-deleted. Default is false."
@Success		200		{object}	ListDIDsByMethodResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/dids/{method} [get]

func (DIDRouter) ResolveDID

func (dr DIDRouter) ResolveDID(c *gin.Context)

ResolveDID godoc

@Summary		Resolve a DID
@Description	Resolve a DID that may not be stored in this service
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	ResolveDIDResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/dids/resolver/{id} [get]

func (DIDRouter) SoftDeleteDIDByMethod

func (dr DIDRouter) SoftDeleteDIDByMethod(c *gin.Context)

SoftDeleteDIDByMethod godoc

@Description	When this is called with the correct did method and id it will flip the softDelete flag to true for the db entry.
@Description	A user can still get the did if they know the DID ID, and the did keys will still exist, but this did will not show up in the ListDIDsByMethod call
@Description	This facilitates a clean SSI-Service Admin UI but not leave any hanging VCs with inaccessible hanging DIDs.
@Summary		Soft Delete DID
@Description	Soft Deletes DID by method
@Tags			DecentralizedIdentityAPI
@Accept			json
@Produce		json
@Param			method	path		string	true	"Method"
@Param			id		path		string	true	"ID"
@Success		204		{string}	string	"No Content"
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/dids/{method}/{id} [delete]

type DeleteWebhookRequest

type DeleteWebhookRequest struct {
	Noun webhook.Noun `json:"noun" validate:"required"`
	Verb webhook.Verb `json:"verb" validate:"required"`
	URL  string       `json:"url" validate:"required"`
}

type GetApplicationResponse

type GetApplicationResponse struct {
	ID          string                            `json:"id"`
	Application manifestsdk.CredentialApplication `json:"application"`
}

type GetCredentialResponse

type GetCredentialResponse struct {
	ID            string                        `json:"id"`
	Credential    *credsdk.VerifiableCredential `json:"credential,omitempty"`
	CredentialJWT *keyaccess.JWT                `json:"credentialJwt,omitempty"`
}

type GetCredentialStatusListResponse

type GetCredentialStatusListResponse struct {
	ID string `json:"id"`
	// Credential where type includes "VerifiableCredential" and "StatusList2021".
	Credential *credsdk.VerifiableCredential `json:"credential,omitempty"`

	// The JWT signed with the associated issuer's private key.
	CredentialJWT *keyaccess.JWT `json:"credentialJwt,omitempty"`
}

type GetCredentialStatusResponse

type GetCredentialStatusResponse struct {
	// Whether the credential has been revoked.
	Revoked bool `json:"revoked"`
	// Whether the credential has been suspended.
	Suspended bool `json:"suspended"`
}

type GetDIDByMethodResponse

type GetDIDByMethodResponse struct {
	DID didsdk.Document `json:"did"`
}

type GetDIDsRequest

type GetDIDsRequest struct {
	// A standard filter expression conforming to https://google.aip.dev/160.
	// Not implemented yet.
	Filter string `json:"filter,omitempty"`
}

type GetHealthCheckResponse

type GetHealthCheckResponse struct {
	// Status is always equal to `OK`.
	Status string `json:"status"`
}

type GetKeyDetailsResponse

type GetKeyDetailsResponse struct {
	ID         string         `json:"id,omitempty"`
	Type       crypto.KeyType `json:"type,omitempty"`
	Controller string         `json:"controller,omitempty"`

	// Represents the time at which the key was created. Encoded according to RFC3339.
	CreatedAt string `json:"createdAt,omitempty"`

	// The public key in JWK format according to RFC7517. This public key is associated with the private
	// key with the associated ID.
	PublicKeyJWK jwx.PublicKeyJWK `json:"publicKeyJwk"`
}

type GetManifestRequestResponse

type GetManifestRequestResponse struct {
	Request *model.Request `json:"manifestRequest"`
}

type GetPresentationDefinitionResponse

type GetPresentationDefinitionResponse struct {
	PresentationDefinition exchange.PresentationDefinition `json:"presentation_definition,omitempty"`
}

type GetReadinessResponse

type GetReadinessResponse struct {
	// Overall status of the ssi service.
	Status svcframework.Status `json:"status"`

	// A map from the name of the service to the status of that current service.
	ServiceStatuses map[svcframework.Type]svcframework.Status `json:"serviceStatuses"`
}

type GetRequestResponse

type GetRequestResponse struct {
	Request *model.Request `json:"presentationRequest"`
}

type GetResponseResponse

type GetResponseResponse struct {
	Response manifestsdk.CredentialResponse `json:"credential_response"`
	// this is an interface type to union Data Integrity and JWT style VCs
	Credentials any           `json:"verifiableCredentials,omitempty"`
	ResponseJWT keyaccess.JWT `json:"responseJwt"`
}

type GetSchemaResponse

type GetSchemaResponse struct {
	Schema           schemalib.JSONSchema `json:"schema,omitempty"`
	CredentialSchema *keyaccess.JWT       `json:"credentialSchema,omitempty"`
}

type GetSubmissionResponse

type GetSubmissionResponse struct {
	*model.Submission
}

type GetSupportedNounsResponse

type GetSupportedNounsResponse struct {
	Nouns []webhook.Noun `json:"nouns,omitempty"`
}

type GetSupportedVerbsResponse

type GetSupportedVerbsResponse struct {
	Verbs []webhook.Verb `json:"verbs,omitempty"`
}

type IssuanceRouter

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

func NewIssuanceRouter

func NewIssuanceRouter(svc svcframework.Service) (*IssuanceRouter, error)

func (IssuanceRouter) CreateIssuanceTemplate

func (ir IssuanceRouter) CreateIssuanceTemplate(c *gin.Context)

CreateIssuanceTemplate godoc

@Summary		Create issuance template
@Description	Create issuance template
@Tags			IssuanceAPI
@Accept			json
@Produce		json
@Param			request	body		CreateIssuanceTemplateRequest	true	"request body"
@Success		201		{object}	issuance.Template
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/issuancetemplates [put]

func (IssuanceRouter) DeleteIssuanceTemplate

func (ir IssuanceRouter) DeleteIssuanceTemplate(c *gin.Context)

DeleteIssuanceTemplate godoc

@Summary		Delete issuance template
@Description	Delete issuance template by ID
@Tags			IssuanceAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/issuancetemplates/{id} [delete]

func (IssuanceRouter) GetIssuanceTemplate

func (ir IssuanceRouter) GetIssuanceTemplate(c *gin.Context)

GetIssuanceTemplate godoc

@Summary		Get issuance template
@Description	Get an issuance template by its id
@Tags			IssuanceAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	issuance.Template
@Failure		400	{string}	string	"Bad request"
@Router			/v1/issuancetemplates/{id} [get]

func (IssuanceRouter) ListIssuanceTemplates

func (ir IssuanceRouter) ListIssuanceTemplates(c *gin.Context)

ListIssuanceTemplates godoc

@Summary		Lists issuance templates
@Description	Lists all issuance templates stored in this service.
@Tags			IssuanceAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListIssuanceTemplatesResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests [get]

type KeyStoreRouter

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

func NewKeyStoreRouter

func NewKeyStoreRouter(s svcframework.Service) (*KeyStoreRouter, error)

func (*KeyStoreRouter) GetKeyDetails

func (ksr *KeyStoreRouter) GetKeyDetails(c *gin.Context)

GetKeyDetails godoc

@Summary		Get Details For Key
@Description	Get details about a stored key
@Tags			KeyStoreAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID of the key to get"
@Success		200	{object}	GetKeyDetailsResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/keys/{id} [get]

func (*KeyStoreRouter) RevokeKey

func (ksr *KeyStoreRouter) RevokeKey(c *gin.Context)

RevokeKey godoc

@Summary		Revoke Key
@Description	Marks the stored key as being revoked, along with the timestamps of when it was revoked. NB: the key can still be used for signing. This will likely be addressed before v1 is released.
@Tags			KeyStoreAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID of the key to revoke"
@Success		200	{object}	RevokeKeyResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/keys/{id} [delete]

func (*KeyStoreRouter) StoreKey

func (ksr *KeyStoreRouter) StoreKey(c *gin.Context)

StoreKey godoc

@Summary		Store Key
@Description	Stores a key to be used by the service
@Tags			KeyStoreAPI
@Accept			json
@Produce		json
@Param			request	body	StoreKeyRequest	true	"request body"
@Success		201
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/keys [put]

type ListApplicationsResponse

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

type ListCredentialsResponse

type ListCredentialsResponse struct {
	// Array of credentials that match the query parameters.
	Credentials []credmodel.Container `json:"credentials,omitempty"`
}

type ListDIDMethodsResponse

type ListDIDMethodsResponse struct {
	DIDMethods []didsdk.Method `json:"method,omitempty"`
}

type ListDIDsByMethodResponse

type ListDIDsByMethodResponse struct {
	DIDs []didsdk.Document `json:"dids,omitempty"`
}

type ListDefinitionsResponse

type ListDefinitionsResponse struct {
	Definitions []*exchange.PresentationDefinition `json:"definitions,omitempty"`
}

type ListIssuanceTemplatesResponse

type ListIssuanceTemplatesResponse struct {
	IssuanceTemplates []issuance.Template `json:"issuanceTemplates,omitempty"`
}

type ListManifestRequestsResponse

type ListManifestRequestsResponse struct {
	// The manifest requests matching the query.
	Requests []model.Request `json:"manifestRequests"`
}

type ListManifestResponse

type ListManifestResponse struct {
	ID       string                         `json:"id"`
	Manifest manifestsdk.CredentialManifest `json:"credential_manifest"`
}

type ListManifestsResponse

type ListManifestsResponse struct {
	Manifests []ListManifestResponse `json:"manifests"`
}

type ListOperationsResponse

type ListOperationsResponse struct {
	Operations []Operation `json:"operations"`
}

type ListPresentationRequestsResponse

type ListPresentationRequestsResponse struct {
	// The presentation requests matching the query.
	Requests []model.Request `json:"presentationRequests"`
}

type ListResponsesResponse

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

type ListSchemasResponse

type ListSchemasResponse struct {
	Schemas []GetSchemaResponse `json:"schemas,omitempty"`
}

type ListSubmissionResponse

type ListSubmissionResponse struct {
	Submissions []model.Submission `json:"submissions,omitempty"`
}

type ListWebhookResponse

type ListWebhookResponse struct {
	Webhook webhook.Webhook `json:"webhook"`
}

type ListWebhooksResponse

type ListWebhooksResponse struct {
	Webhooks []ListWebhookResponse `json:"webhooks,omitempty"`
}

type ManifestRouter

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

func NewManifestRouter

func NewManifestRouter(s svcframework.Service) (*ManifestRouter, error)

func (ManifestRouter) CreateManifest

func (mr ManifestRouter) CreateManifest(c *gin.Context)

CreateManifest godoc

@Summary		Create manifest
@Description	Create manifest
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			request	body		CreateManifestRequest	true	"request body"
@Success		201		{object}	CreateManifestResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/manifests [put]

func (ManifestRouter) CreateRequest

func (mr ManifestRouter) CreateRequest(c *gin.Context)

CreateRequest godoc

@Summary		Create Manifest Request Request
@Description	Create manifest request from an existing credential manifest.
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			request	body		CreateManifestRequestRequest	true	"request body"
@Success		201		{object}	CreateManifestRequestResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/manifests/requests [put]

func (ManifestRouter) DeleteApplication

func (mr ManifestRouter) DeleteApplication(c *gin.Context)

DeleteApplication godoc

@Summary		Delete applications
@Description	Delete application by ID
@Tags			ApplicationAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/applications/{id} [delete]

func (ManifestRouter) DeleteManifest

func (mr ManifestRouter) DeleteManifest(c *gin.Context)

DeleteManifest godoc

@Summary		Delete manifests
@Description	Delete manifest by ID
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/{id} [delete]

func (ManifestRouter) DeleteRequest

func (mr ManifestRouter) DeleteRequest(c *gin.Context)

DeleteRequest godoc

@Summary		Delete Manifest Request
@Description	Delete a manifest request by its ID
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/requests/{id} [delete]

func (ManifestRouter) DeleteResponse

func (mr ManifestRouter) DeleteResponse(c *gin.Context)

DeleteResponse godoc

@Summary		Delete responses
@Description	Delete response by ID
@Tags			ResponseAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{string}	string	"OK"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/responses/{id} [delete]

func (ManifestRouter) GetApplication

func (mr ManifestRouter) GetApplication(c *gin.Context)

GetApplication godoc

@Summary		Get application
@Description	Get application by id
@Tags			ApplicationAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetApplicationResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/manifests/applications/{id} [get]

func (ManifestRouter) GetManifest

func (mr ManifestRouter) GetManifest(c *gin.Context)

GetManifest godoc

@Summary		Get manifest
@Description	Get a credential manifest by its id
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	ListManifestResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/manifests/{id} [get]

func (ManifestRouter) GetRequest

func (mr ManifestRouter) GetRequest(c *gin.Context)

GetRequest godoc

@Summary		Get Manifest Request
@Description	Get a manifest request by its ID
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetManifestRequestResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/manifests/requests/{id} [get]

func (ManifestRouter) GetResponse

func (mr ManifestRouter) GetResponse(c *gin.Context)

GetResponse godoc

@Summary		Get response
@Description	Get response by id
@Tags			ResponseAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetResponseResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/responses/{id} [get]

func (ManifestRouter) ListApplications

func (mr ManifestRouter) ListApplications(c *gin.Context)

ListApplications godoc

@Summary		List applications
@Description	List all the existing applications.
@Tags			ApplicationAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListApplicationsResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/applications [get]

func (ManifestRouter) ListManifests

func (mr ManifestRouter) ListManifests(c *gin.Context)

ListManifests godoc

@Summary		List manifests
@Description	Checks for the presence of a query parameter and calls the associated filtered get method
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Param			issuer	query		string	false	"string issuer"
@Param			schema	query		string	false	"string schema"
@Param			subject	query		string	false	"string subject"
@Success		200		{object}	ListManifestsResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/manifests [get]

func (ManifestRouter) ListRequests

func (mr ManifestRouter) ListRequests(c *gin.Context)

ListRequests godoc

@Summary		List Credential Manifest Requests
@Description	Lists all the existing credential manifest requests
@Tags			ManifestAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListManifestRequestsResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/requests [get]

func (ManifestRouter) ListResponses

func (mr ManifestRouter) ListResponses(c *gin.Context)

ListResponses godoc

@Summary		List responses
@Description	Lists all responses
@Tags			ResponseAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListResponsesResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/manifests/responses [get]

func (ManifestRouter) ReviewApplication

func (mr ManifestRouter) ReviewApplication(c *gin.Context)

ReviewApplication godoc

@Summary		Reviews an application
@Description	Reviewing an application either fulfills or denies the credential.
@Tags			ApplicationAPI
@Accept			json
@Produce		json
@Param			request	body		ReviewApplicationRequest	true	"request body"
@Success		201		{object}	SubmitApplicationResponse	"Credential Response"
@Failure		400		{string}	string						"Bad request"
@Failure		500		{string}	string						"Internal server error"
@Router			/v1/manifests/applications/{id}/review [put]

func (ManifestRouter) SubmitApplication

func (mr ManifestRouter) SubmitApplication(c *gin.Context)

SubmitApplication godoc

@Summary		Submit application
@Description	Submit a credential application in response to a credential manifest. The request body is expected to

be a valid JWT signed by the applicant's DID, containing two top level properties: credential_application and vcs.

@Tags			ApplicationAPI
@Accept			json
@Produce		json
@Param			request	body		SubmitApplicationRequest	true	"request body"
@Success		201		{object}	Operation					"Operation with a SubmitApplicationResponse type in the `result.response` field."
@Failure		400		{string}	string						"Bad request"
@Failure		500		{string}	string						"Internal server error"
@Router			/v1/manifests/applications [put]

type Operation

type Operation struct {
	// The name of the resource related to this operation. E.g. "presentations/submissions/<uuid>"
	ID string `json:"id" validate:"required"`

	// Whether this operation has finished.
	Done bool `json:"done" validate:"required"`

	// Populated if Done == true.
	Result OperationResult `json:"result,omitempty"`
}

type OperationResult

type OperationResult struct {
	// Populated when there was an error with the operation.
	Error string `json:"error,omitempty"`

	// Populated iff Error == "". The type should be specified in the calling APIs documentation.
	Response any `json:"response,omitempty"`
}

type OperationRouter

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

func NewOperationRouter

func NewOperationRouter(s svcframework.Service) (*OperationRouter, error)

func (OperationRouter) CancelOperation

func (o OperationRouter) CancelOperation(c *gin.Context)

CancelOperation godoc

@Summary		Cancel an ongoing operation
@Description	Cancels an ongoing operation, if possible.
@Tags			OperationAPI
@Accept			json
@Produce		json
@Param			id	path		string		true	"ID"
@Success		200	{object}	Operation	"OK"
@Failure		400	{string}	string		"Bad request"
@Failure		500	{string}	string		"Internal server error"
@Router			/v1/operations/cancel/{id} [get]

func (OperationRouter) GetOperation

func (o OperationRouter) GetOperation(c *gin.Context)

GetOperation godoc

@Summary		Get an operation
@Description	Get operation by its ID
@Tags			OperationAPI
@Accept			json
@Produce		json
@Param			id	path		string		true	"ID"
@Success		200	{object}	Operation	"OK"
@Failure		400	{string}	string		"Bad request"
@Failure		500	{string}	string		"Internal server error"
@Router			/v1/operations/{id} [get]

func (OperationRouter) ListOperations

func (o OperationRouter) ListOperations(c *gin.Context)

ListOperations godoc

@Summary		List operations
@Description	List operations according to the request
@Tags			OperationAPI
@Accept			json
@Produce		json
@Param			parent	query		string					false	"The name of the parent's resource. For example: `?parent=/presentation/submissions`"
@Param			filter	query		string					false	"A standard filter expression conforming to https://google.aip.dev/160. For example: `?filter=done="true"`"
@Success		200		{object}	ListOperationsResponse	"OK"
@Failure		400		{string}	string					"Bad request"
@Failure		500		{string}	string					"Internal server error"
@Router			/v1/operations [get]

type PresentationRouter

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

func NewPresentationRouter

func NewPresentationRouter(s svcframework.Service) (*PresentationRouter, error)

func (PresentationRouter) CreateDefinition

func (pr PresentationRouter) CreateDefinition(c *gin.Context)

CreateDefinition godoc

@Summary		Create PresentationDefinition
@Description	Create presentation definition
@Tags			PresentationDefinitionAPI
@Accept			json
@Produce		json
@Param			request	body		CreatePresentationDefinitionRequest	true	"request body"
@Success		201		{object}	CreatePresentationDefinitionResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/presentations/definitions [put]

func (PresentationRouter) CreateRequest

func (pr PresentationRouter) CreateRequest(c *gin.Context)

CreateRequest godoc

@Summary		Create Presentation Request
@Description	Create presentation request from an existing presentation definition.
@Tags			PresentationRequestAPI
@Accept			json
@Produce		json
@Param			request	body		CreateRequestRequest	true	"request body"
@Success		201		{object}	CreateRequestResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/presentations/requests [put]

func (PresentationRouter) CreateSubmission

func (pr PresentationRouter) CreateSubmission(c *gin.Context)

CreateSubmission godoc

@Summary		Create Submission
@Description	Creates a submission in this server ready to be reviewed.
@Tags			PresentationSubmissionAPI
@Accept			json
@Produce		json
@Param			request	body		CreateSubmissionRequest	true	"request body"
@Success		201		{object}	Operation				"The type of response is Submission once the operation has finished."
@Failure		400		{string}	string					"Bad request"
@Failure		500		{string}	string					"Internal server error"
@Router			/v1/presentations/submissions [put]

func (PresentationRouter) DeleteDefinition

func (pr PresentationRouter) DeleteDefinition(c *gin.Context)

DeleteDefinition godoc

@Summary		Delete PresentationDefinition
@Description	Delete a presentation definition by its ID
@Tags			PresentationDefinitionAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/presentations/definitions/{id} [delete]

func (PresentationRouter) DeleteRequest

func (pr PresentationRouter) DeleteRequest(c *gin.Context)

DeleteRequest godoc

@Summary		Delete PresentationRequest
@Description	Delete a presentation request by its ID
@Tags			PresentationRequestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/presentations/requests/{id} [delete]

func (PresentationRouter) GetDefinition

func (pr PresentationRouter) GetDefinition(c *gin.Context)

GetDefinition godoc

@Summary		Get PresentationDefinition
@Description	Get a presentation definition by its ID
@Tags			PresentationDefinitionAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetPresentationDefinitionResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/presentations/definitions/{id} [get]

func (PresentationRouter) GetRequest

func (pr PresentationRouter) GetRequest(c *gin.Context)

GetRequest godoc

@Summary		Get Presentation Request
@Description	Get a presentation request by its ID
@Tags			PresentationRequestAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetRequestResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/presentations/requests/{id} [get]

func (PresentationRouter) GetSubmission

func (pr PresentationRouter) GetSubmission(c *gin.Context)

GetSubmission godoc

@Summary		Get Submission
@Description	Get a submission by its ID
@Tags			PresentationSubmissionAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetSubmissionResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/presentations/submissions/{id} [get]

func (PresentationRouter) ListDefinitions

func (pr PresentationRouter) ListDefinitions(c *gin.Context)

ListDefinitions godoc

@Summary		List Presentation Definitions
@Description	Lists all the existing presentation definitions
@Tags			PresentationDefinitionAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListDefinitionsResponse
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/presentations/definitions [get]

func (PresentationRouter) ListRequests

func (pr PresentationRouter) ListRequests(c *gin.Context)

ListRequests godoc

@Summary		List Presentation Requests
@Description	Lists all the existing presentation requests
@Tags			PresentationRequestAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListPresentationRequestsResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/presentations/requests [get]

func (PresentationRouter) ListSubmissions

func (pr PresentationRouter) ListSubmissions(c *gin.Context)

ListSubmissions godoc

@Summary		List Submissions
@Description	List existing submissions according to a filtering query. The `filter` field follows the syntax described in https://google.aip.dev/160.
@Tags			PresentationSubmissionAPI
@Accept			json
@Produce		json
@Param			filter	query		string	false	"A standard filter expression conforming to https://google.aip.dev/160. For example: `?filter=status="pending"`"
@Success		200		{object}	ListSubmissionResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/presentations/submissions [get]

func (PresentationRouter) ReviewSubmission

func (pr PresentationRouter) ReviewSubmission(c *gin.Context)

ReviewSubmission godoc

@Summary		Review a pending submission
@Description	Reviews a pending submission. After this method is called, the operation with `id==presentations/submissions/{submission_id}` will be updated with the result of this invocation.
@Tags			PresentationSubmissionAPI
@Accept			json
@Produce		json
@Param			request	body		ReviewSubmissionRequest	true	"request body"
@Success		200		{object}	ReviewSubmissionResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/presentations/submissions/{id}/review [put]

type ResolveDIDResponse

type ResolveDIDResponse struct {
	ResolutionMetadata  *resolution.Metadata         `json:"didResolutionMetadata,omitempty"`
	DIDDocument         *didsdk.Document             `json:"didDocument"`
	DIDDocumentMetadata *resolution.DocumentMetadata `json:"didDocumentMetadata,omitempty"`
}

type ReviewApplicationRequest

type ReviewApplicationRequest struct {
	Approved bool   `json:"approved"`
	Reason   string `json:"reason"`

	// Overrides to apply to the credentials that will be created. Keys are the ID that corresponds to an
	// OutputDescriptor.ID from the manifest.
	CredentialOverrides map[string]model.CredentialOverride `json:"credentialOverrides,omitempty"`
}

type ReviewSubmissionRequest

type ReviewSubmissionRequest struct {
	Approved bool   `json:"approved" validate:"required"`
	Reason   string `json:"reason,omitempty"`
}

type ReviewSubmissionResponse

type ReviewSubmissionResponse struct {
	*model.Submission
}

type RevokeKeyResponse

type RevokeKeyResponse struct {
	ID string `json:"id,omitempty"`
}

type SchemaRouter

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

func NewSchemaRouter

func NewSchemaRouter(s svcframework.Service) (*SchemaRouter, error)

func (SchemaRouter) CreateSchema

func (sr SchemaRouter) CreateSchema(c *gin.Context)

CreateSchema godoc

@Summary		Create Schema
@Description	Create schema
@Tags			SchemaAPI
@Accept			json
@Produce		json
@Param			request	body		CreateSchemaRequest	true	"request body"
@Success		201		{object}	CreateSchemaResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/schemas [put]

func (SchemaRouter) DeleteSchema

func (sr SchemaRouter) DeleteSchema(c *gin.Context)

DeleteSchema godoc

@Summary		Delete Schema
@Description	Delete a schema by its ID
@Tags			SchemaAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/schemas/{id} [delete]

func (SchemaRouter) GetSchema

func (sr SchemaRouter) GetSchema(c *gin.Context)

GetSchema godoc

@Summary		Get Schema
@Description	Get a schema by its ID
@Tags			SchemaAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	GetSchemaResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/schemas/{id} [get]

func (SchemaRouter) ListSchemas

func (sr SchemaRouter) ListSchemas(c *gin.Context)

ListSchemas godoc

@Summary		List Schemas
@Description	List schemas
@Tags			SchemaAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListSchemasResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/schemas [get]

type StoreKeyRequest

type StoreKeyRequest struct {
	// The `id` field is the unique identifier for this object. If set to a resolvable DID, the ssi-service will use
	// the private key encoded in the `PrivateKeyBase58` field of this object to sign objects issued or authored by this
	// DID; otherwise, it will only be used to identify this object.
	ID string `json:"id" validate:"required"`

	// Identifies the cryptographic algorithm family used with the key.
	// One of the following: "Ed25519", "X25519", "secp256k1", "P-224", "P-256", "P-384", "P-521", "RSA".
	Type crypto.KeyType `json:"type,omitempty" validate:"required"`

	// See https://www.w3.org/TR/did-core/#did-controller
	Controller string `json:"controller,omitempty" validate:"required"`

	// Base58 encoding of the bytes that result from marshalling the private key using golang's implementation.
	PrivateKeyBase58 string `json:"base58PrivateKey,omitempty" validate:"required"`
}

func (StoreKeyRequest) ToServiceRequest

func (sk StoreKeyRequest) ToServiceRequest() (*keystore.StoreKeyRequest, error)

type SubmitApplicationRequest

type SubmitApplicationRequest struct {
	// Contains the following properties:
	// Application  manifestsdk.CredentialApplication `json:"credential_application" validate:"required"`
	// Credentials  []interface{}                     `json:"vcs" validate:"required"`
	ApplicationJWT keyaccess.JWT `json:"applicationJwt" validate:"required"`
}

type SubmitApplicationResponse

type SubmitApplicationResponse struct {
	Response manifestsdk.CredentialResponse `json:"credential_response"`
	// this is an any type to union Data Integrity and JWT style VCs
	Credentials []any         `json:"verifiableCredentials,omitempty"`
	ResponseJWT keyaccess.JWT `json:"responseJwt,omitempty"`
}

type UpdateCredentialStatusRequest

type UpdateCredentialStatusRequest struct {
	// The new revoked status of this credential. The status will be saved in the encodedList of the StatusList2021
	// credential associated with this VC.
	Revoked   bool `json:"revoked,omitempty"`
	Suspended bool `json:"suspended,omitempty"`
}

type UpdateCredentialStatusResponse

type UpdateCredentialStatusResponse struct {
	// The updated status of this credential.
	Revoked   bool `json:"revoked"`
	Suspended bool `json:"suspended"`
}

type VerifyCredentialRequest

type VerifyCredentialRequest struct {
	// A credential secured via data integrity. Must have the "proof" property set.
	DataIntegrityCredential *credsdk.VerifiableCredential `json:"credential,omitempty"`

	// A JWT that encodes a credential.
	CredentialJWT *keyaccess.JWT `json:"credentialJwt,omitempty"`
}

func (VerifyCredentialRequest) IsValid

func (vcr VerifyCredentialRequest) IsValid() bool

type VerifyCredentialResponse

type VerifyCredentialResponse struct {
	// Whether the credential was verified.
	Verified bool `json:"verified"`

	// The reason why this credential couldn't be verified.
	Reason string `json:"reason,omitempty"`
}

type WebhookRouter

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

func NewWebhookRouter

func NewWebhookRouter(s svcframework.Service) (*WebhookRouter, error)

func (WebhookRouter) CreateWebhook

func (wr WebhookRouter) CreateWebhook(c *gin.Context)

CreateWebhook godoc

@Summary		Create Webhook
@Description	Create webhook
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Param			request	body		CreateWebhookRequest	true	"request body"
@Success		201		{object}	CreateWebhookResponse
@Failure		400		{string}	string	"Bad request"
@Failure		500		{string}	string	"Internal server error"
@Router			/v1/webhooks [put]

func (WebhookRouter) DeleteWebhook

func (wr WebhookRouter) DeleteWebhook(c *gin.Context)

DeleteWebhook godoc

@Summary		Delete Webhook
@Description	Delete a webhook by its ID
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		204	{string}	string	"No Content"
@Failure		400	{string}	string	"Bad request"
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/webhooks/{noun}/{verb}/{url} [delete]

func (WebhookRouter) GetSupportedNouns

func (wr WebhookRouter) GetSupportedNouns(c *gin.Context)

GetSupportedNouns godoc

@Summary		Get Supported Nouns
@Description	Get supported nouns for webhook generation
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Success		200	{object}	webhook.GetSupportedNounsResponse
@Router			/v1/webhooks/nouns [get]

func (WebhookRouter) GetSupportedVerbs

func (wr WebhookRouter) GetSupportedVerbs(c *gin.Context)

GetSupportedVerbs godoc

@Summary		Get Supported Verbs
@Description	Get supported verbs for webhook generation
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Success		200	{object}	webhook.GetSupportedVerbsResponse
@Router			/v1/webhooks/verbs [get]

func (WebhookRouter) GetWebhook

func (wr WebhookRouter) GetWebhook(c *gin.Context)

GetWebhook godoc

@Summary		Get Webhook
@Description	Get a webhook by its ID
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Param			id	path		string	true	"ID"
@Success		200	{object}	ListWebhookResponse
@Failure		400	{string}	string	"Bad request"
@Router			/v1/webhooks/{noun}/{verb} [get]

func (WebhookRouter) ListWebhooks

func (wr WebhookRouter) ListWebhooks(c *gin.Context)

ListWebhooks godoc

@Summary		List Webhooks
@Description	Lists all webhooks
@Tags			WebhookAPI
@Accept			json
@Produce		json
@Success		200	{object}	ListWebhooksResponse
@Failure		500	{string}	string	"Internal server error"
@Router			/v1/webhooks [get]

Jump to

Keyboard shortcuts

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