Skip to content

Commit 618da4c

Browse files
authored
Merge branch 'release-1.15' into jobs-dotnet
2 parents ee6ad9b + bc6354e commit 618da4c

File tree

15 files changed

+213
-53
lines changed

15 files changed

+213
-53
lines changed

.github/env/global.env

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
DAPR_CLI_VERSION: 1.14.1
2-
DAPR_RUNTIME_VERSION: 1.14.4
1+
DAPR_CLI_VERSION: 1.15.0-rc.2
2+
DAPR_RUNTIME_VERSION: 1.15.0-rc.5
33
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/
44
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
5+
56
MACOS_PYTHON_VERSION: 3.10
7+
8+
PODMAN_VERSION: 4.4.4
9+
10+
GOVER: 1.22
11+
12+
KUBERNETES_VERSION: v1.32.0
13+
KIND_VERSION: v0.26.0
14+
KIND_IMAGE_SHA: sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027

.github/workflows/validate_csharp_quicstarts.yaml renamed to .github/workflows/validate_csharp_quickstarts.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
name: Validate C# quickstart on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 130
35-
env:
36-
DAPR_DEFAULT_IMAGE_REGISTRY: GHCR
37-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
38-
GOVER: 1.18
39-
KUBERNETES_VERSION: v1.25.3
40-
KIND_VERSION: v0.17.0
41-
KIND_IMAGE_SHA: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
42-
PODMAN_VERSION: 4.4.4
4335
strategy:
4436
matrix:
4537
os: [ubuntu-latest]

.github/workflows/validate_go_quickstarts.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
name: Validate Go quickstarts on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 130
35-
env:
36-
DAPR_DEFAULT_IMAGE_REGISTRY: GHCR
37-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
38-
GOVER: 1.21
39-
KUBERNETES_VERSION: v1.21.1
40-
KIND_VERSION: v0.11.0
41-
KIND_IMAGE_SHA: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
42-
PODMAN_VERSION: 4.4.4
4335
strategy:
4436
matrix:
4537
os: [ubuntu-latest]

.github/workflows/validate_java_quicstarts.yaml renamed to .github/workflows/validate_java_quickstarts.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
name: Validate Java quickstart on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 130
35-
env:
36-
DAPR_DEFAULT_IMAGE_REGISTRY: GHCR
37-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
38-
GOVER: 1.19
39-
KUBERNETES_VERSION: v1.25.3
40-
KIND_VERSION: v0.17.0
41-
KIND_IMAGE_SHA: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
42-
PODMAN_VERSION: 4.4.4
4335
strategy:
4436
matrix:
4537
os: [ubuntu-latest]

.github/workflows/validate_javascript_quicstarts.yaml renamed to .github/workflows/validate_javascript_quickstarts.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
name: Validate Javascript quickstart on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 130
35-
env:
36-
DAPR_DEFAULT_IMAGE_REGISTRY: GHCR
37-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
38-
GOVER: 1.19
39-
KUBERNETES_VERSION: v1.25.3
40-
KIND_VERSION: v0.17.0
41-
KIND_IMAGE_SHA: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
42-
PODMAN_VERSION: 4.4.4
4335
strategy:
4436
matrix:
4537
os: [ubuntu-latest]

.github/workflows/validate_python_quicstarts.yaml renamed to .github/workflows/validate_python_quickstarts.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
name: Validate Python quickstart on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 130
35-
env:
36-
DAPR_DEFAULT_IMAGE_REGISTRY: GHCR
37-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
38-
GOVER: 1.19
39-
KUBERNETES_VERSION: v1.25.3
40-
KIND_VERSION: v0.17.0
41-
KIND_IMAGE_SHA: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
42-
PODMAN_VERSION: 4.4.4
4335
strategy:
4436
matrix:
4537
os: [ubuntu-latest]

.github/workflows/validate_tutorials.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ jobs:
3232
name: Validate tutorials on ${{ matrix.os }}
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 40
35-
env:
36-
GOVER: 1.22
37-
KUBERNETES_VERSION: v1.29.4
38-
KIND_VERSION: v0.23.0
39-
KIND_IMAGE_SHA: sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8
4035
strategy:
4136
matrix:
4237
os: [ubuntu-latest]

actors/csharp/sdk/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Run the `SmartDevice.Service`, which will start service itself and the Dapr side
3434
<!-- STEP
3535
name: Run actor service
3636
expected_stdout_lines:
37-
- "Request finished HTTP/1.1 GET http://127.0.0.1:5001/healthz - 200"
37+
- "Request finished HTTP/1.1 GET http://127.0.0.1:5001/dapr/config - 200"
3838
expected_stderr_lines:
3939
working_dir: .
4040
output_match_mode: substring
@@ -50,14 +50,23 @@ dapr run --app-id actorservice --app-port 5001 --app-protocol http --dapr-http-p
5050
Expected output:
5151

