From 06252e102db04b9349e929c60b43d9f8af73135d Mon Sep 17 00:00:00 2001 From: Roberto Rojas Date: Tue, 9 May 2023 11:10:21 -0400 Subject: [PATCH] GCP Firestore Certification Tests (#3375) * GCP Firestore Certification Tests Signed-off-by: Roberto J Rojas * Update daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Roberto Rojas * Update daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Roberto Rojas * gcp firestore: adds privatekey doc Signed-off-by: Roberto J Rojas --------- Signed-off-by: Roberto J Rojas Signed-off-by: Roberto Rojas Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> --- .../supported-state-stores/setup-firestore.md | 46 +++++++++++-------- .../data/components/state_stores/gcp.yaml | 2 +- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md index 9c489bbf1..6062b05e2 100644 --- a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md +++ b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-firestore.md @@ -21,30 +21,32 @@ spec: type: state.gcp.firestore version: v1 metadata: - - name: type - value: # Required. Example: "serviceaccount" - name: project_id value: # Required. + - name: endpoint # Optional. + value: "http://localhost:8432" - name: private_key_id - value: # Required. + value: # Optional. - name: private_key - value: # Required. + value: # Optional, but Required if `private_key_id` is specified. - name: client_email - value: # Required. + value: # Optional, but Required if `private_key_id` is specified. - name: client_id - value: # Required. + value: # Optional, but Required if `private_key_id` is specified. - name: auth_uri - value: # Required. + value: # Optional. - name: token_uri - value: # Required. + value: # Optional. - name: auth_provider_x509_cert_url - value: # Required. + value: # Optional. - name: client_x509_cert_url - value: # Required. + value: # Optional. - name: entity_kind value: # Optional. default: "DaprState" - name: noindex value: # Optional. default: "false" + - name: type + value: # Deprecated. ``` {{% alert title="Warning" color="warning" %}} @@ -55,17 +57,23 @@ The above example uses secrets as plain strings. It is recommended to use a secr | Field | Required | Details | Example | |--------------------|:--------:|---------|---------| -| type | Y | The credentials type | `"serviceaccount"` | project_id | Y | The ID of the GCP project to use | `"project-id"` -| private_key_id | Y | The ID of the prvate key to use | `"private-key-id"` -| client_email | Y | The email address for the client | `"eample@example.com"` -| client_id | Y | The client id value to use for authentication | `"client-id"` -| auth_uri | Y | The authentication URI to use | `"https://accounts.google.com/o/oauth2/auth"` -| token_uri | Y | The token URI to query for Auth token | `"https://oauth2.googleapis.com/token"` -| auth_provider_x509_cert_url | Y | The auth provider certificate URL | `"https://www.googleapis.com/oauth2/v1/certs"` -| client_x509_cert_url | Y | The client certificate URL | `"https://www.googleapis.com/robot/v1/metadata/x509/x"` +| endpoint | N | GCP endpoint for the component to use. Only used for local development with (for example) [GCP Datastore Emulator](https://cloud.google.com/datastore/docs/tools/datastore-emulator). The `endpoint` is unnecessary when running against the GCP production API. | `"localhost:8432"` +| private_key_id | N | The ID of the prvate key to use | `"private-key-id"` +| privateKey | N | If using explicit credentials, this field should contain the `private_key` field from the service account json | `-----BEGIN PRIVATE KEY-----MIIBVgIBADANBgkqhkiG9w0B` +| client_email | N | The email address for the client | `"eample@example.com"` +| client_id | N | The client id value to use for authentication | `"client-id"` +| auth_uri | N | The authentication URI to use | `"https://accounts.google.com/o/oauth2/auth"` +| token_uri | N | The token URI to query for Auth token | `"https://oauth2.googleapis.com/token"` +| auth_provider_x509_cert_url | N | The auth provider certificate URL | `"https://www.googleapis.com/oauth2/v1/certs"` +| client_x509_cert_url | N | The client certificate URL | `"https://www.googleapis.com/robot/v1/metadata/x509/x"` | entity_kind | N | The entity name in Filestore. Defaults to `"DaprState"` | `"DaprState"` | noindex | N | Whether to disable indexing of state entities. Use this setting if you encounter Firestore index size limitations. Defaults to `"false"` | `"true"` +| type | N | **DEPRECATED** The credentials type | `"serviceaccount"` + + +## GCP Credentials +Since the GCP Firestore component uses the GCP Go Client Libraries, by default it authenticates using **Application Default Credentials**. This is explained in the [Authenticate to GCP Cloud services using client libraries](https://cloud.google.com/docs/authentication/client-libraries) guide. ## Setup GCP Firestore @@ -74,7 +82,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr {{% codetab %}} You can use the GCP Datastore emulator to run locally using the instructions [here](https://cloud.google.com/datastore/docs/tools/datastore-emulator). -You can then interact with the server using `localhost:8081`. +You can then interact with the server using `http://localhost:8432`. {{% /codetab %}} {{% codetab %}} diff --git a/daprdocs/data/components/state_stores/gcp.yaml b/daprdocs/data/components/state_stores/gcp.yaml index bd8fdc9bd..c129ebbf7 100644 --- a/daprdocs/data/components/state_stores/gcp.yaml +++ b/daprdocs/data/components/state_stores/gcp.yaml @@ -1,6 +1,6 @@ - component: GCP Firestore link: setup-firestore - state: Alpha + state: Stable version: v1 since: "1.0" features: