rc-security
БесплатноБез исполняемых скриптовНе проверенUse this skill when hardening a RevenueCat integration on Android. Covers Trusted Entitlements response verification (INFORMATIONAL, the default since SDK…
от RevenueCat★ 80 звёзд на GitHubОб этом скилле
Phase 0: Intent
Tell the user: "I will review your RevenueCat security posture on Android: verification mode, API keys, user identity, and server side access decisions."
Phase 1: Discovery
Confirm what RevenueCat already covers so you can focus on the real gaps.
| Concern | Who handles it | How |
|---|---|---|
| Receipt validation against Google Play | RevenueCat backend | Runs before awaitPurchase() returns |
| Purchase token reuse | RevenueCat backend | Tokens are deduplicated server side |
| Fabricated purchase tokens | RevenueCat backend | Fails Google Play verification, no entitlement granted |
| HTTPS transport to RevenueCat | SDK | Always on |
| Retry of token post on network failure | SDK | Retries on next app launch |
Ask the project these questions:
- Is
EntitlementVerificationModeexplicitly set toDISABLED? (The default since SDK 8.11.0 isINFORMATIONAL.) Does the app readcustomerInfo.entitlements.verificationand act onFAILED? - Is the SDK configured with the public Android key (starts with
goog_) or has someone accidentally pasted the secret key into the client? - Are real users identified with
Purchases.logIn(yourUserId), or is the app still relying on anonymous$RCAnonymousID:...? - Do server endpoints that serve premium content verify entitlement server side, or do they trust a client sent flag?
Phase 2: Plan
Decide each of the following before changing code.
Decision A: Entitlement verification mode
| Mode | Failed verification does what | Pick when |
|---|---|---|
DISABLED |
No signing happens | Only if you explicitly opt out |
INFORMATIONAL (default since SDK 8.11.0) |
Logged in verification, access still granted |
Act on VerificationResult.FAILED yourself if you need to deny access |
The SDK has no enforced mode (none in 10.x, none through 11.1.0); see 3.1 below for gating on the result yourself.
Decision B: Where is the authority?
Even with Trusted Entitlements (INFORMATIONAL), the client is not the authority for paid content. Decide whether each premium endpoint:
- Calls the RevenueCat REST API per request, or
- Reads entitlements your webhook handler stores, with their expiry (see
rc-webhooks).
Option 2 is cheaper at request time, option 1 has no cache staleness. Pick one, document it, do not mix per endpoint without a reason.
Decision C: User identity
If the app is in production, plan to call Purchases.logIn("your_user_id") with your own authenticated user id. Anonymous ids are device scoped identifiers, not credentials, and are shared across users of the same device.
Phase 3: Execute
3.1 Turn on response verification
Add the mode to PurchasesConfiguration:
PurchasesConfiguration.Builder(context, apiKey)
.entitlementVerificationMode(EntitlementVerificationMode.INFORMATIONAL)
.build()
Read the verification result when you inspect entitlements:
when (customerInfo.entitlements.verification) {
VerificationResult.VERIFIED -> { /* response is authentic */ }
VerificationResult.FAILED -> { /* possible tampering, log and alert */ }
VerificationResult.NOT_REQUESTED -> { /* verification disabled */ }
VerificationResult.VERIFIED_ON_DEVICE -> { /* verified locally */ }
}
There is no enforced mode through SDK 11.1.0: FAILED is informational and never blocks access by itself. To enforce, gate on the result yourself:
val trusted = customerInfo.entitlements.verification != VerificationResult.FAILED
val hasPro = trusted && customerInfo.entitlements["pro"]?.isActive == true
3.2 Keep API keys in the right place
| Key | Where it lives | What it can do |
|---|---|---|
Public Android SDK key (goog_...) |
Embedded in the app binary | Read and purchase for the calling user only |
| Secret REST API key | Your server, secret manager or env var | Full REST API, admin operations, grant entitlements |
In Android code, only the public key appears:
Purchases.configure(
PurchasesConfiguration.Builder(context, "goog_PUBLIC_android_sdk_key").build()
)
Never commit the secret key to the app repo. Grep the Android source tree for the secret key prefix and confirm zero hits before release.
3.3 Identify real users
Call logIn as soon as you have an authenticated user id:
val result = Purchases.sharedInstance.awaitLogIn("your_user_id")
val customerInfo = result.customerInfo
Do not rely on the anonymous id as a credential. It is a device scoped identifier and does not protect purchase history on shared devices.
3.4 Enforce on the server, not on the client
Even with Trusted Entitlements (INFORMATIONAL) on the client, every server endpoint that serves paid content checks entitlement server side:
def get_premium_content(user_id):
body = revenuecat_get(f"/v1/subscribers/{user_id}") # secret key, no X-Platform
ent = body["subscriber"]["entitlements"].get("pro")
exp = ent and ent["exp
Установить rc-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rc-security?
Use this skill when hardening a RevenueCat integration on Android. Covers Trusted Entitlements response verification (INFORMATIONAL, the default since SDK 8.11.0), why the server is always the authority, API key hygiene (public SDK key vs secret REST key), anonymous user identity, and purchase token protections RevenueCat provides automatically.
Как установить скилл rc-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rc-security запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic