This module is simple REST API application, that is used by Raspberry Wallet as Module, which is trusted third party side.
- Maven 3+
- Java 8
# get repo
git clone https://github.com/RaspberryWallet/Backend.git
cd Backend
# build and install jars, then build docker image with Fabric8 plugin
mvn clean install docker:build
# after we made docker images, we can just turn on the system
docker-compose up -d
- Requirements
- Installation
- Table of contents
- Details
- Endpoints
- Old sequence diagrams
- Authors
- Changelog
This module uses Redis as data storage and Jedis library for connection. REST endpoints are provided by Spring Boot.
After a new version release, you have to change jar file name manually, since it's hardcoded into Dockerfile and there is no Dockerfile generator.
Endpoints documentation is not actual and will be not updated, since the goal is to introduce Spring REST Docs.
Login is done by custom token system implementation.
POST /authorization/register
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"password":"1234"
}
POST /authorization/login
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"password":"1234"
}
# returns token which is UUID converted to String
POST /authorization/logout
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"password":"1234"
}
POST /authorization/secret/set
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"token":"01badf5d-fb41-4d2a-a029-0bce54bea501",
"secret":"data"
}
POST /authorization/secret/get
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"token":"01badf5d-fb41-4d2a-a029-0bce54bea501"
}
# returns secret as String
POST /authorization/secret/overwrite
Content-Type: application/json; charset=UTF-8
{
"walletUUID":"abcd",
"token":"01badf5d-fb41-4d2a-a029-0bce54bea501",
"secret":"duplicate"
}
They are not actual and we left them here, because they will be refreshed soon.
Sequence diagram code
title Authorization Server Module: initialization
Manager->RPIServerModule: Send single part of a wallet secret key
RPIServerModule->RPIServerModule: Encrypt secret key with random password
RPIServerModule->AuthorizationServer: Register a new wallet
RPIServerModule->AuthorizationServer: Authenticate on server and send encrypted secret key
AuthorizationServer->Redis: Store wallet's encrypted secret key part
Sequence diagram code
title Authorization Server Module: unlocking module
Manager->RPIServerModule: Unlock module
RPIServerModule->AuthorizationServer: Login with secret password
AuthorizationServer->RPIServerModule: Validate password and return session token
RPIServerModule->AuthorizationServer: Get encrypted secret key
AuthorizationServer->Redis: Get wallet's encrypted secret key
AuthorizationServer->RPIServerModule: Return wallet's encrypted secret key
RPIServerModule->RPIServerModule: Decrypt secret key with random password
RPIServerModule->Manager: Return decrypted part of secret key
Name | |
---|---|
Patryk Milewski | patryk.milewski@gmail.com |
Version | Is backward-compatible | Changes | Commit ID |
---|---|---|---|
0.3 | Yes | Working version | 3b73c7c2cd815a07972e5aee06e7a3d9f45d9dc7 |