Skip to content

Commit 0c60bbd

Browse files
authored
fix: add crypto validation example and fix mechanical markdown (dapr#544)
* fix: add crypto validation example and fix mechanical markdown Signed-off-by: mikeee <hey@mike.ee> * fix: update test assertion and remove cleanup step Signed-off-by: mikeee <hey@mike.ee> --------- Signed-off-by: mikeee <hey@mike.ee>
1 parent b2ead49 commit 0c60bbd

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/workflows/validate_examples.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ jobs:
158158
[
159159
"actor",
160160
"configuration",
161+
"crypto",
161162
"grpc-service",
162163
"hello-world",
163164
"pubsub",

examples/crypto/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
# Dapr Crypto Example with go-sdk
22

3-
## Step
3+
## Steps
44

55
### Prepare
66

77
- Dapr installed
88

99
> In order to run this sample, make sure that OpenSSL is available on your system.
1010
11+
### Running
1112

12-
This sample requires a private RSA key and a 256-bit symmetric (AES) key. We will generate them using OpenSSL:
13+
1. This sample requires a private RSA key and a 256-bit symmetric (AES) key. We will generate them using OpenSSL:
14+
15+
<!-- STEP
16+
name: Generate crypto
17+
expected_stderr_lines:
18+
output_match_mode: substring
19+
background: false
20+
sleep: 5
21+
timeout_seconds: 30
22+
-->
1323

1424
```bash
1525
mkdir -p keys
@@ -21,19 +31,21 @@ openssl rand -out keys/symmetric-key-256 32
2131

2232
<!-- END_STEP -->
2333

24-
3. Run the Go service app with Dapr:
34+
2. Run the Go service app with Dapr:
2535

2636
<!-- STEP
27-
name: Run crypto service
37+
name: Run crypto example
2838
expected_stdout_lines:
2939
- '== APP == Encrypted the message, got 856 bytes'
3040
- '== APP == Decrypted the message, got 24 bytes'
3141
- '== APP == The secret is "passw0rd"'
32-
- '== APP == Wrote decrypted data to encrypted.out'
42+
- '== APP == Wrote encrypted data to encrypted.out'
3343
- '== APP == Wrote decrypted data to decrypted.out.jpg'
3444
- "Exited App successfully"
3545
expected_stderr_lines:
3646
output_match_mode: substring
47+
sleep: 30
48+
timeout_seconds: 90
3749
-->
3850

3951
```bash
@@ -44,20 +56,13 @@ dapr run --app-id crypto --resources-path ./components/ -- go run .
4456

4557
### Cleanup
4658

47-
<!-- STEP
48-
expected_stdout_lines:
49-
- '✅ app stopped successfully: crypto'
50-
expected_stderr_lines:
51-
name: Shutdown dapr
52-
-->
59+
`ctrl + c` to stop execution
5360

5461
```bash
5562
dapr stop --app-id crypto
5663
(lsof -i:8080 | grep crypto) | awk '{print $2}' | xargs kill
5764
```
5865

59-
<!-- END_STEP -->
60-
6166
## Result
6267

6368
```shell

0 commit comments

Comments
 (0)