Skip to content

Commit d30724a

Browse files
update Open Source Docs from Roblox internal teams
1 parent 8dc1be0 commit d30724a

File tree

9 files changed

+15773
-13010
lines changed

9 files changed

+15773
-13010
lines changed

content/common/navigation/cloud/guides.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ navigation:
1616
path: /cloud/guides/data-stores/throttling
1717
- title: Assets
1818
path: /cloud/guides/usage-assets
19+
- title: Secrets stores
20+
path: /cloud/guides/secrets-store
1921
- title: User inventories
2022
path: /cloud/guides/inventory
2123
- title: Engine instances

content/common/navigation/cloud/reference.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ navigation:
112112
path: /cloud/api/localization
113113
- title: Publish
114114
path: /cloud/api/publish
115+
- title: Secrets store service
116+
path: /cloud/api/secrets-store
115117
- title: Toolbox service
116118
path: /cloud/api/toolbox-service
117119
- title: Open Cloud v2
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:4f53a5b60e01c8210537057a0f48cd122e76a7b868d35a5e34ed684467da098f
3-
size 211244
2+
oid sha256:a6d434149dbceea91d5cce6864ce40554ce11c12ba18b33d033192de8b32d801
3+
size 264078
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:fdc0c107efb1b394b51b5fe7464e7a806a3f0293e95eb8fa40ed3cf17f87d8ae
3-
size 211244
2+
oid sha256:ff70b05255636a00875a98dcf554dac6d4133fc142ec0b0e1a69d7fc9f30801e
3+
size 262478
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Secrets stores
3+
description: Covers usage for the Secrets store API.
4+
---
5+
6+
In addition to [managing your secrets within experiences](../../cloud-services/secrets.md), you can manage secrets using the Open Cloud secrets store API.
7+
8+
Before using the API, you must [generate an API key](../auth/api-keys.md) with the `secret-store` API system or [configure your OAuth 2.0 app](../auth/oauth2-overview.md) with the `universe.secret` scope type. The examples on this page use API keys.
9+
10+
## Secret encryption
11+
12+
When creating or updating secrets on Roblox, you must encrypt secrets with a [LibSodium sealed box](https://libsodium.gitbook.io/doc/public-key_cryptography/sealed_boxes) and your experience's public key, and then base64-encode the result.
13+
14+
First, get your experience's public key:
15+
16+
```bash
17+
curl --location 'https://apis.roblox.com/cloud/v2/universes/{universeId}/secrets/public-key' \
18+
--request GET \
19+
--header 'x-api-key: <your-secret-here>' \
20+
```
21+
22+
Next, create a sealed box and base64-encode it. The example below uses Python and [PyNaCl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox). (Run `pip install pynacl` to install it locally).
23+
24+
```python
25+
from base64 import b64encode
26+
from nacl import encoding, public
27+
28+
public_key = "Zgj4+V7vSaEZ06rXazKJUIcUnVa95tUNiwXAif/vdHo="
29+
secret_content = "my_api_key_content"
30+
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
31+
sealed_box = public.SealedBox(public_key)
32+
encrypted = sealed_box.encrypt(secret_content.encode("utf-8"))
33+
print(b64encode(encrypted).decode("utf-8"))
34+
```
35+
36+
You can then create or update a secret using the output. This example creates a new secret:
37+
38+
```bash
39+
curl --location 'https://apis.roblox.com/cloud/v2/universes/6930499524/secrets' \
40+
--request POST \
41+
--header 'Content-Type: application/json' \
42+
--header 'x-api-key: <your-secret-here>' \
43+
--data '{
44+
"id": "mySecret",
45+
"secret": "fP9scJkcDk492F4c1VHZ5QS8v2qsAg7uI+NVVEw6zC0GBnj7xpi7UrNr++lCfr4wyq3ia9Uuu+Ao8HtIXz2gRxBX",
46+
"key_id": "1200590785272263122"
47+
}'
48+
```
49+
50+
After you create one, see [Use secrets](../../cloud-services/secrets.md#use-secrets) to use your secret in experience.
51+
52+
## Update secrets
53+
54+
To update the above secret:
55+
56+
```bash
57+
curl --location 'https://apis.roblox.com/cloud/v2/universes/6930499524/secrets/mySecret' \
58+
--request PATCH \
59+
--header 'Content-Type: application/json' \
60+
--header 'x-api-key: <your-secret-here>' \
61+
--data '{
62+
"secret": "2Fczw/PL7woOzHnGHQ65sT0MbzJjEOlfibyKxy374CqzFyEb2QTS8grtNBgG/0sfIvSHEo9JWN+pUr0NTPs0V6lj",
63+
"key_id": "1200590785272263122"
64+
}'
65+
```
66+
67+
If you need to clean up a secret, a deletion request looks like this:
68+
69+
```bash
70+
curl --location 'https://apis.roblox.com/cloud/v2/universes/6930499524/secrets/mySecret' \
71+
--request DELETE \
72+
--header 'Content-Type: application/json' \
73+
--header 'x-api-key: <your-secret-here>'
74+
```

content/en-us/reference/cloud/cloud.docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,13 +2865,13 @@
28652865
"x-roblox-scopes": [
28662866
{
28672867
"description": "Required",
2868-
"name": "memory-store.queue:write"
2868+
"name": "memory-store.queue:add"
28692869
}
28702870
],
28712871
"x-roblox-docs": {
28722872
"category": "Data and memory stores",
28732873
"methodProperties": {
2874-
"scopes": ["memory-store.queue:write"]
2874+
"scopes": ["memory-store.queue:add"]
28752875
},
28762876
"resource": {
28772877
"$ref": "#/components/schemas/MemoryStoreQueueItem",

0 commit comments

Comments
 (0)