mirror of https://github.com/dapr/docs.git
				
				
				
			Solved merge conflicts
Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>
This commit is contained in:
		
							parent
							
								
									caf849f973
								
							
						
					
					
						commit
						e4b3ad529b
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -10,15 +10,7 @@ This article provides guidance on using Dapr's secrets API in your code to lever | ||||||
| 
 | 
 | ||||||
| ## Example | ## Example | ||||||
| 
 | 
 | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| The below code example loosely describes an application that processes orders. In the example, there is an order processing service, which has a Dapr sidecar. The order processing service uses Dapr to store a secret in a local secret store. | The below code example loosely describes an application that processes orders. In the example, there is an order processing service, which has a Dapr sidecar. The order processing service uses Dapr to store a secret in a local secret store. | ||||||
| ======= |  | ||||||
| The below code examples loosely describes an application that processes orders. In the examples, there is an order processing service which has a Dapr sidecar. The order processing service uses Dapr to store a secret in a local secret store. |  | ||||||
| >>>>>>> 0e4ab1a9 (Update daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md) |  | ||||||
| ======= |  | ||||||
| The below code example loosely describes an application that processes orders. In the example, there is an order processing service, which has a Dapr sidecar. The order processing service uses Dapr to store a secret in a local secret store. |  | ||||||
| >>>>>>> ee1a2382 (Update daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md) |  | ||||||
| 
 | 
 | ||||||
| <img src="/images/building-block-secrets-management-example.png" width=1000 alt="Diagram showing secrets management of example service"> | <img src="/images/building-block-secrets-management-example.png" width=1000 alt="Diagram showing secrets management of example service"> | ||||||
| 
 | 
 | ||||||
