[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge branch 'next' into @invertase/@jwerner08/gcp-option
Browse files Browse the repository at this point in the history
  • Loading branch information
jauntybrain committed Jan 24, 2024
2 parents ee606cb + 513d14e commit aa59b75
Show file tree
Hide file tree
Showing 35 changed files with 2,749 additions and 1,461 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package.json
extension.yaml
package-lock.json

**/node_modules/**
Expand Down
13 changes: 7 additions & 6 deletions auth-mailchimp-sync/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ billingRequired: true

roles:
- role: firebaseauth.viewer
reason: Allows the extension to read existing users while handling lifecycle events.
reason:
Allows the extension to read existing users while handling lifecycle
events.

resources:
- name: addUserToList
Expand All @@ -68,11 +70,10 @@ resources:
eventTrigger:
eventType: providers/firebase.auth/eventTypes/user.delete
resource: projects/${param:PROJECT_ID}

- name: addExistingUsersToList
type: firebaseextensions.v1beta.function
description:
Adds existing users into the specified Mailchimp audience.
description: Adds existing users into the specified Mailchimp audience.
properties:
runtime: nodejs18
taskQueueTrigger: {}
Expand Down Expand Up @@ -117,7 +118,8 @@ params:
- param: DO_BACKFILL
label: Import existing users into Mailchimp audience
description: >-
Do you want to add existing users to the Mailchimp audience when you install or update this extension?
Do you want to add existing users to the Mailchimp audience when you
install or update this extension?
type: select
required: true
options:
Expand All @@ -126,7 +128,6 @@ params:
- label: No
value: false


lifecycleEvents:
onInstall:
function: addExistingUsersToList
Expand Down
202 changes: 102 additions & 100 deletions auth-mailchimp-sync/functions/package-lock.json

Large diffs are not rendered by default.

79 changes: 53 additions & 26 deletions delete-user-data/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ roles:
- role: storage.admin
reason: Allows the extension to delete (user) data from Cloud Storage.
- role: pubsub.admin
reason: Allows the extension to publish and subscribe to PubSub events. The extension uses PubSub to parallelize deletion and data discovery, no PubSub data is deleted.
reason:
Allows the extension to publish and subscribe to PubSub events. The
extension uses PubSub to parallelize deletion and data discovery, no
PubSub data is deleted.

resources:
- name: clearData
Expand Down Expand Up @@ -86,14 +89,15 @@ params:
- param: FIRESTORE_PATHS
label: Cloud Firestore paths
description: >-
Which paths in your Cloud Firestore instance contain data keyed on a user ID? Leave
empty if you don't use Cloud Firestore.
Which paths in your Cloud Firestore instance contain data keyed on a user
ID? Leave empty if you don't use Cloud Firestore.
Enter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID.
Enter the full paths, separated by commas. Use `{UID}` as a placeholder
for the user's UID.
For example, if you have the collections `users` and `admins`, and each
collection has documents with User ID as document IDs, then enter
`users/{UID},admins/{UID}`.
For example, if you have the collections `users` and `admins`, and each
collection has documents with User ID as document IDs, then enter
`users/{UID},admins/{UID}`.
type: string
example: users/{UID},admins/{UID}
required: false
Expand All @@ -116,17 +120,22 @@ params:
- param: SELECTED_DATABASE_INSTANCE
label: Realtime Database instance
description: >
What is the ID of the Realtime Database instance from which you want to delete user data (keyed on user ID)?
What is the ID of the Realtime Database instance from which you want to
delete user data (keyed on user ID)?
type: string
example: my-instance
validationRegex: ^[^\.\$\#\]\[\/\x00-\x1F\x7F]+$
validationErrorMessage: Invalid database instance. Make sure that you have entered just the instance ID, and not the entire database URL.
validationErrorMessage:
Invalid database instance. Make sure that you have entered just the
instance ID, and not the entire database URL.
required: false

- param: SELECTED_DATABASE_LOCATION
label: Realtime Database location
description: >
(Only applicable if you provided the `Realtime Database instance` parameter.) From which Realtime Database location do you want to delete data keyed on a user ID?
(Only applicable if you provided the `Realtime Database instance`
parameter.) From which Realtime Database location do you want to delete
data keyed on a user ID?
type: select
options:
- label: United States
Expand All @@ -141,12 +150,13 @@ params:
- param: RTDB_PATHS
label: Realtime Database paths
description: >-
Which paths in your Realtime Database instance contain data keyed on a user ID? Leave
empty if you don't use Realtime Database.
Which paths in your Realtime Database instance contain data keyed on a
user ID? Leave empty if you don't use Realtime Database.
Enter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID.
Enter the full paths, separated by commas. Use `{UID}` as a placeholder
for the user's UID.
For example: `users/{UID},admins/{UID}`.
For example: `users/{UID},admins/{UID}`.
type: string
example: users/{UID},admins/{UID}
Expand All @@ -155,7 +165,7 @@ params:
- param: CLOUD_STORAGE_BUCKET
label: Cloud Storage bucket
description: >
Which Google Cloud Storage bucket do you want to delete files from?
Which Google Cloud Storage bucket do you want to delete files from?
type: string
example: my-project-12345.appspot.com
validationRegex: ^([0-9a-z_.-]*)$
Expand All @@ -166,8 +176,8 @@ params:
- param: STORAGE_PATHS
label: Cloud Storage paths
description: >-
Where in Google Cloud Storage do you store data keyed on a user ID? Leave empty if you
don't use Cloud Storage.
Where in Google Cloud Storage do you store data keyed on a user ID? Leave
empty if you don't use Cloud Storage.
Enter the full paths to files or directories in your Storage buckets,
separated by commas. Use `{UID}` to represent the User ID of the deleted
Expand All @@ -177,8 +187,8 @@ params:
bucket with the file naming scheme `{UID}-pic.png`, enter
`{DEFAULT}/{UID}-pic.png`. To also delete all the files in another bucket
called my-app-logs with the file naming scheme `{UID}-logs.txt`, enter
`{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt`. To *also* delete a User
ID-labeled directory and all its files (like `media/{UID}`), enter
`{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt`. To *also* delete a
User ID-labeled directory and all its files (like `media/{UID}`), enter
`{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt,{DEFAULT}/media/{UID}`.
type: string
example: "{DEFAULT}/{UID}-pic.png,my-awesome-app-logs/{UID}-logs.txt"
Expand All @@ -187,7 +197,8 @@ params:
- param: ENABLE_AUTO_DISCOVERY
label: Enable auto discovery
description: >-
Enable the extension to automatically discover Firestore collections and documents to delete.
Enable the extension to automatically discover Firestore collections and
documents to delete.
type: select
options:
- label: Yes
Expand All @@ -200,7 +211,10 @@ params:
- param: AUTO_DISCOVERY_SEARCH_DEPTH
label: Auto discovery search depth
description: >-
If auto discovery is enabled, how deep should auto discovery find collections and documents. For example, setting to `1` would only discover root collections and documents, whereas setting to `9` would search sub-collections 9 levels deep. Defaults to `3`.
If auto discovery is enabled, how deep should auto discovery find
collections and documents. For example, setting to `1` would only discover
root collections and documents, whereas setting to `9` would search
sub-collections 9 levels deep. Defaults to `3`.
validation: ^[0-9]
type: string
default: 3
Expand All @@ -209,25 +223,38 @@ params:
- param: AUTO_DISCOVERY_SEARCH_FIELDS
label: Auto discovery search fields
description: >-
If auto discovery is enabled, specify what document fields are used to associate the UID with the document. The extension will delete documents where the value for one or more of these fields matches the deleting user’s UID. If left empty, document fields will not be used in auto discovery.
If auto discovery is enabled, specify what document fields are used to
associate the UID with the document. The extension will delete documents
where the value for one or more of these fields matches the deleting
user’s UID. If left empty, document fields will not be used in auto
discovery.
type: string
default: "id,uid,userId"
required: false

- param: SEARCH_FUNCTION
label: Search function URL
description: >-
Specify a URL to call that will return a list of document paths to delete. The extension will send a `POST` request to the specified `URL`, with the `uid` of the deleted user will be provided in the body of the request. The endpoint specified should return an array of firestore paths to delete.
Specify a URL to call that will return a list of document paths to delete.
The extension will send a `POST` request to the specified `URL`, with the
`uid` of the deleted user will be provided in the body of the request. The
endpoint specified should return an array of firestore paths to delete.
example: https://us-west1-my-project-id.cloudfunctions.net/myTransformFunction
type: string
required: false

events:
- type: firebase.extensions.delete-user-data.v1.firestore
description: Occurs when a set of Firestore paths has been marked for deletion following a delete user trigger.
description:
Occurs when a set of Firestore paths has been marked for deletion
following a delete user trigger.

- type: firebase.extensions.delete-user-data.v1.database
description: Occurs when a set of Realtime Database paths has been marked for deletion following a delete user trigger.
description:
Occurs when a set of Realtime Database paths has been marked for deletion
following a delete user trigger.

- type: firebase.extensions.delete-user-data.v1.storage
description: Occurs when a set of Storage paths has been marked for deletion following a delete user trigger.
description:
Occurs when a set of Storage paths has been marked for deletion following
a delete user trigger.
Loading

0 comments on commit aa59b75

Please sign in to comment.