PKID is a public Key Indexed Datastore. You can save plain or encrypted data in a public key index; as long as you are the owner of the secret corresponding to that public key.
PUT /v1/documents/{pk}/{key}
Set the value of a document corresponding to {key} indexed by the public key {pk}. This is only possible when sending following header; signed by the secret key corresponding to {pk}.
pk is hex encoded; request data is a base64 encoded and signed; header is base64 encoded and signed;
{ 'intent' : 'pkid.store', timestamp: 'epochtime'}
GET /v1/documents/{pk}/{key}
pk is hex encoded; response data is base64 encoded;
Get the value of a document corresponding to {key} indexed by the public key {pk}. There is no requirement for a security header
To run the backend in devmode simply execute following command
bin/dev.sh
or
docker-compose build
docker-compose up
You can let the user login using TF-Connect on your own 3rd party app, get a unique key (unique for the user and your application) and use that to write data to PKID.
Flow:
Use the example to find out how to make the user log in and get a derived seed. URL for staging: https://example.staging.jimber.org/ (use 'Authenticate & get emailaddress and derived seed.' button) URL of example code repository: https://github.com/threefoldtech/threefold_connect/tree/master/example
See callback.js @ https://github.com/threefoldtech/threefold_connect/blob/master/example/src/views/callback/callback.js
Get the derived seed from the decrypted data in step 2, use the "Set document" section to write to PKID.