Skip to content

🔑Authorization Server that will be used to authorize user's transactions and optionally other security modules.

Notifications You must be signed in to change notification settings

RaspberryWallet/AuthorizationServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuthorizationServer Wallet Module 🔑

This module is simple REST API application, that is used by Raspberry Wallet as Module, which is trusted third party side.

Requirements

  • Maven 3+
  • Java 8

Installation

# 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

Table of contents

Details

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

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.

Register
POST /authorization/register
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"password":"1234"
}
Login
POST /authorization/login
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"password":"1234"
}

# returns token which is UUID converted to String
Logout
POST /authorization/logout
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"password":"1234"
}
Set secret
POST /authorization/secret/set
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"token":"01badf5d-fb41-4d2a-a029-0bce54bea501",
	"secret":"data"
}
Get secret
POST /authorization/secret/get
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"token":"01badf5d-fb41-4d2a-a029-0bce54bea501"

}

# returns secret as String
Overwrites existing secret
POST /authorization/secret/overwrite
Content-Type: application/json; charset=UTF-8
{
	"walletUUID":"abcd",
	"token":"01badf5d-fb41-4d2a-a029-0bce54bea501",
	"secret":"duplicate"
}

Old sequence diagrams

They are not actual and we left them here, because they will be refreshed soon.

Initialization of module sequence diagram:

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

Unlock module sequence diagram:

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

Authors

Name email
Patryk Milewski patryk.milewski@gmail.com

Changelog

Version Is backward-compatible Changes Commit ID
0.3 Yes Working version 3b73c7c2cd815a07972e5aee06e7a3d9f45d9dc7

About

🔑Authorization Server that will be used to authorize user's transactions and optionally other security modules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published