Skip to content

Commit

Permalink
Merge branch 'v1.12' into perf-1
Browse files Browse the repository at this point in the history
  • Loading branch information
yaron2 authored Apr 24, 2024
2 parents d8a5628 + 6d5de8f commit 8bf63e5
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 131 deletions.
109 changes: 0 additions & 109 deletions .github/workflows/website-root.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The following branches are currently maintained:

| Branch | Website | Description |
| ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------ |
| [v1.12](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. |
| [v1.13](https://github.com/dapr/docs/tree/v1.13) (pre-release) | https://v1-13.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.13+ go here. |
| [v1.13](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. |
| [v1.14](https://github.com/dapr/docs/tree/v1.14) (pre-release) | https://v1-14.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.14+ go here. |

For more information visit the [Dapr branch structure](https://docs.dapr.io/contributing/docs-contrib/contributing-docs/#branch-guidance) document.

Expand Down
15 changes: 9 additions & 6 deletions daprdocs/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Site Configuration
baseURL = "https://docs.dapr.io"
baseURL = "https://v1-12.docs.dapr.io"
title = "Dapr Docs"
theme = "docsy"
disableFastRender = true
Expand Down Expand Up @@ -183,17 +183,20 @@ github_subdir = "daprdocs"
github_branch = "v1.12"

# Versioning
version_menu = "v1.12 (latest)"
version_menu = "v1.12"
version = "v1.12"
archived_version = false
archived_version = true
url_latest_version = "https://docs.dapr.io"

[[params.versions]]
version = "v1.13 (preview)"
url = "https://v1-13.docs.dapr.io"
version = "v1.14 (preview)"
url = "https://v1-14.docs.dapr.io"
[[params.versions]]
version = "v1.12 (latest)"
version = "v1.13 (latest)"
url = "#"
[[params.versions]]
version = "v1.12"
url = "https://v1-12.docs.dapr.io"
[[params.versions]]
version = "v1.11"
url = "https://v1-11.docs.dapr.io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ weight: 2000
description: "Learn how to encrypt and decrypt files"
---

Now that you've read about [Cryptography as a Dapr building block]({{< ref cryptography-overview.md >}}), let's walk through using the cryptography APIs with the SDKs.
Now that you've read about [Cryptography as a Dapr building block]({{< ref cryptography-overview.md >}}), let's walk through using the cryptography APIs with the SDKs.

{{% alert title="Note" color="primary" %}}
Dapr cryptography is currently in alpha.
Dapr cryptography is currently in alpha.

{{% /alert %}}

## Encrypt

{{< tabs "JavaScript" "Go" >}}
{{< tabs "JavaScript" "Go" ".NET" >}}

{{% codetab %}}

Expand Down Expand Up @@ -136,12 +136,32 @@ if err != nil {

{{% /codetab %}}

{{% codetab %}}

<!-- .NET -->
Using the Dapr SDK in your project, with the gRPC APIs, you can encrypt data in a string or a byte array:

```csharp
using var client = new DaprClientBuilder().Build();

const string componentName = "azurekeyvault"; //Change this to match your cryptography component
const string keyName = "myKey"; //Change this to match the name of the key in your cryptographic store
const string plainText = "This is the value we're going to encrypt today";

//Encode the string to a UTF-8 byte array and encrypt it
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
var encryptedBytesResult = await client.EncryptAsync(componentName, plaintextBytes, keyName, new EncryptionOptions(KeyWrapAlgorithm.Rsa));
```

{{% /codetab %}}

{{< /tabs >}}


## Decrypt

{{< tabs "JavaScript" "Go" >}}
{{< tabs "JavaScript" "Go" ".NET" >}}

{{% codetab %}}

Expand Down Expand Up @@ -186,6 +206,29 @@ out, err := sdkClient.Decrypt(context.Background(), rf, dapr.EncryptOptions{

{{% /codetab %}}

{{% codetab %}}

<!-- .NET -->
To decrypt a string, use the 'DecryptAsync' gRPC API in your project.

In the following example, we'll take a byte array (such as from the example above) and decrypt it to a UTF-8 encoded string.

```csharp
public async Task<string> DecryptBytesAsync(byte[] encryptedBytes)
{
using var client = new DaprClientBuilder().Build();

const string componentName = "azurekeyvault"; //Change this to match your cryptography component
const string keyName = "myKey"; //Change this to match the name of the key in your cryptographic store
var decryptedBytes = await client.DecryptAsync(componentName, encryptedBytes, keyName);
var decryptedString = Encoding.UTF8.GetString(decryptedBytes.ToArray());
return decryptedString;
}
```

{{% /codetab %}}

{{< /tabs >}}

## Next steps
Expand Down
8 changes: 5 additions & 3 deletions daprdocs/content/en/getting-started/get-started-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ type: docs
title: "Use the Dapr API"
linkTitle: "Use the Dapr API"
weight: 30
description: "Run a Dapr sidecar and try out the state API"
description: "Run a Dapr sidecar and try out the state management API"
---

In this guide, you'll simulate an application by running the sidecar and calling the API directly. After running Dapr using the Dapr CLI, you'll:
In this guide, you'll simulate an application by running the sidecar and calling the state management API directly.
After running Dapr using the Dapr CLI, you'll:

- Save a state object.
- Read/get the state object.
Expand All @@ -21,7 +22,8 @@ In this guide, you'll simulate an application by running the sidecar and calling

### Step 1: Run the Dapr sidecar

The [`dapr run`]({{< ref dapr-run.md >}}) command launches an application, together with a sidecar.
The [`dapr run`]({{< ref dapr-run.md >}}) command normally runs your application and a Dapr sidecar. In this case,
it only runs the sidecar since you are interacting with the state management API directly.

Launch a Dapr sidecar that will listen on port 3500 for a blank application named `myapp`:

Expand Down
5 changes: 5 additions & 0 deletions daprdocs/content/en/getting-started/install-dapr-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ You'll use the Dapr CLI as the main tool for various Dapr-related tasks. You can

The Dapr CLI works with both [self-hosted]({{< ref self-hosted >}}) and [Kubernetes]({{< ref Kubernetes >}}) environments.

{{% alert title="Before you begin" color="primary" %}}
In Docker Desktop's advanced options, verify you've allowed the default Docker socket to be used.
<img src="/images/docker-desktop-setting.png" width=800 style="padding-bottom:15px;">
{{% /alert %}}

### Step 1: Install the Dapr CLI

{{< tabs Linux Windows MacOS Binaries>}}
Expand Down
9 changes: 7 additions & 2 deletions daprdocs/content/en/getting-started/install-dapr-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ Dapr initialization includes:
1. Creating a **default components folder** with component definitions for the above.
1. Running a **Dapr placement service container instance** for local actor support.

{{% alert title="Kubernetes Development Environment" color="primary" %}}
To initialize Dapr in your local or remote **Kubernetes** cluster for development (including the Redis and Zipkin containers listed above), see [how to initialize Dapr for development on Kubernetes]({{<ref "kubernetes-deploy.md#install-dapr-from-the-official-dapr-helm-chart-with-development-flag">}})
{{% /alert %}}

{{% alert title="Docker" color="primary" %}}
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment.
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}}), the next steps in this guide assume the recommended Docker development environment.

You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}).
{{% /alert %}}
Expand Down Expand Up @@ -66,7 +70,7 @@ dapr init

**If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes.
1. Navigate to **Docker Desktop** > **Settings** > **Advanced**.
1. Select the **Enable default Docker socket** checkbox.
1. Select the **Allow the default Docker socket to be used (requires password)** checkbox.

{{% /codetab %}}

Expand All @@ -82,6 +86,7 @@ dapr init

{{< /tabs >}}

[See the troubleshooting guide if you encounter any error messages regarding Docker not being installed or running.]({{< ref "common_issues.md#dapr-cant-connect-to-docker-when-installing-the-dapr-cli" >}})

### Step 3: Verify Dapr version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,51 @@ The `-k` flag initializes Dapr on the Kubernetes cluster in your current context
dapr dashboard -k -n <your-namespace>
```


#### Install Dapr from the offical Dapr Helm chart (with development flag)

Adding the `--dev` flag initializes Dapr on the Kubernetes cluster on your current context, with the addition of Redis and Zipkin deployments.

The steps are similar to [installing from the Dapr Helm chart](#install-dapr-from-an-official-dapr-helm-chart), except for appending the `--dev` flag to the `init` command:

```bash
dapr init -k --dev
```

Expected output:

```bash
⌛ Making the jump to hyperspace...
ℹ️ Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced
ℹ️ Container images will be pulled from Docker Hub
✅ Deploying the Dapr control plane with latest version to your cluster...
✅ Deploying the Dapr dashboard with latest version to your cluster...
✅ Deploying the Dapr Redis with latest version to your cluster...
✅ Deploying the Dapr Zipkin with latest version to your cluster...
ℹ️ Applying "statestore" component to Kubernetes "default" namespace.
ℹ️ Applying "pubsub" component to Kubernetes "default" namespace.
ℹ️ Applying "appconfig" zipkin configuration to Kubernetes "default" namespace.
✅ Success! Dapr has been installed to namespace dapr-system. To verify, run `dapr status -k' in your terminal. To get started, go here: https://aka.ms/dapr-getting-started
```
After a short period of time (or using the `--wait` flag and specifying an amount of time to wait), you can check that the Redis and Zipkin components have been deployed to the cluster.
```bash
kubectl get pods --namespace default
```
Expected output:
```bash
NAME READY STATUS RESTARTS AGE
dapr-dev-zipkin-bfb4b45bb-sttz7 1/1 Running 0 159m
dapr-dev-redis-master-0 1/1 Running 0 159m
dapr-dev-redis-replicas-0 1/1 Running 0 159m
dapr-dev-redis-replicas-1 1/1 Running 0 159m
dapr-dev-redis-replicas-2 1/1 Running 0 158m
```
#### Install Dapr from a private Dapr Helm chart
Installing Dapr from a private Helm chart can be helpful for when you:
Expand Down
6 changes: 5 additions & 1 deletion daprdocs/content/en/operations/security/api-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ kubectl rollout restart deployment/<deployment-name> --namespace <namespace-name

## Adding API token to client API invocations

Once token authentication is configured in Dapr, all clients invoking Dapr API will have to append the API token token to every request:
Once token authentication is configured in Dapr, all clients invoking Dapr API need to append the `dapr-api-token` token to every request.

> **Note:** The Dapr SDKs read the [DAPR_API_TOKEN]({{< ref environment >}}) environment variable and set it for you by default.

<img src="/images/tokens-auth.png" width=800 style="padding-bottom:15px;">

### HTTP

Expand Down
6 changes: 4 additions & 2 deletions daprdocs/content/en/operations/security/app-api-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ kubectl rollout restart deployment/<deployment-name> --namespace <namespace-name

## Authenticating requests from Dapr

Once app token authentication is configured in Dapr, all requests *coming from Dapr* include the token.
Once app token authentication is configured using the environment variable or Kubernetes secret `app-api-token`, the Dapr sidecar always includes the HTTP header/gRPC metadata `dapr-api-token: <token>` in the calls to the app. From the app side, ensure you are authenticating using the `dapr-api-token` value which uses the `app-api-token` you set to authenticate requests from Dapr.

<img src="/images/tokens-auth.png" width=800 style="padding-bottom:15px;">

### HTTP

In case of HTTP, in your code look for the HTTP header `dapr-api-token` in incoming requests:
In your code, look for the HTTP header `dapr-api-token` in incoming requests:

```text
dapr-api-token: <token>
Expand Down
Loading

0 comments on commit 8bf63e5

Please sign in to comment.