Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/difrex/pmd

Simple secure storage
https://github.com/difrex/pmd

api gnupg golang storage

Last synced: 1 day ago
JSON representation

Simple secure storage

Awesome Lists containing this project

README

        

# PMd

Simple secure storage.

Public server available at https://pm.lessmore.pw

**Table of Contents**

- [PMd](#pmd)
- [API](#api)
- [User registartion](#user-registartion)
- [Push data](#push-data)
- [Get data](#get-data)
- [List data versions](#list-data-versions)
- [Delete data version](#delete-data-version)
- [Selfdelete](#selfdelete)

# API

## User registartion

Send post request with you PGP public key.
```
PUBKEY=`gpg --export -a `
cat > reg.json < data.json < signed

curl -XPOST -d "`cat signed`" https://pm.lessmore.pw/push
```

Return JSON with data version, time, and state
```
{"version":"CyVYq3do1DM1mMf96ziAGfZB3s856zH6eWQVoQsMzgQ=","time":"2017-09-13T16:51:53.025960496+03:00","state":"OK","error":""}
```

## Get data

Sign JSON request
```
echo '{"version": "CyVYq3do1DM1mMf96ziAGfZB3s856zH6eWQVoQsMzgQ="}' | gpg --clearsign --sign-with > signed.json
curl -XPOST -d @signed.json https://pm.lessmore.pw/pull
```

Return armored encrypted data
```
-----BEGIN PGP MESSAGE-----

hQEMA/jh+hN2m5ysAQf/X4eTuoIZyIghBWBMsfr72RgIcquv5uE6QnybfZH2Aq8A
f1rzhbBfbVlMgLwvKY/I7C9G5ZGCQQViyC7VaWxqvI8V3sOe8IEDyi1DqEzuxZA+
FQgIEFJpbWRo0Fu4/tQmUuDYiVIFHC2h2/jc8+Kj8KR12hWnvL5mjKogqsTSpOtk
OMCzcZs/1p298TlLx/RZoY+Ktn6IvRtE2PdEw0Kw7F4g9Jad3wyGykdH81rPETTt
GPtV7CmaIVE4sSdWgDA/fkR8Gin0cKXVxC+c54wXs+iRpgX/nE1ZFGaPNG5MG117
u/5S7mDg3S6Znaym38Mqu1oav7ImmsfvPNV8Q1LT+tJJAVqzJhDJY83XCTIDQict
5xw0c6PnfRPUffvmdzrstSU35LV+tMz9kDGqjW1Ss40VC3PKixg0yk6Jz5SamLBS
4sKoE8PDmL+qCw==
=2qKU
-----END PGP MESSAGE-----
```

## List data versions

Make POST request with some signed message
```
curl -XPOST -d @signed https://pm.lessmore.pw/list
```

Return armored encrypted data with JSON structure:
```
{
"state": "ok",
"versions": [
{
"time": "2017-09-13T13:40:58Z",
"version": "mCcTx-k"
},
{
"time": "2017-09-13T13:41:10Z",
"version": "-WvhMo"
}
]
}
```

## Delete data

Delete data

Sign JSON and send it
```
{
"version": "-WvhMo"
}
curl -XPOST -d @signed https://pm.lessmore.pw/delete
```

Return JSON
```
{
"state": "ok",
"version": "-WvhMo"
}
```

## Selfdelete

Remove **all** user data and delete user.

Send signed message
```
curl -XPOST -d @signed https://pm.lessmore.pw/purge
```

Return JSON:
```
{
"state":"ok",
"gpgid":"5083F08AACD7CDBC"
}
```