Skip to content

Commit

Permalink
feat(pollux): alight the OAS for schema registry (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
yshyn-iohk authored Dec 1, 2022
1 parent fc4f1ab commit 4528c57
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 226 deletions.
183 changes: 82 additions & 101 deletions prism-agent/service/api/http/pollux/schemas.yaml
Original file line number Diff line number Diff line change
@@ -1,148 +1,129 @@
components:
schemas:
W3CProof:
description: "Proof object implemented according https://w3c.github.io/vc-data-integrity/ specification"
externalDocs:
url: "https://w3c.github.io/vc-data-integrity/"
# Common
InternalServerError:
required:
["type", "created", "verificationMethod", "proofPurpose", "proofValue"]
- msg
type: object
properties:
msg:
type: string

NotFoundResponse:
required:
- msg
type: object
properties:
msg:
type: string

# Schema Registry

Proof:
required:
- type
- created
- verificationMethod
- proofPurpose
- proofValue
type: object
properties:
type:
type: string
description: "The specific proof type used. For example, an Ed25519Signature2020 type indicates that the proof includes a digital signature produced by an ed25519 cryptographic key."
example: "JcsSignature2020"
created:
type: string
description: "The string value of an [ISO8601] combined date and time string generated by the Proof Algorithm"
example: "2020-11-05T19:23:24Z"
format: date-time
verificationMethod:
type: string
description: "A set of parameters required to independently verify the proof, such as an identifier for a public/private key pair that would be used in the proof."
example: "https://di.example/issuer#z6MkjLrk3gKS2nnkeWcmcxiZPGskmesDpuwRBorgHxUXfxnG"
proofPurpose:
type: string
description: "The specific intent for the proof, the reason why an entity created it. Acts as a safeguard to prevent the proof from being misused for a purpose other than the one it was intended for. For example, a proof can be used for purposes of authentication, for asserting control of a Verifiable Credential (assertionMethod), and several others."
example: "assertionMethod"
proofValue:
type: string
description: "One of any number of valid representations of proof value generated by the Proof Algorithm."
example: "zQeVbY4oey5q2M3XKaxup3tmzN4DRFTLVqpLMweBrSxMY2xHX5XTYV8nQApmEcqaqA3Q1gVHMrXFkXJeV6doDwLWx"
domain:
type: string
description: "A string value specifying the restricted domain of the proof."

W3CSchemaInput:
description: SchemaInput object with the metadata and claims
required: ["name", "version", "claims"]
VerifiableCredentialSchema:
required:
- id
- name
- version
- author
- authored
type: object
properties:
id:
type: string
format: uuid
name:
type: string
description: Human friendly name of the schema
example: UniversityDegree
version:
type: string
description: SemVer of the schema
example: "1.0"
tags:
type: array
items:
type: string
description:
type: string
description: Schema description
attributes:
type: "array"
description: List of attributes
type: array
items:
type: "string"
example:
- first_name
- last_name
- date_of_birth
type: string
author:
type: string
authored:
type: string
format: date-time
proof:
$ref: '#/components/schemas/Proof'

W3CSchemaMeta:
description: Schema metadata
VerifiableCredentialSchemaPage:
required:
- self
- kind
- pageOf
type: object
properties:
type:
type: string #should be URI
description: The URI of the schema
example: "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json"
version:
self:
type: string
description: Semantic version of the schema
example: "1.0"
id:
kind:
type: string
description: Globally unique identifier of the schema (composed of issuer did, schema id and version)
example: "did:example:MDP8AsFhHzhwUvGNuYkX7T;id=06e126d1-fa44-4882-a243-1e326fbe21db;version=1.0"
name:
pageOf:
type: string
description: Human readable schema name
example: "UniversityDegree"
author:
next:
type: string
description: Issuer DID
example: "did:example:MDP8AsFhHzhwUvGNuYkX7T"
authored:
previous:
type: string
description: Datetime of the schema issuance in ISO format
example: "2021-01-01T00:00:00+00:00"
contents:
type: array
items:
$ref: '#/components/schemas/VerifiableCredentialSchema'

W3CSchemaClaims:
description: Verifiable Credentials Schema Claims
VerificationCredentialSchemaInput:
required:
- name
- version
type: object
properties:
$schema:
id:
type: string
description: "Schema reference that can be used for validation"
example: "https://json-schema.org/draft/2019-09/schema"
$id:
format: uuid
name:
type: string
description: UID of this Schema
example: "06e126d1-fa44-4882-a243-1e326fbe21db"
description:
version:
type: string
description: "Schema description"
type:
description:
type: string
description: "OpenAPI specification field that describes the object declaration"
example: "object"
properties:
type: object
description: "Set of clames"
additionalProperties: false
properties:
claim1:
type: string
description: "Some example claim"
required:
attributes:
type: array
items:
type: string
description: "Defines the set of required claims"
additionalProperties:
type: boolean
description: "Restrict the claims set to have additional attributes"

W3CSchema:
description: "W3C Json format of the verifiable credentials schema according to VC Data Model"
allOf:
- $ref: "#/components/schemas/W3CSchemaMeta"
- type: object
properties:
schema:
$ref: "#/components/schemas/W3CSchemaClaims"
proof:
$ref: "#/components/schemas/W3CProof"

W3CSchemaPaginated:
description: "Paginated response that contains an array of the schema objects"
properties:
data:
authored:
type: string
format: date-time
tags:
type: array
items:
$ref: "#/components/schemas/W3CSchema"
offset:
type: integer
limit:
type: integer
count:
type: integer
type: string

# Issue Credential Protocol

Expand Down
Loading

0 comments on commit 4528c57

Please sign in to comment.