Giter Club home page Giter Club logo

waltid-storage-kit's Introduction

Storage Kit

by walt.id

Enhance your app with zero trust storage and privacy-preserving data sharing

Join community! Follow @walt_id

Getting Started

Checkout the Official Documentation, to dive deeper into the architecture and configuration options available.

What is the Storage Kit?

Written in Kotlin and based on the DIF specification the Storage Kit is a secure data confidential storage solution, allowing you to interface with Encrypted Data Vaults easily.

The system is scoped into:

  • Storage Kit Server (Provider): Hosting EDVs
  • Storage Kit Client (Client): Interfacing with remote EDVs
  • Service wrapper (Service): Easily access data of your clients directly in their EDVs

soon: Alternatively the library or the additional Docker container can be run as RESTful webservice.

Functionality

The Confidential Storage functions are in the scope of:

(special features are highlighted)

Layer 1

  • 1.1 Server request validation
  • 1.2 Encrypted data persistence
  • 1.3 Global configuration (capability discovery)
  • 1.4 Enforcement of authorization policies with ZCap-LD
  • 1.5 Encrypted data chunking
  • 1.5 Resource structures
  • 1.6 Encrypted Resource structures

Layer 2:

  • Encrypted search
  • Versioning and replication
  • sharing with other entities

Layer 3:

  • Notifications
  • Vault-wide integrity protection

(cmp. Confidential Storage specifications from the Identity Foundation)

Examples

General examples

val clientService = ClientService().run {
    // Setup client
    createMasterKey(tmasterkey)
    unlockWithMasterKey(tmasterkey)
    setupSessionService()

    // Create session
    val newSess = sessionService.createSession("sess01")
    sessionService.selectSession(newSess.sessionId)

    // Setup
    setup()

    // Create EDV
    edvService.createEdv("http://localhost:7000")

    // Create document
    documentService.create("doc1", "this is a document".toByteArray())

    // Load document
    val loadedDocument = documentService.load("doc1").toString()
    println(loadedDocument)

    // Enable notification handler
    edvService.notificationsConnect(edvId) { event ->
        println("Received notification from EDV $edvId: Document ${event.documentId} was ${event.operation.name} by ${event.invoker}.")
    }

    // Update document
    documentService.update("doc1", "new content".toByteArray())

    // Encrypted search
    val results = documentService.search("content")
    results.forEach { println(it) }

    // Delete document
    documentService.delete("doc1")

    // Export session
    val exportJWE = sessionService.export(sessionService.sessionId)
}

Handle DataRequests

val req = reader.readLine("Enter data request: ")

// Verify request
println("Verifying request...")
val verified = clientService.dataRequestService.verifyDataRequest(req)

if (!verified) {
    out("SIGNATURE VERIFICATION FAILED!")
    return
}
out("Signature successfully verified.")

// Decode request
val dataRequest = clientService.dataRequestService.decodeDataRequest(req)

out("[${dataRequest.context}]:")
out("DID ${dataRequest.did} requests a ${dataRequest.preferredDataType}.")
out()
out("Do you want to accept at ${dataRequest.responseUrl}?")
val input = reader.readLine("Accept request (y/n)$boldColon ")

if (input != "y") {
    out("Data request disposed.")
    return
}

// Accept request
val docId = dataRequest.preferredDataType
val childDid = dataRequest.did

val caveats = listOf(ValidOperationsCaveat(listOf("RetrieveDocument")), ValidOperationTargetsCaveat(listOf(docId)))

val delegation = clientService.dataRequestService.createDataDelegation(edvId, childDid, caveats)

out("Delegated permissions for EDV $edvId from owner ${getSession().did} to child $childDid!")

clientService.dataRequestService.acceptDataRequest(dataRequest, edvId, delegation)

out("Data request accepted!")

Join the community

License

Licensed under the Apache License, Version 2.0

waltid-storage-kit's People

Contributors

taminobaumann avatar kburgmann avatar waltkb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.