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

Constant for AuthBJJ credential type added #101

Merged
merged 4 commits into from
Dec 17, 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
7 changes: 6 additions & 1 deletion verifiable/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ const (
// JSONLDSchemaW3CCredential2018 is a schema for context with VerifiableCredential type
JSONLDSchemaW3CCredential2018 = "https://www.w3.org/2018/credentials/v1"

// JSONLDSchemaW3CCredential2020 is a schema for context with Display method type
// JSONLDSchemaIden3DisplayMethod is a schema for context with Display method type
JSONLDSchemaIden3DisplayMethod = "https://schema.iden3.io/core/jsonld/displayMethod.jsonld"

// JSONLDSchemaIden3AuthBJJCredential is a schema for context with AuthBJJCredential type
JSONLDSchemaIden3AuthBJJCredential = "https://schema.iden3.io/core/jsonld/auth.jsonld"

JSONSchemaIden3AuthBJJCredential = "https://schema.iden3.io/core/json/auth.json"

// SparseMerkleTreeProof is CredentialStatusType for standard MTP result handlers
SparseMerkleTreeProof CredentialStatusType = "SparseMerkleTreeProof"

Expand Down
225 changes: 225 additions & 0 deletions verifiable/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,229 @@ const (
"id"
]
}`

// AuthBJJJsonSchema is a basic schema of auth BJJ
AuthBJJJsonSchema = `{
"$schema": "http://json-schema.org/draft-07/schema#",
"$metadata": {
"uris": {
"jsonLdContext": "https://schema.iden3.io/core/jsonld/auth.jsonld",
"jsonSchema": "https://schema.iden3.io/core/json/auth.json"
}
},
"type": "object",
"required": [
"@context",
"id",
"type",
"issuanceDate",
"credentialSubject",
"credentialSchema",
"credentialStatus",
"issuer"
],
"properties": {
"@context": {
"type": [
"string",
"array",
"object"
]
},
"id": {
"type": "string"
},
"type": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"issuer": {
"type": [
"string",
"object"
],
"format": "uri",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
}
}
},
"issuanceDate": {
"type": "string",
"format": "date-time"
},
"expirationDate": {
"type": "string",
"format": "date-time"
},
"credentialSchema": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string"
}
}
},
"credentialSubject": {
"type": "object",
"required": [
"x",
"y"
],
"properties": {
"id": {
"title": "Credential Subject ID",
"type": "string",
"format": "uri"
},
"x": {
"type": "string"
},
"y": {
"type": "string"
}
}
}
}
}`

// AuthBJJJsonLDSchema is a JSON-LD schema of auth BJJ
AuthBJJJsonLDSchema = `{
"@context": [{
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"AuthBJJCredential": {
"@id": "https://schema.iden3.io/core/jsonld/auth.jsonld#AuthBJJCredential",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"iden3_serialization": "iden3:v1:slotIndexA=x&slotIndexB=y",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"auth-vocab": "https://schema.iden3.io/core/vocab/auth.md#",
"x": {
"@id": "auth-vocab:x",
"@type": "xsd:positiveInteger"
},
"y": {
"@id": "auth-vocab:y",
"@type": "xsd:positiveInteger"
}
}
},
"Iden3StateInfo2023": {
"@id": "https://schema.iden3.io/core/jsonld/auth.jsonld#Iden3StateInfo2023",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@vocab": "https://schema.iden3.io/core/vocab/state-info.md#",
"@propagate": true,
"stateContractAddress": {
"@id": "stateContractAddress",
"@type": "xsd:string"
},
"published": {
"@id": "published",
"@type": "xsd:boolean"
},
"info": {
"@id": "info",
"@type": "@id",
"@context": {
"@protected": true,
"id": {
"@id": "id",
"@type": "xsd:string"
},
"state": {
"@id": "state",
"@type": "xsd:string"
},
"replacedByState": {
"@id": "replacedByState",
"@type": "xsd:string"
},
"createdAtTimestamp": {
"@id": "createdAtTimestamp",
"@type": "xsd:string"
},
"replacedAtTimestamp": {
"@id": "replacedAtTimestamp",
"@type": "xsd:string"
},
"createdAtBlock": {
"@id": "createdAtBlock",
"@type": "xsd:string"
},
"replacedAtBlock": {
"@id": "replacedAtBlock",
"@type": "xsd:string"
}
}
},
"global": {
"@id": "global",
"@type": "@id",
"@context": {
"@protected": true,
"sec": "https://w3id.org/security#",
"root": {
"@id": "root",
"@type": "xsd:string"
},
"replacedByRoot": {
"@id": "replacedByRoot",
"@type": "xsd:string"
},
"createdAtTimestamp": {
"@id": "createdAtTimestamp",
"@type": "xsd:string"
},
"replacedAtTimestamp": {
"@id": "replacedAtTimestamp",
"@type": "xsd:string"
},
"createdAtBlock": {
"@id": "createdAtBlock",
"@type": "xsd:string"
},
"replacedAtBlock": {
"@id": "replacedAtBlock",
"@type": "xsd:string"
},
"proof": {
"@id": "sec:proof",
"@type": "@id",
"@container": "@graph"
}
}
}
}
}
}]
}`
)
Loading