Do we have multitanency feature in Walt id ssi kits like we have in aca-py agent. ? #10
Answered
by
waltkb
SethiShivam
asked this question in
Help
-
I am working on a use-case where I need this feature of Multi-tenancy wallets. https://github.com/hyperledger/aries-cloudagent-python/blob/main/Multitenancy.md |
Beta Was this translation helpful? Give feedback.
Answered by
waltkb
Oct 3, 2022
Replies: 2 comments
-
Yes, we call it "Context" and use the "ContextManager" to specify which context to use. Please see the example below: val userAContext = TestContext("userA")
val userBContext = TestContext("userB")
@Test
fun testContext() {
var did1: String? = null
ContextManager.runWith(userAContext) {
did1 = DidService.create(DidMethod.key)
}
ContextManager.runWith(userBContext) {
val did2 = DidService.create(DidMethod.key)
val didList2 = DidService.listDids()
didList2 shouldHaveSize 1
didList2.first() shouldBe did2
}
ContextManager.runWith(userAContext) {
val didList1 = DidService.listDids()
didList1 shouldHaveSize 1
did1 shouldNotBe null
didList1.first() shouldBe did1
}
}
@Test
fun testDidKeyImport() {
var cred: String = ""
ContextManager.runWith(userAContext) {
// create did:key with new key in user A context
val did = DidService.create(DidMethod.key)
// issue credential using created did
cred = Signatory.getService().issue("VerifiableId", ProofConfig(did, did))
}
ContextManager.runWith(userBContext) {
// verify credential in user B context, importing key from did on the fly
val result = Auditor.getService().verify(cred, listOf(SignaturePolicy()))
result.valid shouldBe true
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
waltkb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, we call it "Context" and use the "ContextManager" to specify which context to use. Please see the example below: