From 0e16763cd7bfc73183f2329948f603f4db7b94b1 Mon Sep 17 00:00:00 2001 From: Zane Kharitonov Date: Fri, 6 Dec 2024 14:39:49 -0500 Subject: [PATCH 1/2] Update default storage key --- packages/telegram-cloud-storage-stamper/README.md | 6 +++--- packages/telegram-cloud-storage-stamper/src/index.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/telegram-cloud-storage-stamper/README.md b/packages/telegram-cloud-storage-stamper/README.md index 44bf8d5f..c9c88ad6 100644 --- a/packages/telegram-cloud-storage-stamper/README.md +++ b/packages/telegram-cloud-storage-stamper/README.md @@ -12,7 +12,7 @@ Telegram Bot API >= 6.9 The Telegram Cloud Storage Stamper has a few different modes of operation, namely a classic [stamper](https://docs.turnkey.com/api-overview/stamps) for stamping requests made to Turnkey's API, and an interface for a Telegram Mini App built with Turnkey to interact with Telegram Cloud Storage. This provides the developer of the application utilities such as creating stamps on requests made by users, storing user API keys, storing temporary keys that are needed for decrypting credential bundles for activites like [email auth](https://docs.turnkey.com/features/email-auth) or [oauth](https://docs.turnkey.com/features/oauth), or storing arbitrary values that would be helpful to have saved for a user from session to session on device to device. -The Telegram Cloud Storage Stamper will, by default, store the API key used for signing in Telegram Cloud Storage under the key `@turnkey/TURNKEY_API_KEY`. A Cloud Storage "key" is the index under which a value is stored in Telegram Cloud Storage. This can be changed when using the `.create()` or `.setSigningKey()` functions. An API key is stored within Cloud Storage as a JSON string of the following object: +The Telegram Cloud Storage Stamper will, by default, store the API key used for signing in Telegram Cloud Storage under the key `TURNKEY_API_KEY`. A Cloud Storage "key" is the index under which a value is stored in Telegram Cloud Storage. This can be changed when using the `.create()` or `.setSigningKey()` functions. An API key is stored within Cloud Storage as a JSON string of the following object: ``` { @@ -25,7 +25,7 @@ The Telegram Cloud Storage Stamper will, by default, store the API key used for The `.create()` and `.setSigningKey()` functions take one of the following 4 sets of arguments: -- No arguments: Use an API key at the default location within Telegram Cloud Storage `@turnkey/TURNKEY_API_KEY` and set that as the signing key +- No arguments: Use an API key at the default location within Telegram Cloud Storage `TURNKEY_API_KEY` and set that as the signing key - Just an API key: Store the passed in API key at the default Telegram Cloud Storage location and set that as the signing key - Just a Cloud Storage key: Use an API key stored at the specified Telegram Cloud Storage key location and set that as the signing key - Both an API key and a Cloud Storage key: Store the passed API key at the specified Telegram Cloud Storage key location and set that as the signing key @@ -141,7 +141,7 @@ await stamper.insertAPIKey( ); ``` -Set a new API key as the signing key for the stamper at a specified key. This will also insert the API key to that location within Telegram CloudStorage. Any subsequent requests for stamping will sign with this API key. The API key and CloudStorage key can also be omitted and the API key at the default location `@turnkey/TURNKEY_API_KEY` will be used. If an API key is omitted and a CloudStorage key is specified an API key at that location will be used. Refer to the [argument-usage](#argument-usage) section for a full explanation. A stamper that was originally used to just view Cloud Storage values can later be used for signing by using the `.setSigningKey()` function. +Set a new API key as the signing key for the stamper at a specified key. This will also insert the API key to that location within Telegram CloudStorage. Any subsequent requests for stamping will sign with this API key. The API key and CloudStorage key can also be omitted and the API key at the default location `TURNKEY_API_KEY` will be used. If an API key is omitted and a CloudStorage key is specified an API key at that location will be used. Refer to the [argument-usage](#argument-usage) section for a full explanation. A stamper that was originally used to just view Cloud Storage values can later be used for signing by using the `.setSigningKey()` function. ```ts import TelegramCloudStorageStamper, { diff --git a/packages/telegram-cloud-storage-stamper/src/index.ts b/packages/telegram-cloud-storage-stamper/src/index.ts index e619979b..1466c72f 100644 --- a/packages/telegram-cloud-storage-stamper/src/index.ts +++ b/packages/telegram-cloud-storage-stamper/src/index.ts @@ -23,7 +23,7 @@ export type CloudStorageAPIKey = { }; // Constant for default key name -const DEFAULT_TURNKEY_CLOUD_STORAGE_KEY = "@turnkey/TURNKEY_API_KEY"; +const DEFAULT_TURNKEY_CLOUD_STORAGE_KEY = "TURNKEY_API_KEY"; /** * Stamper to use within a `TurnkeyClient` From 12698d90f5304fd402df40030457fc1845ff036e Mon Sep 17 00:00:00 2001 From: Zane Kharitonov Date: Fri, 6 Dec 2024 14:52:32 -0500 Subject: [PATCH 2/2] Add changeset for package release --- packages/telegram-cloud-storage-stamper/CHANGELOG.md | 6 ++++++ packages/telegram-cloud-storage-stamper/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/telegram-cloud-storage-stamper/CHANGELOG.md b/packages/telegram-cloud-storage-stamper/CHANGELOG.md index cb415c5c..96dc678d 100644 --- a/packages/telegram-cloud-storage-stamper/CHANGELOG.md +++ b/packages/telegram-cloud-storage-stamper/CHANGELOG.md @@ -1,5 +1,11 @@ # @turnkey/telegram-cloud-storage-stamper +## 1.0.1 + +### Patch Changes + +- Update the default cloud storage key to conform to cloud storage key constraints + ## 1.0.0 ### Major Changes diff --git a/packages/telegram-cloud-storage-stamper/package.json b/packages/telegram-cloud-storage-stamper/package.json index 73bd3c95..33cf1612 100644 --- a/packages/telegram-cloud-storage-stamper/package.json +++ b/packages/telegram-cloud-storage-stamper/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/telegram-cloud-storage-stamper", - "version": "1.0.0", + "version": "1.0.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": {