Skip to content

Commit

Permalink
Merge pull request #263 from Borelli-7/issue_262
Browse files Browse the repository at this point in the history
Issue 262 merging from develop
  • Loading branch information
NdSaid committed Jan 12, 2024
2 parents a9568eb + e9953d9 commit 6e4a3ed
Show file tree
Hide file tree
Showing 18 changed files with 787 additions and 859 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ hs_err_pid*
# node.js / frontend
node_modules/
dist/
.angular/
package-lock.json

865 changes: 49 additions & 816 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions datasafe-business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
<groupId>de.adorsys</groupId>
<artifactId>datasafe-test-storages</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* This is Datasafe services customized implementation.
* Note, that despite is has {@code @Singleton} annotation, it is not real singleton, the only shared thing
* Note, that despite it has {@code @Singleton} annotation, it is not real singleton, the only shared thing
* across all services instantiated using build() is bindings with {@code Singleton} in its Module.
*/
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<groupId>de.adorsys</groupId>
<artifactId>datasafe-test-storages</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<groupId>de.adorsys</groupId>
<artifactId>datasafe-test-storages</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.adorsys.datasafe.simple.adapter.impl;

import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.sun.management.UnixOperatingSystemMXBean;
import de.adorsys.datasafe.encrypiton.api.types.UserID;
import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth;
import de.adorsys.datasafe.encrypiton.api.types.encryption.MutableEncryptionConfig;
Expand All @@ -24,17 +23,13 @@
import de.adorsys.datasafe.types.api.utils.ReadKeyPasswordTestFactory;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.implementation.bytecode.Throw;
import org.bouncycastle.util.io.Streams;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import java.io.ByteArrayInputStream;
import java.io.OutputStream;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.nio.file.NoSuchFileException;
import java.security.UnrecoverableKeyException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<groupId>de.adorsys</groupId>
<artifactId>datasafe-test-storages</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;

import java.util.stream.Stream;

Expand Down
2 changes: 1 addition & 1 deletion datasafe-storage/datasafe-storage-impl-s3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>de.adorsys</groupId>
<artifactId>datasafe-types-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
Expand Down
18 changes: 18 additions & 0 deletions datasafe-test-storages/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,22 @@
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
<phase>test-compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import de.adorsys.datasafe.types.api.resource.Uri;
import de.adorsys.datasafe.types.api.shared.BaseMockitoTest;
import de.adorsys.datasafe.types.api.utils.ExecutorServiceUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.ToString;
Expand Down
Binary file added docs/demo/deployment-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions docs/readme/Demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
## Quick demo
### Datasafe-CLI
You can try datasafe as a CLI (command-line-interface) executable for encryption of your own sensitive files.
Your encrypted files can be saved either in S3 bucket or local filesystem safely, because encryption will happen
locally - on your machine (See [CLI-README](datasafe-cli/README.md) for details).

**Download CLI executable**:

1. [MacOS native executable](https://github.com/adorsys/datasafe/releases/download/v0.7.0/datasafe-cli-osx-x64)
1. [Linux native executable](https://github.com/adorsys/datasafe/releases/download/v0.7.0/datasafe-cli-linux-x64)
1. Windows executable (N/A yet), please use java version below
1. [Java-based jar](https://github.com/adorsys/datasafe/releases/download/v0.7.0/datasafe-cli.jar), requires JRE (1.8+), use `java -jar datasafe-cli.jar` to execute

#### Example actions:
##### Download application and create new user:

<details><summary>New profile animation transcript</summary>

- Download CLI application (MacOS url)

```bash
curl -L https://github.com/adorsys/datasafe/releases/download/v0.6.0/datasafe-cli-osx-x64 > datasafe-cli && chmod +x datasafe-cli
```
- Create file with your credentials (they also can be passed through command line)

```bash
echo '{"username": "john", "password": "Doe", "systemPassword": "password"}' > john.credentials
```
- Create your new user profile (credentials come from john.credentials). You can enter value or click enter to accept
the default value when prompted.

```bash
./datasafe-cli -c john.credentials profile create
```
</details>

![new_profile](../demo/new_profile.gif)

**Note**: Instead of creating file with credentials you can provide credentials directly into terminal (this is less
secure than having credentials file, but is fine for demo purposes):
```bash
./datasafe-cli -u=MeHappyUser -p=MyCoolPassword -sp=greatSystemPassword private cat secret.txt
```
Command above will show private file `secret.txt` content for user `MeHappyUser` who has password `MyCoolPassword` and
system password `greatSystemPassword`

##### Encrypt and decrypt some secret data for our user:

<details><summary>Encrypting/decrypting data animation transcript</summary>

- Create some unencrypted content

```bash
echo "Hello world" > unencrypted.txt
```
- Encrypt and store file from above in privatespace. In privatespace it will have decrypted name `secret.txt`
```bash
./datasafe-cli -c john.credentials private cp unencrypted.txt secret.txt
```
- Show that filename is encrypted in privatespace:

```bash
ls private
```

- Show that file content is encrypted too:

```bash
cat private/encrypted_file_name_from_above
```

- Decrypt file content:

```bash
./datasafe-cli -c john.credentials private cat secret.txt
```
</details>

![encrypt_decrypt_file](../demo/encrypt_decrypt_file.gif)

##### You can always list available actions in context:

<details><summary>List actions animation transcript</summary>

- Show top-level commands

```bash
./datasafe-cli -c john.credentials
```

- Show commands for privatespace

```bash
./datasafe-cli -c john.credentials private
```
</details>

![list_actions](../demo/list_actions.gif)

### REST API demo
[Here](../../datasafe-rest-impl/DEMO.md) you can find quick docker-based demo of project capabilities with
instructions of how to use it (REST-api based to show how to deploy as encryption server).
3 changes: 3 additions & 0 deletions docs/readme/DeploymentModels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Deployment Models
Followings are among others possible deployment models of the datasafe application.
![Datasafe deployment model](../demo/deployment-model.png)
Loading

0 comments on commit 6e4a3ed

Please sign in to comment.