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

feat(24-platform-user): add MagicCraft #35

Merged
merged 4 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ It contains:
- `example` directory: exemplary VC for each assertion type
- `packages/schema` directory: JSONSchema for each assertion type
- `packages/validator` directory: Utility to validate schemas from a VC string.

## Contributing

1. Locate the schema you want to update on `packages/schema`. You can tell it from the VC's `credentialSchema.id` value.
1. Follow the versioning described in `packages/schema`'s README to name the new version.
1. The README describes how to generate the schemas from its model too.
1. Update the CHANGELOG.
1. Publish the pull request.
2 changes: 1 addition & 1 deletion dist/schemas/24-platform-user/1-1-1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/24-platform-user/1-1-0.json",
"$id": "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/24-platform-user/1-1-1.json",
"title": "Platform user",
"description": "You are a user of a certain platform",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion dist/schemas/24-platform-user/latest.json
12 changes: 12 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-05-10

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

- Support `MagicCraft` platform.

## 2024-04-30

(REVISION) [`25-token-holding-amount`](./src/lib/25-token-holding-amount/) bumped to 1-1-0
Expand All @@ -23,6 +29,12 @@ and this project follows [Schema Versioning](https://docs.snowplow.io/docs/pipel

(MODEL) [`25-token-holding-amount`](./src/lib/25-token-holding-amount/) initial to 1-0-0

## 2024-04-25

(ADDITION) [`21-evm-holding-amount`](./src/lib/21-evm-holding-amount/) bumped to 1-1-1

- Support `MCRT` token.

## 2024-04-02

(ADDITION) Schema [`21-evm-holding-amount`](./src//lib/21-evm-holding-amount/) bumped to 1-1-1
Expand Down
37 changes: 37 additions & 0 deletions packages/schemas/src/lib/24-platform-user/1-1-1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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',
];

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

$id: resolveGitHubPath('24-platform-user/1-1-1.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