|  | @ -62,10 +54,6 @@ To configure a different kind of secret store see the guidance on [how to config | ||||||
| ## Get a secret | ## Get a secret | ||||||
| 
 | 
 | ||||||
| Run the Dapr sidecar with the application. | Run the Dapr sidecar with the application. | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| 
 |  | ||||||
| >>>>>>> 7bfd5715 (Modified based on the review comments - 2) |  | ||||||
| 
 | 
 | ||||||
| {{< tabs Dotnet Java Python Go Javascript>}} | {{< tabs Dotnet Java Python Go Javascript>}} | ||||||
| 
 | 
 | ||||||
|  | @ -158,47 +146,27 @@ import com.fasterxml.jackson.core.JsonProcessingException; | ||||||
| import com.fasterxml.jackson.databind.ObjectMapper; | import com.fasterxml.jackson.databind.ObjectMapper; | ||||||
| import io.dapr.client.DaprClient; | import io.dapr.client.DaprClient; | ||||||
| import io.dapr.client.DaprClientBuilder; | import io.dapr.client.DaprClientBuilder; | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| >>>>>>> e257da8d (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 5b6521a2 (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 77d11604 (Added full code snippets of secrets management) |  | ||||||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| import java.util.*; | import java.util.*; | ||||||
| <<<<<<< HEAD | 
 | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| >>>>>>> 7bfd5715 (Modified based on the review comments - 2) |  | ||||||
| ======= |  | ||||||
| >>>>>>> e257da8d (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 5b6521a2 (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 77d11604 (Added full code snippets of secrets management) |  | ||||||
| 
 | 
 | ||||||
| //code | //code | ||||||
| @SpringBootApplication | @SpringBootApplication | ||||||
| public class OrderProcessingServiceApplication { | public class OrderProcessingServiceApplication { | ||||||
| 
 | 
 | ||||||
| 	private static final Logger log = LoggerFactory.getLogger(OrderProcessingServiceApplication.class); |     private static final Logger log = LoggerFactory.getLogger(OrderProcessingServiceApplication.class); | ||||||
| 	private static final ObjectMapper JSON_SERIALIZER = new ObjectMapper(); |     private static final ObjectMapper JSON_SERIALIZER = new ObjectMapper(); | ||||||
| 
 | 
 | ||||||
| 	private static final String SECRET_STORE_NAME = "localsecretstore"; |     private static final String SECRET_STORE_NAME = "localsecretstore"; | ||||||
| 
 | 
 | ||||||
| 	public static void main(String[] args) throws InterruptedException, JsonProcessingException { |     public static void main(String[] args) throws InterruptedException, JsonProcessingException { | ||||||
| 		DaprClient client = new DaprClientBuilder().build(); |         DaprClient client = new DaprClientBuilder().build(); | ||||||
|         //Using Dapr SDK to get a secret |         //Using Dapr SDK to get a secret | ||||||
| 		Map<String, String> secret = client.getSecret(SECRET_STORE_NAME, "secret").block(); |         Map<String, String> secret = client.getSecret(SECRET_STORE_NAME, "secret").block(); | ||||||
| 		log.info("Result: " + JSON_SERIALIZER.writeValueAsString(secret)); |         log.info("Result: " + JSON_SERIALIZER.writeValueAsString(secret)); | ||||||
| 	} |     } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| {{% /codetab %}} | {{% /codetab %}} | ||||||
|  | @ -207,31 +175,10 @@ public class OrderProcessingServiceApplication { | ||||||
| 
 | 
 | ||||||
| ```python | ```python | ||||||
| #dependencies  | #dependencies  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| >>>>>>> e257da8d (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 5b6521a2 (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 77d11604 (Added full code snippets of secrets management) |  | ||||||
| import random | import random | ||||||
| from time import sleep     | from time import sleep     | ||||||
| import requests | import requests | ||||||
| import logging | import logging | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| >>>>>>> 7bfd5715 (Modified based on the review comments - 2) |  | ||||||
| ======= |  | ||||||
| >>>>>>> e257da8d (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 5b6521a2 (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 77d11604 (Added full code snippets of secrets management) |  | ||||||
| from dapr.clients import DaprClient | from dapr.clients import DaprClient | ||||||
| from dapr.clients.grpc._state import StateItem | from dapr.clients.grpc._state import StateItem | ||||||
| from dapr.clients.grpc._request import TransactionalStateOperation, TransactionOperationType | from dapr.clients.grpc._request import TransactionalStateOperation, TransactionOperationType | ||||||
|  | @ -250,19 +197,6 @@ with DaprClient() as client: | ||||||
|     secret = client.get_bulk_secret(store_name=DAPR_STORE_NAME) |     secret = client.get_bulk_secret(store_name=DAPR_STORE_NAME) | ||||||
|     logging.info('Result for bulk secret: ') |     logging.info('Result for bulk secret: ') | ||||||
|     logging.info(sorted(secret.secrets.items())) |     logging.info(sorted(secret.secrets.items())) | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| <<<<<<< HEAD |  | ||||||
| ======= |  | ||||||
| 
 |  | ||||||
| >>>>>>> 03751403 (Modified based on the review comments - 1) |  | ||||||
| ======= |  | ||||||
| >>>>>>> e257da8d (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 5b6521a2 (Added full code snippets of secrets management) |  | ||||||
| ======= |  | ||||||
| >>>>>>> 77d11604 (Added full code snippets of secrets management) |  | ||||||
| ``` | ``` | ||||||
| {{% /codetab %}} | {{% /codetab %}} | ||||||
| 
 | 
 | ||||||
|  | @ -271,40 +205,40 @@ with DaprClient() as client: | ||||||
| ```go | ```go | ||||||
| //dependencies  | //dependencies  | ||||||
| import ( | import ( | ||||||
| 	"context" |     "context" | ||||||
| 	"log" |     "log" | ||||||
| 	dapr "github.com/dapr/go-sdk/client" |     dapr "github.com/dapr/go-sdk/client" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| //code | //code | ||||||
| func main() { | func main() { | ||||||
| 	client, err := dapr.NewClient() |     client, err := dapr.NewClient() | ||||||
| 	SECRET_STORE_NAME := "localsecretstore" |     SECRET_STORE_NAME := "localsecretstore" | ||||||
| 	if err != nil { |     if err != nil { | ||||||
| 		panic(err) |         panic(err) | ||||||
| 	} |     } | ||||||
| 	defer client.Close() |     defer client.Close() | ||||||
| 	ctx := context.Background() |     ctx := context.Background() | ||||||
|     //Using Dapr SDK to get a secret |     //Using Dapr SDK to get a secret | ||||||
| 	secret, err := client.GetSecret(ctx, SECRET_STORE_NAME, "secret", nil) |     secret, err := client.GetSecret(ctx, SECRET_STORE_NAME, "secret", nil) | ||||||
| 	if err != nil { |     if err != nil { | ||||||
| 		return nil, errors.Wrap(err, "Got error for accessing key") |         return nil, errors.Wrap(err, "Got error for accessing key") | ||||||
| 	} |     } | ||||||
| 
 | 
 | ||||||
| 	if secret != nil { |     if secret != nil { | ||||||
| 		log.Println("Result : ") |         log.Println("Result : ") | ||||||
| 		log.Println(secret) |         log.Println(secret) | ||||||
| 	} |     } | ||||||
|     //Using Dapr SDK to get bulk secrets |     //Using Dapr SDK to get bulk secrets | ||||||
| 	secretRandom, err := client.GetBulkSecret(ctx, SECRET_STORE_NAME, nil) |     secretRandom, err := client.GetBulkSecret(ctx, SECRET_STORE_NAME, nil) | ||||||
| 	if err != nil { |     if err != nil { | ||||||
| 		return nil, errors.Wrap(err, "Got error for accessing key") |         return nil, errors.Wrap(err, "Got error for accessing key") | ||||||
| 	} |     } | ||||||
| 
 | 
 | ||||||
| 	if secret != nil { |     if secret != nil { | ||||||
| 		log.Println("Result for bulk: ") |         log.Println("Result for bulk: ") | ||||||
| 		log.Println(secretRandom) |         log.Println(secretRandom) | ||||||
| 	} |     } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| {{% /codetab %}} | {{% /codetab %}} | ||||||
|  | @ -342,4 +276,4 @@ main(); | ||||||
| - [Configure a secret store]({{<ref setup-secret-store>}}) | - [Configure a secret store]({{<ref setup-secret-store>}}) | ||||||
| - [Supported secrets]({{<ref supported-secret-stores>}}) | - [Supported secrets]({{<ref supported-secret-stores>}}) | ||||||
| - [Using secrets in components]({{<ref component-secrets>}}) | - [Using secrets in components]({{<ref component-secrets>}}) | ||||||
| - [Secret stores quickstart](https://github.com/dapr/quickstarts/tree/master/secretstore) | - [Secret stores quickstart](https://github.com/dapr/quickstarts/tree/master/secretstore) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue