-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge develop and fix conflicts
Signed-off-by: Urban Vidovič <urbanfoundit@gmail.com>
- Loading branch information
Showing
58 changed files
with
4,726 additions
and
4,112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { MinimalImportableKey } from '@veramo/core'; | ||
|
||
export const mnemonic = | ||
'prosper pair similar canoe work humble loud wild aunt reunion olive obscure'; | ||
export const account = '0xb6665128eE91D84590f70c3268765384A9CAfBCd'; | ||
export const account2 = '0x461e557A07AC110BC947F18b3828e26f013dac39'; | ||
export const privateKey = | ||
'0x63ce0077f0d617dbf54d5f335de2983313c6356f25b45e0f68f85bee1490a6ae'; | ||
export const privateKey2 = | ||
'0xb29764680b2a07fa4a762d255e3f689fb5c05cc885e6dfd3de5d5948b5a6b47f'; | ||
|
||
export const importablePrivateKey: MinimalImportableKey = { | ||
kid: 'importedTestKey', | ||
kms: 'snap', | ||
type: 'Secp256k1', | ||
privateKeyHex: privateKey.substring(2), | ||
} as const; | ||
|
||
// Query params | ||
|
||
// For exampleJWT.json | ||
export const jsonPath = | ||
'$[?(@.data.credentialSubject.placeOfBirth == "Asgard")]'; | ||
|
||
// For exampleJWT_2.json & VCs returned by createTestVCs() | ||
export const jsonPath2 = | ||
'$[?(@.data.credentialSubject.accomplishmentType == "Developer Certificate")]'; | ||
|
||
// Errors | ||
|
||
export const resolutionNotFound = { | ||
didDocument: null, | ||
didResolutionMetadata: { | ||
error: 'invalidDid', | ||
message: 'Error: invalidDid: invalid key type', | ||
}, | ||
didDocumentMetadata: {}, | ||
}; | ||
|
||
export const resolutionMethodNotSupported = { | ||
didDocument: null, | ||
didResolutionMetadata: { | ||
error: 'unsupportedDidMethod', | ||
}, | ||
didDocumentMetadata: {}, | ||
}; | ||
|
||
export const resolutionInvalidDID = { | ||
didDocument: null, | ||
didResolutionMetadata: { | ||
error: 'invalidDid', | ||
message: 'Not a valid did:ethr: 0x5:0x123', | ||
}, | ||
didDocumentMetadata: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"type": ["VerifiableCredential", "ProgramCompletionCertificate"], | ||
"credentialSubject": { | ||
"accomplishmentType": "Developer Certificate", | ||
"learnerName": "John Doe", | ||
"achievement": "Certified Solidity Developer 2", | ||
"courseProvider": "https://blockchain-lab.um.si/", | ||
"id": "did:web:example.johndoe.com" | ||
}, | ||
"credentialSchema": { | ||
"id": "https://beta.api.schemas.serto.id/v1/public/program-completion-certificate/1.0/json-schema.json", | ||
"type": "JsonSchemaValidator2018" | ||
}, | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://beta.api.schemas.serto.id/v1/public/program-completion-certificate/1.0/ld-context.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { MascaAccountState, MascaState } from '@blockchain-lab-um/masca-types'; | ||
|
||
import { getEmptyAccountState } from '../../src/utils/config'; | ||
|
||
const defaultSnapState = (address: string): MascaState => { | ||
const accountState: Record<string, MascaAccountState> = {}; | ||
accountState[address] = getEmptyAccountState(); | ||
|
||
return { | ||
accountState, | ||
currentAccount: address, | ||
snapConfig: { | ||
dApp: { | ||
disablePopups: false, | ||
friendlyDapps: [], | ||
}, | ||
snap: { | ||
acceptedTerms: true, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
export const getDefaultSnapState = (address: string): MascaState => { | ||
const state = structuredClone(defaultSnapState(address)); | ||
// Session is valid for two years from 15/06/2023 for address 1 only | ||
state.accountState[address].ceramicSession = | ||
'eyJzZXNzaW9uS2V5U2VlZCI6IlJCcGVUK3poMmFpQ2xOTVBZYXllYUFSSVBhVkZUZ1pZVHU4M3I0dHBpR1U9IiwiY2FjYW8iOnsiaCI6eyJ0IjoiZWlwNDM2MSJ9LCJwIjp7ImRvbWFpbiI6Ik15Tm9kZUFwcCIsImlhdCI6IjIwMjMtMDYtMTVUMTI6Mjc6NTguNzgyWiIsImlzcyI6ImRpZDpwa2g6ZWlwMTU1OjE6MHhiNjY2NTEyOGVlOTFkODQ1OTBmNzBjMzI2ODc2NTM4NGE5Y2FmYmNkIiwiYXVkIjoiZGlkOmtleTp6Nk1rd1V6aW5FU2lGdWo2dlR1bk1kbVYyTWtvbm1ud3lkdlE4Rjlwc0xzQ0xyUW8iLCJ2ZXJzaW9uIjoiMSIsIm5vbmNlIjoiSnFKTTNZcFc5ayIsImV4cCI6IjIwMjUtMDYtMTRUMTI6Mjc6NTguNzgyWiIsInN0YXRlbWVudCI6IkdpdmUgdGhpcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc29tZSBvZiB5b3VyIGRhdGEgb24gQ2VyYW1pYyIsInJlc291cmNlcyI6WyJjZXJhbWljOi8vKj9tb2RlbD1ranpsNmh2ZnJidzZjNmlkYWFjdzVkNGdjNDgxZW5wYmV1djRmYXQ2NmdqcTFrazlpdnRhbmFkc2UwNzQ2ZGwiXX0sInMiOnsidCI6ImVpcDE5MSIsInMiOiIweGNmZjk0YjgyZmVlODZmZmM0Zjg0ZjYxODFmMDRkNGY2NGY5ZmVmZTAyODgyNzg4Mzc1M2ZhNWFiYThiM2VkYWQ3NzdhZThjMGY3ZTQ0MTIzMzM2ZmQzNjIwNjA5MWE0NmM0MDYxZTQzZGY4OGVhYzdmZWI2ZTE2M2Y5Yzc2OWI3MWMifX19'; | ||
return structuredClone(state); | ||
}; |
60 changes: 60 additions & 0 deletions
60
packages/snap/tests/data/documentResolution/cheqdResolution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"did": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN", | ||
"didDocumentMetadata": { | ||
"created": "2022-04-05T11:49:19Z", | ||
"versionId": "4fa8e367-c70e-533e-babf-3732d9761061" | ||
}, | ||
"didResolutionMetadata": { | ||
"contentType": "application/did+ld+json", | ||
"retrieved": "2023-06-01T09:34:29Z", | ||
"did": { | ||
"didString": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN", | ||
"methodSpecificId": "mainnet:Ps1ysXP2Ae6GBfxNhNQNKN", | ||
"method": "cheqd" | ||
}, | ||
"pattern": "^(did:cheqd:.+)$", | ||
"driverUrl": "http://cheqd-did-driver:8080/1.0/identifiers/$1", | ||
"duration": 1034 | ||
}, | ||
"didDocument": { | ||
"@context": [ | ||
"https://www.w3.org/ns/did/v1", | ||
"https://w3id.org/security/suites/ed25519-2020/v1" | ||
], | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN", | ||
"verificationMethod": [ | ||
{ | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#key1", | ||
"type": "Ed25519VerificationKey2020", | ||
"controller": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN", | ||
"publicKeyMultibase": "z6Mkta7joRuvDh7UnoESdgpr9dDUMh5LvdoECDi3WGrJoscA" | ||
} | ||
], | ||
"authentication": ["did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#key1"], | ||
"service": [ | ||
{ | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#website", | ||
"type": "LinkedDomains", | ||
"serviceEndpoint": ["https://www.cheqd.io"] | ||
}, | ||
{ | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#non-fungible-image", | ||
"type": "LinkedDomains", | ||
"serviceEndpoint": [ | ||
"https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe" | ||
] | ||
}, | ||
{ | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#twitter", | ||
"type": "LinkedDomains", | ||
"serviceEndpoint": ["https://twitter.com/cheqd_io"] | ||
}, | ||
{ | ||
"id": "did:cheqd:mainnet:Ps1ysXP2Ae6GBfxNhNQNKN#linkedin", | ||
"type": "LinkedDomains", | ||
"serviceEndpoint": ["https://www.linkedin.com/company/cheqd-identity/"] | ||
} | ||
] | ||
}, | ||
"@context": "https://w3id.org/did-resolution/v1" | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/snap/tests/data/documentResolution/ebsiResolution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"did": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd", | ||
"didDocumentMetadata": {}, | ||
"didResolutionMetadata": { | ||
"contentType": "application/did+ld+json", | ||
"pattern": "^(did:ebsi:.+)$", | ||
"driverUrl": "https://api-pilot.ebsi.eu/did-registry/v3/identifiers/$1", | ||
"duration": 953, | ||
"did": { | ||
"didString": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd", | ||
"methodSpecificId": "ziE2n8Ckhi6ut5Z8Cexrihd", | ||
"method": "ebsi" | ||
} | ||
}, | ||
"didDocument": { | ||
"@context": [ | ||
"https://www.w3.org/ns/did/v1", | ||
"https://w3id.org/security/suites/jws-2020/v1" | ||
], | ||
"authentication": ["did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd#key-1"], | ||
"service": [], | ||
"id": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd", | ||
"assertionMethod": ["did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd#key-1"], | ||
"verificationMethod": [ | ||
{ | ||
"id": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd#key-1", | ||
"controller": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd", | ||
"type": "JsonWebKey2020", | ||
"publicKeyJwk": { | ||
"kty": "EC", | ||
"crv": "secp256k1", | ||
"x": "masUHNuJ0oH0C_e5rLUu5VKwmU2l-a7rrNTqA__afN8", | ||
"y": "UmGGX_WgRFXbw6qTli9xcQ0owtkZVuUGVyM23e8rZe8", | ||
"kid": "did:ebsi:ziE2n8Ckhi6ut5Z8Cexrihd#keys-1" | ||
} | ||
} | ||
] | ||
}, | ||
"@context": "https://w3id.org/did-resolution/v1" | ||
} |
48 changes: 48 additions & 0 deletions
48
packages/snap/tests/data/documentResolution/ensResolution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"did": "did:ens:vitalik.eth", | ||
"didDocumentMetadata": {}, | ||
"didResolutionMetadata": { | ||
"pattern": "^(did:ens:.+)$", | ||
"driverUrl": "http://uni-resolver-driver-did-uport:8081/1.0/identifiers/", | ||
"duration": 461, | ||
"did": { | ||
"didString": "did:ens:vitalik.eth", | ||
"methodSpecificId": "vitalik.eth", | ||
"method": "ens" | ||
}, | ||
"contentType": "application/did+ld+json", | ||
"convertedFrom": "application/did+json", | ||
"convertedTo": "application/did+ld+json" | ||
}, | ||
"didDocument": { | ||
"assertionMethod": [ | ||
"did:ens:vitalik.eth#0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" | ||
], | ||
"service": [ | ||
{ | ||
"id": "did:ens:vitalik.eth#Web3PublicProfile-0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", | ||
"type": "Web3PublicProfile", | ||
"serviceEndpoint": "vitalik.eth" | ||
} | ||
], | ||
"capabilityDelegation": [ | ||
"did:ens:vitalik.eth#0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" | ||
], | ||
"id": "did:ens:vitalik.eth", | ||
"verificationMethod": [ | ||
{ | ||
"id": "did:ens:vitalik.eth#0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", | ||
"type": "EcdsaSecp256k1RecoveryMethod2020", | ||
"controller": "did:ens:vitalik.eth", | ||
"blockchainAccountId": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045@eip155:1" | ||
} | ||
], | ||
"capabilityInvocation": [ | ||
"did:ens:vitalik.eth#0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" | ||
], | ||
"authentication": [ | ||
"did:ens:vitalik.eth#0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" | ||
] | ||
}, | ||
"@context": "https://w3id.org/did-resolution/v1" | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/snap/tests/data/documentResolution/ethrResolution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"didDocumentMetadata": {}, | ||
"didResolutionMetadata": { "contentType": "application/did+ld+json" }, | ||
"didDocument": { | ||
"@context": [ | ||
"https://www.w3.org/ns/did/v1", | ||
"https://w3id.org/security/suites/secp256k1recovery-2020/v2" | ||
], | ||
"id": "did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd", | ||
"verificationMethod": [ | ||
{ | ||
"id": "did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd#controller", | ||
"type": "EcdsaSecp256k1RecoveryMethod2020", | ||
"controller": "did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd", | ||
"blockchainAccountId": "eip155:1:0xb6665128eE91D84590f70c3268765384A9CAfBCd" | ||
} | ||
], | ||
"authentication": [ | ||
"did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd#controller" | ||
], | ||
"assertionMethod": [ | ||
"did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd#controller" | ||
] | ||
}, | ||
"did": "did:ethr:0x1:0xb6665128eE91D84590f70c3268765384A9CAfBCd#controller" | ||
} |
Oops, something went wrong.