5252
```bash
53+
== APP == info: Microsoft.Hosting.Lifetime[14]
54+
== APP == Now listening on: http://localhost:5001
55+
== APP == info: Microsoft.Hosting.Lifetime[0]
56+
== APP == Application started. Press Ctrl+C to shut down.
57+
== APP == info: Microsoft.Hosting.Lifetime[0]
58+
== APP == Hosting environment: Production
59+
== APP == info: Microsoft.Hosting.Lifetime[0]
5360
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
54-
== APP == Request starting HTTP/1.1 GET http://127.0.0.1:5001/healthz - -
61+
== APP == Request starting HTTP/1.1 GET http://127.0.0.1:5001/dapr/config - application/json -
62+
== APP == warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
63+
== APP == Failed to determine the https port for redirect.
5564
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
56-
== APP == Executing endpoint 'Dapr Actors Health Check'
65+
== APP == Executing endpoint 'Dapr Actors Config'
5766
== APP == info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
58-
== APP == Executed endpoint 'Dapr Actors Health Check'
67+
== APP == Executed endpoint 'Dapr Actors Config'
5968
== APP == info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
60-
== APP == Request finished HTTP/1.1 GET http://127.0.0.1:5001/healthz - - - 200 - text/plain 5.2599ms
69+
== APP == Request finished HTTP/1.1 GET http://127.0.0.1:5001/dapr/config - 200 - application/json 30.6175ms
6170
```
6271

6372
### Step 4: Run the client app

