Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update automate-right-to-erasure.md #1004

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 39 additions & 25 deletions content/en-us/cloud/webhooks/automate-right-to-erasure.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ After you add the webhook, use it to configure the bot with the following steps:
</TabItem>

<TabItem label="Discord">

1. Navigate to the [Applications page](https://discord.com/developers/applications).
1. Create a new application and name it to `GDPR Bot`.
1. The system redirects you to the **General Information** settings of the bot. Copy and save its application ID in a secure place.
Expand Down Expand Up @@ -125,20 +126,33 @@ To obtain these identifiers, open the [Creations](https://create.roblox.com/dash

After you finish setting up the webhook, bot, and API key for data stores, add them to the scripts that implement the bot's automation logic. The following example uses Python 3:

1. Install Python libraries using the following commands:
1. Install Python libraries using the following commands:

```bash title="Install Libraries"
pip3 install discord
pip3 install guilded.py==1.8.0
pip3 install requests
pip3 install urllib3==1.26.6
```
<Tabs>
<TabItem label="Guilded">

```bash title="Install Libraries"
pip3 install guilded.py==1.8.0
pip3 install requests
pip3 install urllib3==1.26.6
```

</TabItem>
<TabItem label="Discord">

1. Copy and save the following scripts corresponding to different parts of the bot logic in the same directory:
```bash title="Install Libraries"
pip3 install discord
pip3 install requests
pip3 install urllib3==1.26.6
```

</TabItem>
</Tabs>

1. Copy and save the following scripts corresponding to different parts of the bot logic in the same directory:

```python title="bot_config.py"
DISCORD_BOT_TOKEN = ""
GUILDED_BOT_TOKEN = ""
BOT_TOKEN = ""
OPEN_CLOUD_API_KEY = ""
ROBLOX_WEBHOOK_SECRET = ""

Expand Down Expand Up @@ -237,7 +251,6 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
else:
failures[owned_start_place_id].append((data_store_name, scope, entry_key))
return successes, failures

```

```python title="message_parser.py"
Expand Down Expand Up @@ -369,7 +382,7 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
await message.reply(f"Failed to delete ordered data stores data for " +
f"user ID: {user_id}, data: {dict(failures)}")

client.run(bot_config.GUILDED_BOT_TOKEN)
client.run(bot_config.BOT_TOKEN)

if __name__ == "__main__":
run()
Expand Down Expand Up @@ -422,7 +435,7 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
await message.reply(f"Failed to delete ordered data stores data for " +
f"user ID: {user_id}, data: {dict(failures)}")

client.run(bot_config.DISCORD_BOT_TOKEN)
client.run(bot_config.BOT_TOKEN)

if __name__ == "__main__":
run()
Expand All @@ -431,17 +444,18 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
</TabItem>
</Tabs>

1. On the **bot_config.py** file for main configuration of the bot:
1. On the `bot_config.py` file for main configuration of the bot:

1. Set `BOT_TOKEN` to the token generated by your bot.
2. Set `OPEN_CLOUD_API_KEY` as the API key you created.
3. Set `ROBLOX_WEBHOOK_SECRET` as the secret you set when configuring the webhook on Creator Dashboard.
4. In `STANDARD_DATA_STORE_ENTRIES` and `ORDERED_DATA_STORE_ENTRIES` dictionaries for locating the data store of each record to delete:
1. Add your copied Start Place IDs as keys.
2. Add Universe IDs as the first element of the tuple value.
3. Replace the second element of the tuple with the name, scope, entry key name, and associated User ID of your data stores. If you use a different data schema, modify to match your own data schema accordingly.

1. Set `DISCORD_BOT_TOKEN` or `GUILDED_BOT_TOKEN` to the token generated by your bot.
2. Set `OPEN_CLOUD_API_KEY` as the API key you created.
3. Set `ROBLOX_WEBHOOK_SECRET` as the secret you set when configuring the webhook on Creator Dashboard.
4. In `STANDARD_DATA_STORE_ENTRIES` and `ORDERED_DATA_STORE_ENTRIES` dictionaries for locating the data store of each record to delete:
1. Add your copied Start Place IDs as keys.
1. Add Universe IDs as the first element of the tuple value.
1. Replace the second element of the tuple with the name, scope, entry key name, and associated User ID of your data stores. If you use a different data schema, modify to match your own data schema accordingly.
1. Execute the following command to run the bot:

1. Execute the following command to run the bot:
<Tabs>
<TabItem label="Guilded">

Expand All @@ -459,7 +473,7 @@ After you finish setting up the webhook, bot, and API key for data stores, add t
</TabItem>
</Tabs>

1. The bot then starts to listen and verify Roblox webhooks for right to erasure Requests and calls the Open Cloud endpoint for deleting the corresponding data store.
1. The bot then starts to listen and verify Roblox webhooks for right to erasure Requests and calls the Open Cloud endpoint for deleting the corresponding data store.

<Alert severity="warning">
To ensure constant and secure execution of the scripts, save and run them locally only. Keep your local device or virtual machine running the scripts turned on at all times. In the event that your device goes offline, you need to manually manage any missed messages during the offline period and handle delivery failures according to the [retry policy](../../cloud/webhooks/webhook-notifications.md#delivery-failure-retry-policy).
Expand All @@ -486,10 +500,10 @@ You can create and run a test message to verify that your custom program can pro
}'
```

2. If you have a webhook secret:
1. If you have a webhook secret:
1. Generate a `Roblox-Signature` by applying HMAC-SHA256 encoding to your webhook secret key.
2. Set the current time using UTC timestamp in seconds as `Timestamp`.
3. Put together the `description` in the following format:
1. Put together the `description` in the following format:

```plain title="Description Field Format"
{Timestamp}. You have received a new notification for Right to Erasure for the User Id: {userId} in the game(s) with Ids: {gameIds}`.
Expand Down