diff --git a/context/ereuse-issuer.jsonld b/context/ereuse-issuer.jsonld new file mode 100644 index 0000000..a0b0dad --- /dev/null +++ b/context/ereuse-issuer.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "legalName": "https://idhub.pangea.org/context/#legalName", + "allowedSchemas": "https://idhub.pangea.org/context/#allowedSchemas", + "email": "https://idhub.pangea.org/context/#email" + } +} diff --git a/idhub/templates/credentials/ereuse-issuer.json b/idhub/templates/credentials/ereuse-issuer.json new file mode 100644 index 0000000..c0665bc --- /dev/null +++ b/idhub/templates/credentials/ereuse-issuer.json @@ -0,0 +1,63 @@ +{ + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://idhub.pangea.org/context/base.jsonld", + "https://idhub.pangea.org/context/ereuse-issuer.jsonld" + ], + "id": "{{ vc_id }}", + "type": [ + "VerifiableCredential", + "VerifiableAttestation", + "EreuseIssuer" + ], + "issuer": { + "id": "{{ issuer_did }}", + "name": "{{ organisation }}" + }, + "issuanceDate": "{{ issuance_date }}", + "validFrom": "{{ issuance_date }}", + "validUntil": "{{ validUntil }}", + "name": [ + { + "value": "Product and waste electronics operator claim", + "lang": "en" + }, + { + "value": "Declaració d'operador de productes i residus electrònics", + "lang": "ca_ES" + }, + { + "value": "Declaración de operador de productos y residuos electrónicos", + "lang": "es" + } + ], + "description": [ + { + "value": "Credential for e-product and e-waste operator claim", + "lang": "en" + }, + { + "value": "Credencial per operador de productes i residus electrònics", + "lang": "ca_ES" + }, + { + "value": "Credencial para operador de productos y residuos electrónicos", + "lang": "es" + } + ], + "credentialSubject": { + "id": "{{ subject_did }}", + "legalName": "{{ legalName }}", + "allowedSchemas": "{{ allowedSchemas }}", + "email": "{{ email }}" + }, + "credentialStatus": { + "id": "{{ credential_status_id}}", + "type": "RevocationBitmap2022", + "revocationBitmapIndex": "{{ id_credential }}" + }, + "credentialSchema": { + "id": "https://idhub.pangea.org/vc_schemas/ereuse-issuer.json", + "type": "FullJsonSchemaValidator2021" + } +} diff --git a/schemas/ereuse-issuer.json b/schemas/ereuse-issuer.json new file mode 100644 index 0000000..f45b02c --- /dev/null +++ b/schemas/ereuse-issuer.json @@ -0,0 +1,53 @@ +{ + "$id": "https://idhub.pangea.org/vc_schemas/issuer.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "EreuseIssuer", + "description": "This credential allow to holder to be issuer for a list of schemas", + "name": [ + { + "value": "Allow to be issuer", + "lang": "en" + }, + ], + "type": "object", + "allOf": [ + { + "$ref": "https://idhub.pangea.org/vc_schemas/ebsi/attestation.json" + }, + { + "properties": { + "credentialSubject": { + "description": "Defines properties on credentialSubject", + "type": "object", + "properties": { + "id": { + "description": "Defines a unique identifier of the credential subject", + "type": "string", + "minLength": 1 + }, + "legalName": { + "description": "Legal name of the issuer", + "type": "string", + "minLength": 1 + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^\\S+@\\S+\\.\\S+$" + }, + "allowedSchemas": { + "description": "List of schemas", + "type": "@list" + } + }, + "required": [ + "id", + "legalName", + "allowedSchemas", + "email" + ] + } + } + } + ] +}