2.4 KiB
2.4 KiB
Real VK ID & API Live Smoke Test Runbook
This runbook outlines the live verification steps for testing VK ID OAuth 2.1 and authenticated VK operations without committing credentials into version control or CI.
1. Local Environment Preparation
Set in your .env.local file:
# VK ID Web Application Credentials
VK_APP_ID="<your_vk_app_id>"
VK_CLIENT_SECRET="<your_vk_client_secret>"
# Service Token for Public Operations
VK_SERVICE_TOKEN="<your_vk_service_token>"
# Canonical Local Configuration
APP_BASE_URL="http://localhost:3000"
VK_REDIRECT_URI="http://localhost:3000/api/auth/vk/callback"
# Cryptographic Keys (min 32 chars)
AUTH_SECRET="<random_hex_32_bytes>"
TOKEN_ENCRYPTION_KEY="<random_hex_32_bytes>"
2. Verification Checklist
- A. OAuth Login Start: Visit
/api/auth/vk/start\rightarrowRedirects tohttps://id.vk.com/authorizewith PKCEcode_challenge(S256). - B. OAuth Callback: Authorize on VK screen
\rightarrowRedirected to/api/auth/vk/callback, sets HttpOnly cookierandomayzer_session. - C. Session Inspection: Visit
/api/auth/me\rightarrowReturns authenticated user profile (name, avatar). - D. Public Post Preview: Paste public VK post URL in
/giveaways/new\rightarrowPreview loads withaccessMode: "PUBLIC_SERVICE". - E. Private/Restricted Post Preview: Paste post URL from closed group where organizer is member
\rightarrowResolver falls back toORGANIZER_USER. - F. Create Giveaway: Submit giveaway form
\rightarrowGiveaway created withorganizerId: sessionUser.id. - G. Import Participants: Click Import Participants
\rightarrowLikes and comments fetched viaVkAuthContextResolver. - H. Subscription Verification: Run community subscription filter
\rightarrowBatchgroups.isMemberexecuted successfully. - I. Snapshot Locking: Lock snapshot
\rightarrowCanonical hashes computed. - J. Deterministic Draw: Execute draw
\rightarrowWinner selected via unbiased CSPRNG rejection sampling. - K. Public Audit: Open
/api/giveaways/[id]/verifyin incognito window\rightarrowAudit passes without authentication. - L. Token Expiry & Refresh: Wait for access token expiry or simulate
\rightarrowNext API request automatically triggers server-side refresh without user interruption. - M. Logout: Click logout
\rightarrowSession terminated, cookie destroyed.