cryptography/python/sdk/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Dapr cryptography (Dapr SDK)
2+
3+
In this quickstart, you'll create an application that encrypts, and then decrypts, data using the Dapr cryptography APIs (high-level). We will:
4+
5+
- Encrypt and then decrypt a short string, reading the result in-memory
6+
- Encrypt and then decrypt a large file, storing the encrypted and decrypted data to files
7+
8+
Visit the documentation to learn more about the [Cryptography building block](https://v1-11.docs.dapr.io/developing-applications/building-blocks/cryptography/) in Dapr.
9+
10+
> **Note:** This example uses the Dapr SDK. Using the Dapr SDK, which leverages gRPC internally, is **strongly** recommended when using the high-level cryptography APIs (to encrypt and decrypt messages).
11+
12+
This quickstart includes one application:
13+
14+
- Python application `crypto-quickstart`
15+
16+
### Run Python service with Dapr
17+
18+
> In order to run this sample, make sure that OpenSSL is available on your system.
19+
20+
1. Navigate into the folder with the source code:
21+
22+
<!-- STEP
23+
name: Navigate into folder
24+
expected_stdout_lines:
25+
expected_stderr_lines:
26+
-->
27+
28+
```bash
29+
cd ./crypto-quickstart
30+
pip3 install -r requirements.txt
31+
```
32+
33+
<!-- END_STEP -->
34+
35+
2. This sample requires a private RSA key and a 256-bit symmetric (AES) key. We will generate them using OpenSSL:
36+
37+
<!-- STEP
38+
name: Generate keys
39+
working_dir: crypto-quickstart
40+
expected_stdout_lines:
41+
expected_stderr_lines:
42+
-->
43+
44+
```bash
45+
mkdir -p keys
46+
# Generate a private RSA key, 4096-bit keys
47+
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out keys/rsa-private-key.pem
48+
# Generate a 256-bit key for AES
49+
openssl rand -out keys/symmetric-key-256 32
50+
```
51+
52+
<!-- END_STEP -->
53+
54+
3. Run the Python service app with Dapr:
55+
56+
<!-- STEP
57+
name: Run order-processor service
58+
working_dir: crypto-quickstart
59+
expected_stdout_lines:
60+
- '== APP == Encrypted the message, got 856 bytes'
61+
- '== APP == Decrypted the message, got 24 bytes'
62+
- '== APP == The secret is "passw0rd"'
63+
- '== APP == Wrote encrypted data to encrypted.out'
64+
- '== APP == Wrote decrypted data to decrypted.out.jpg'
65+
- "Exited App successfully"
66+
expected_stderr_lines:
67+
output_match_mode: substring
68+
-->
69+
70+
```bash
71+
dapr run --app-id crypto-quickstart --resources-path ../../../components/ -- python3 app.py
72+
```
73+
74+
<!-- END_STEP -->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Output files
2+
encrypted.out
3+
decrypted.out.jpg
4+
5+
# Generated keys
6+
keys/
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
from dapr.clients import DaprClient
2+
from dapr.clients.grpc._crypto import EncryptOptions, DecryptOptions
3+
4+
# Name of the crypto component to use
5+
CRYPTO_COMPONENT_NAME = 'localstorage'
6+
# Name of the RSA private key to use
7+
RSA_KEY_NAME = 'rsa-private-key.pem'
8+
# Name of the symmetric (AES) key to use
9+
SYMMETRIC_KEY_NAME = 'symmetric-key-256'
10+
11+
12+
def main():
13+
print('Running gRPC client synchronous API')
14+
15+
with DaprClient() as dapr:
16+
# Step 1: encrypt a string using the RSA key, then decrypt it and show the output in the terminal
17+
print('Running encrypt/decrypt operation on string')
18+
encrypt_decrypt_string(dapr)
19+
20+
# Step 2: encrypt a large file and then decrypt it, using the AES key
21+
print('Running encrypt/decrypt operation on file')
22+
encrypt_decrypt_file(dapr)
23+
24+
25+
def encrypt_decrypt_string(dapr: DaprClient):
26+
message = 'The secret is "passw0rd"'
27+
28+
# Encrypt the message
29+
resp = dapr.encrypt(
30+
data=message.encode(),
31+
options=EncryptOptions(
32+
component_name=CRYPTO_COMPONENT_NAME,
33+
key_name=RSA_KEY_NAME,
34+
key_wrap_algorithm='RSA',
35+
),
36+
)
37+
38+
# The method returns a readable stream, which we read in full in memory
39+
encrypt_bytes = resp.read()
40+
print(f'Encrypted the message, got {len(encrypt_bytes)} bytes')
41+
42+
# Decrypt the encrypted data
43+
resp = dapr.decrypt(
44+
data=encrypt_bytes,
45+
options=DecryptOptions(
46+
component_name=CRYPTO_COMPONENT_NAME,
47+
key_name=RSA_KEY_NAME,
48+
),
49+
)
50+
51+
# The method returns a readable stream, which we read in full in memory
52+
decrypt_bytes = resp.read()
53+
print(f'Decrypted the message, got {len(decrypt_bytes)} bytes')
54+
55+
print(decrypt_bytes.decode())
56+
assert message == decrypt_bytes.decode()
57+
58+
59+
def encrypt_decrypt_file(dapr: DaprClient):
60+
file_name = 'desert.jpg'
61+
62+
# Encrypt the file
63+
with open(file_name, 'r+b') as target_file:
64+
encrypt_stream = dapr.encrypt(
65+
data=target_file.read(),
66+
options=EncryptOptions(
67+
component_name=CRYPTO_COMPONENT_NAME,
68+
key_name=SYMMETRIC_KEY_NAME,
69+
key_wrap_algorithm='AES',
70+
),
71+
)
72+
73+
# Write the encrypted data to a file "encrypted.out"
74+
with open('encrypted.out', 'w+b') as encrypted_file:
75+
encrypted_file.write(encrypt_stream.read())
76+
print('Wrote encrypted data to encrypted.out')
77+
78+
# Decrypt the encrypted data
79+
with open('encrypted.out', 'r+b') as encrypted_file:
80+
decrypt_stream = dapr.decrypt(
81+
data=encrypted_file.read(),
82+
options=DecryptOptions(
83+
component_name=CRYPTO_COMPONENT_NAME,
84+
key_name=SYMMETRIC_KEY_NAME,
85+
),
86+
)
87+
88+
# Write the decrypted data to a file "decrypted.out.jpg"
89+
with open('decrypted.out.jpg', 'w+b') as decrypted_file:
90+
decrypted_file.write(decrypt_stream.read())
91+
print('Wrote decrypted data to decrypted.out.jpg')
92+
93+
94+
if __name__ == '__main__':
95+
main()
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dapr>=1.14
2+
typing-extensions

cryptography/python/sdk/makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include ../../../docker.mk
2+
include ../../../validate.mk
3+
4+
# Remove generated files
5+
.PHONY: clean
6+
clean:
7+
-rm -r crypto-quickstart/keys
8+
-rm crypto-quickstart/encrypted.out
9+
-rm crypto-quickstart/decrypted.out.jpg
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dapr-ext-workflow
1+
dapr-ext-workflow>=0.6.0rc2
2+
dapr>=1.15.0rc2

0 commit comments

Comments
 (0)