Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new platform user support: DarenMarket #42

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions dist/schemas/24-platform-user/1-1-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/24-platform-user/1-1-2.json",
"title": "Platform user",
"description": "You are a user of a certain platform",
"type": "object",
"required": [
"@context",
"issuer",
"issuanceDate",
"credentialSubject",
"proof"
],
"properties": {
"@context": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
}
},
"id": {
"type": "string"
},
"type": {
"type": "array",
"items": {
"type": "string"
}
},
"issuer": {
"type": "object",
"required": [
"id",
"name",
"mrenclave"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"mrenclave": {
"type": "string"
},
"runtimeVersion": {
"type": "object",
"required": [
"parachain",
"sidechain"
],
"properties": {
"sidechain": {
"type": "number"
},
"parachain": {
"type": "number"
}
}
}
}
},
"issuanceDate": {
"type": "string",
"format": "date-time"
},
"proof": {
"type": "object",
"required": [
"created",
"type",
"proofPurpose",
"proofValue",
"verificationMethod"
],
"properties": {
"created": {
"type": "string",
"format": "date-time"
},
"type": {
"type": "string"
},
"proofPurpose": {
"type": "string"
},
"proofValue": {
"type": "string"
},
"verificationMethod": {
"type": "string"
}
}
},
"credentialSubject": {
"title": "Credential Subject of Platform user",
"type": "object",
"required": [
"id",
"type",
"values",
"endpoint",
"assertions"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"description": {
"type": "string"
},
"values": {
"type": "array",
"minItems": 1,
"items": {
"type": "boolean"
}
},
"endpoint": {
"type": "string",
"format": "uri"
},
"assertions": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"and"
],
"properties": {
"and": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"additionalItems": false,
"items": [
{
"type": "object",
"required": [
"src",
"op",
"dst"
],
"properties": {
"src": {
"type": "string",
"enum": [
"$platform"
]
},
"op": {
"type": "string",
"enum": [
"=="
]
},
"dst": {
"type": "string",
"enum": [
"KaratDao",
"MagicCraft",
"DarenMarket"
]
}
}
}
]
}
}
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions packages/schemas/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project follows [Schema Versioning](https://docs.snowplow.io/docs/pipel

-

## 2024-07-15

(ADDITION) [`24-platform-user`](./src/lib/24-platform-user/) bumped to 1-1-2

- Support `DarenMarket` platform.

## 2024-07-10

(ADDITION) [`26-nft-holder`](./src/lib/26-nft-holder/) bumped to 1-1-2
Expand Down
42 changes: 42 additions & 0 deletions packages/schemas/src/lib/24-platform-user/1-1-2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Adds `DarenMarket` platform.
*/

import { JSONSchema7 } from 'json-schema';

import { schema as base } from '../0-base/1-1-0';
import { resolveGitHubPath } from '../helpers';
import { credentialSubject, assertion } from '../schema-helpers';

const supportedPlatforms = [
// https://github.com/litentry/litentry-parachain/blob/dev/tee-worker/litentry/core/credentials-v2/src/platform_user/mod.rs
'KaratDao',
'MagicCraft',
'DarenMarket',
];

export const schema: JSONSchema7 = {
...base,

$id: resolveGitHubPath('24-platform-user/1-1-2.json'),

title: 'Platform user',
description: 'You are a user of a certain platform',

properties: {
...base.properties,

credentialSubject: credentialSubject({
title: 'Credential Subject of Platform user',
assertions: assertion.and({
items: [
assertion.clause({
src: ['$platform'],
op: ['=='],
dst: supportedPlatforms,
}),
],
}),
}),
},
};
Loading