native-update 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI-INTEGRATION-GUIDE.md +15 -10
- package/Readme.md +35 -35
- package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +88 -12
- package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +45 -18
- package/dist/esm/definitions.d.ts +8 -0
- package/dist/esm/plugin.js +16 -2
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.js +2 -2
- package/docs/CHANGELOG.md +73 -0
- package/docs/KNOWN_LIMITATIONS.md +2 -2
- package/docs/MIGRATION.md +1 -1
- package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
- package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
- package/package.json +8 -3
- package/docs/AGENTS.md +0 -47
- package/docs/APP_REVIEW_GUIDE.md +0 -768
- package/docs/BUNDLE_SIGNING.md +0 -277
- package/docs/CLAUDE.md +0 -110
- package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
- package/docs/DEPLOY_NOTES.md +0 -116
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
- package/docs/LIVE_UPDATES_GUIDE.md +0 -675
- package/docs/MANUAL-TASKS.md +0 -30
- package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
- package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
- package/docs/PACKAGES.md +0 -167
- package/docs/PERFORMANCE.md +0 -110
- package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
- package/docs/QUICK_START.md +0 -595
- package/docs/README.md +0 -130
- package/docs/REMAINING_FEATURES.md +0 -192
- package/docs/ROADMAP.md +0 -295
- package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
- package/docs/SECURITY.md +0 -356
- package/docs/TESTING_REQUIREMENTS.md +0 -201
- package/docs/ai-knowledge-base/00-project-profile.md +0 -38
- package/docs/ai-knowledge-base/01-features.md +0 -46
- package/docs/ai-knowledge-base/02-routes.md +0 -72
- package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
- package/docs/ai-knowledge-base/README.md +0 -23
- package/docs/analytics-tracking.md +0 -37
- package/docs/api/API.md +0 -558
- package/docs/api/FEATURES.md +0 -414
- package/docs/api/app-review-api.md +0 -239
- package/docs/api/app-update-api.md +0 -154
- package/docs/api/background-update-api.md +0 -170
- package/docs/api/events-api.md +0 -323
- package/docs/api/live-update-api.md +0 -258
- package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
- package/docs/background-updates.md +0 -392
- package/docs/capacitor-official-plugins.md +0 -46
- package/docs/capawesome-plugins.md +0 -29
- package/docs/cli-reference.md +0 -321
- package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
- package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
- package/docs/docs-site/plan.md +0 -201
- package/docs/docs-site/scope.md +0 -127
- package/docs/docs-site/tracker.json +0 -235
- package/docs/error-handling-tracking.md +0 -37
- package/docs/examples/advanced-scenarios.md +0 -394
- package/docs/examples/android-manifest-example.xml +0 -77
- package/docs/examples/basic-usage.md +0 -206
- package/docs/examples/node-express-backend-example.md +0 -28
- package/docs/examples/react-capacitor-example.md +0 -29
- package/docs/features/app-reviews.md +0 -975
- package/docs/features/app-updates.md +0 -785
- package/docs/features/e2e-full-verification/00-overview.md +0 -99
- package/docs/features/e2e-full-verification/00-tracker.json +0 -284
- package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
- package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
- package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
- package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
- package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
- package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
- package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
- package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
- package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
- package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
- package/docs/features/e2e-full-verification/results/route-list.json +0 -1
- package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
- package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
- package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
- package/docs/features/live-updates.md +0 -642
- package/docs/features/queues-and-emails/00-overview.md +0 -41
- package/docs/features/queues-and-emails/00-tracker.json +0 -99
- package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
- package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
- package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
- package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
- package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
- package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
- package/docs/getting-started/configuration.md +0 -469
- package/docs/getting-started/installation.md +0 -300
- package/docs/getting-started/quick-start.md +0 -430
- package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
- package/docs/guides/admin-panel.md +0 -268
- package/docs/guides/channel-management.md +0 -343
- package/docs/guides/dashboard-guide.md +0 -365
- package/docs/guides/deployment-guide.md +0 -335
- package/docs/guides/end-to-end-workflow.md +0 -491
- package/docs/guides/key-management.md +0 -284
- package/docs/guides/migration-from-codepush.md +0 -145
- package/docs/guides/security-best-practices.md +0 -1057
- package/docs/guides/testing-guide.md +0 -346
- package/docs/guides/troubleshooting.md +0 -482
- package/docs/package-audit.md +0 -41
- package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
- package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
- package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
- package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
- package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
- package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
- package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
- package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
- package/docs/play-store/ASO-METADATA.md +0 -5
- package/docs/play-store/DATA-SAFETY.md +0 -5
- package/docs/play-store/DECLARATIONS.md +0 -5
- package/docs/play-store/README.md +0 -27
- package/docs/play-store/RELEASE-NOTES.md +0 -99
- package/docs/play-store/RELEASE-STEPS.md +0 -6
- package/docs/play-store/STORE-LISTING.md +0 -7
- package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
- package/docs/production-readiness.md +0 -475
- package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
- package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
- package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
- package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
- package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
- package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
- package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
- package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
- package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
- package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
- package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
- package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
- package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
- package/docs/project-audit/AUDIT-HISTORY.md +0 -74
- package/docs/project-audit/BATCH-PLAN.md +0 -168
- package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
- package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
- package/docs/project-finalization/00-tracker.json +0 -60
- package/docs/project-knowledge-base/01-system-overview.md +0 -227
- package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
- package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
- package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
- package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
- package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
- package/docs/project-knowledge-base/README.md +0 -103
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
- package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
- package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
- package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
- package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
- package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
- package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
- package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
- package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
- package/docs/reports/FINAL_STATUS.md +0 -122
- package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
- package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
- package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
- package/docs/reports/PRODUCTION_STATUS.md +0 -115
- package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
- package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
- package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
- package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
- package/docs/reports/claude-completion.json +0 -241
- package/docs/rules-tracker.md +0 -102
- package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
- package/docs/security/certificate-pinning.md +0 -122
- package/docs/seo-aeo-rules.json +0 -3043
- package/docs/social-media-marketing/README.md +0 -81
- package/docs/social-media-marketing/posts-batch-01.md +0 -613
- package/docs/social-media-marketing/posts-batch-02.md +0 -528
- package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
- package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
- package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
- package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
- package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
- package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
- package/docs/tracking/full-audit-tracker.json +0 -121
- package/docs/tracking/production-readiness-audit-tracker.json +0 -429
- package/docs/tracking/seo-checklist-tracker.json +0 -333
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
# Phase 02 — UI-less env-gated test-auth endpoint
|
|
2
|
-
|
|
3
|
-
**Executor:** Opus 4.8 subagent · **Working dir:** `backend/`
|
|
4
|
-
**Owner requirements (verbatim intent):** email+password auth for testing ONLY, no UI, only
|
|
5
|
-
`aoneahsan.apps.t1*` emails, URL unique + long so nobody guesses it, password never committed.
|
|
6
|
-
|
|
7
|
-
## Security contract (all five layers required)
|
|
8
|
-
|
|
9
|
-
1. Route **not registered at all** unless `TEST_AUTH_ENABLED=true` (config-gated) → 404 otherwise.
|
|
10
|
-
2. Path contains a 64-hex secret slug from env → unguessable URL.
|
|
11
|
-
3. Email whitelist regex: `^aoneahsan\.apps\.t1(\+[a-z0-9._-]+)?@gmail\.com$` (case-insensitive).
|
|
12
|
-
4. Password verified with `Hash::check()` against `TEST_AUTH_PASSWORD_HASH` (bcrypt in `.env` —
|
|
13
|
-
repo is PRIVATE; plaintext still never stored).
|
|
14
|
-
5. `throttle:5,1` + all failures logged (email only — NEVER the submitted password).
|
|
15
|
-
|
|
16
|
-
## Task 1: Config + env
|
|
17
|
-
|
|
18
|
-
**Files:**
|
|
19
|
-
- Create: `backend/config/testauth.php`
|
|
20
|
-
- Modify: `backend/.env`, `backend/.env.example`
|
|
21
|
-
|
|
22
|
-
`config/testauth.php` (complete):
|
|
23
|
-
```php
|
|
24
|
-
<?php
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* E2E test-only authentication (NO UI). Disabled unless TEST_AUTH_ENABLED
|
|
28
|
-
* is true; the route slug keeps the URL unguessable; only the global
|
|
29
|
-
* automation test accounts (aoneahsan.apps.t1*@gmail.com) may pass. The
|
|
30
|
-
* password is compared against a bcrypt hash — plaintext lives ONLY in
|
|
31
|
-
* ~/.secrets (see ~/.claude/rules/automation-test-accounts.md).
|
|
32
|
-
*/
|
|
33
|
-
return [
|
|
34
|
-
'enabled' => env('TEST_AUTH_ENABLED', false),
|
|
35
|
-
'route_slug' => env('TEST_AUTH_ROUTE_SLUG', ''),
|
|
36
|
-
'password_hash' => env('TEST_AUTH_PASSWORD_HASH', ''),
|
|
37
|
-
'email_pattern' => '/^aoneahsan\.apps\.t1(\+[a-z0-9._-]+)?@gmail\.com$/i',
|
|
38
|
-
];
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Generate the slug + hash WITHOUT echoing the password:
|
|
42
|
-
```bash
|
|
43
|
-
openssl rand -hex 32 # → TEST_AUTH_ROUTE_SLUG value (safe to display)
|
|
44
|
-
# Hash: read plaintext from the global secrets file into php via stdin — never into shell history/output.
|
|
45
|
-
# The password is the LAST non-empty line of the "Password" row in
|
|
46
|
-
# ~/.secrets/test-accounts/automation-accounts.md — extract with grep/sed INSIDE the pipeline:
|
|
47
|
-
grep -o 'A1[^|`]*C0m' ~/.secrets/test-accounts/automation-accounts.md | head -1 | tr -d '\n' \
|
|
48
|
-
| php -r 'echo password_hash(stream_get_contents(STDIN), PASSWORD_BCRYPT), PHP_EOL;'
|
|
49
|
-
```
|
|
50
|
-
Append to `backend/.env` (real values) and `backend/.env.example` (empty values + tags):
|
|
51
|
-
```
|
|
52
|
-
# --- E2E test auth (NO UI — agent-only) -------------------------------------
|
|
53
|
-
TEST_AUTH_ENABLED=true
|
|
54
|
-
# [OPTIONAL] Registers the hidden test-login route when true. Kill-switch: set false.
|
|
55
|
-
TEST_AUTH_ROUTE_SLUG=<64 hex chars>
|
|
56
|
-
# [REQUIRED*] (test auth) Secret path segment — long + unguessable by design.
|
|
57
|
-
TEST_AUTH_PASSWORD_HASH=<bcrypt hash>
|
|
58
|
-
# [REQUIRED*] (test auth) bcrypt hash of the global automation password (plaintext lives in ~/.secrets ONLY).
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Task 2: Controller + route
|
|
62
|
-
|
|
63
|
-
**Files:**
|
|
64
|
-
- Create: `backend/app/Http/Controllers/Auth/TestAuthController.php`
|
|
65
|
-
- Modify: `backend/routes/api.php` (auth prefix group)
|
|
66
|
-
|
|
67
|
-
Controller (complete):
|
|
68
|
-
```php
|
|
69
|
-
<?php
|
|
70
|
-
|
|
71
|
-
namespace App\Http\Controllers\Auth;
|
|
72
|
-
|
|
73
|
-
use App\Http\Controllers\Controller;
|
|
74
|
-
use App\Models\User;
|
|
75
|
-
use Illuminate\Http\JsonResponse;
|
|
76
|
-
use Illuminate\Http\Request;
|
|
77
|
-
use Illuminate\Support\Facades\Hash;
|
|
78
|
-
use Illuminate\Support\Facades\Log;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* E2E-only login (no UI). See config/testauth.php for the gating layers.
|
|
82
|
-
* Mirrors the Socialite flow's outcome: a Sanctum bearer token the SPA
|
|
83
|
-
* consumes via /auth/callback?token=… — so browser automation signs in
|
|
84
|
-
* without Google, and the rest of the stack behaves identically.
|
|
85
|
-
*/
|
|
86
|
-
class TestAuthController extends Controller
|
|
87
|
-
{
|
|
88
|
-
public function login(Request $request): JsonResponse
|
|
89
|
-
{
|
|
90
|
-
$validated = $request->validate([
|
|
91
|
-
'email' => ['required', 'email'],
|
|
92
|
-
'password' => ['required', 'string'],
|
|
93
|
-
]);
|
|
94
|
-
|
|
95
|
-
$email = strtolower($validated['email']);
|
|
96
|
-
|
|
97
|
-
if (!preg_match(config('testauth.email_pattern'), $email)) {
|
|
98
|
-
Log::warning('test-auth: rejected non-whitelisted email', ['email' => $email]);
|
|
99
|
-
return response()->json(['message' => 'Forbidden.'], 403);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
$hash = config('testauth.password_hash');
|
|
103
|
-
if ($hash === '' || !Hash::check($validated['password'], $hash)) {
|
|
104
|
-
Log::warning('test-auth: bad password attempt', ['email' => $email]);
|
|
105
|
-
return response()->json(['message' => 'Unauthenticated.'], 401);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
$user = User::firstOrCreate(
|
|
109
|
-
['email' => $email],
|
|
110
|
-
[
|
|
111
|
-
'name' => 'E2E ' . ucfirst(explode('@', $email)[0]),
|
|
112
|
-
'google_id' => 'test-e2e:' . $email,
|
|
113
|
-
'plan' => 'free',
|
|
114
|
-
]
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
if (!$user->hasAnyRole(['user', 'admin', 'super-admin'])) {
|
|
118
|
-
$user->assignRole('user');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
$token = $user->createToken('test-e2e')->plainTextToken;
|
|
122
|
-
Log::info('test-auth: issued token', ['email' => $email, 'user_id' => $user->id]);
|
|
123
|
-
|
|
124
|
-
return response()->json(['token' => $token, 'user' => $user->only(['id', 'email', 'name'])]);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
Adjust `firstOrCreate` defaults to the REAL users-table columns (check the
|
|
129
|
-
`swap_firebase_for_socialite_on_users` migration first — e.g. `avatar`, nullable google_id, no
|
|
130
|
-
`plan` column if plans live elsewhere). The values above are the intent, not gospel.
|
|
131
|
-
|
|
132
|
-
Route — inside the existing `Route::prefix('auth')` group in `routes/api.php`:
|
|
133
|
-
```php
|
|
134
|
-
if (config('testauth.enabled') && config('testauth.route_slug') !== '') {
|
|
135
|
-
Route::post('/test-e2e/' . config('testauth.route_slug') . '/login', [TestAuthController::class, 'login'])
|
|
136
|
-
->middleware('throttle:5,1')
|
|
137
|
-
->name('auth.test-e2e.login');
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
Route registration depends on config → `php artisan config:cache` note for deploy (phase06 covers it).
|
|
141
|
-
|
|
142
|
-
## Task 3: PHPUnit
|
|
143
|
-
|
|
144
|
-
**Create:** `backend/tests/Feature/TestAuthTest.php` — cases (use `config()->set('testauth.…')` in
|
|
145
|
-
each test; slug `str_repeat('a', 64)` for tests):
|
|
146
|
-
1. disabled → POST returns 404 (route absent; use a fresh app instance / `RefreshApplication`
|
|
147
|
-
pattern — route registration is boot-time, so set env in `phpunit.xml` OFF and enable via
|
|
148
|
-
`Config::set` + `Route::post` re-registration is unreliable: instead test with
|
|
149
|
-
`$this->app['config']` + re-bootstrapped kernel, or accept 404 by hitting the slug path with
|
|
150
|
-
config disabled in a separate test run. Pragmatic approach: keep TEST_AUTH_ENABLED=true in
|
|
151
|
-
`phpunit.xml` <env> with the dummy slug + a bcrypt hash of a dummy test password, and assert
|
|
152
|
-
the DISABLED case by asserting `Route::has('auth.test-e2e.login')` is false when config is off
|
|
153
|
-
in a unit test of the route-registration condition).
|
|
154
|
-
2. non-whitelisted email (`attacker@gmail.com`, `aoneahsan.apps.t2@gmail.com`,
|
|
155
|
-
`xaoneahsan.apps.t1@gmail.com`) → 403.
|
|
156
|
-
3. whitelisted email + wrong password → 401.
|
|
157
|
-
4. whitelisted email + correct dummy password → 200, token present; then
|
|
158
|
-
`getJson('/api/dashboard/me', ['Authorization' => 'Bearer '.$token])` → 200 with same email.
|
|
159
|
-
5. alias emails (`aoneahsan.apps.t1+1@gmail.com`, `+del`) → 200, distinct users created.
|
|
160
|
-
6. throttling: 6th rapid attempt → 429.
|
|
161
|
-
|
|
162
|
-
Never put the REAL password in tests — tests hash their own dummy (`password_hash('dummy-e2e', PASSWORD_BCRYPT)` in setUp).
|
|
163
|
-
|
|
164
|
-
## Task 4: Registry + docs (agent does repo files; Fable does global files at verify)
|
|
165
|
-
|
|
166
|
-
- Append to project `CLAUDE.md` + `AGENTS.md` (compact, in the Auth Stack section): test-auth
|
|
167
|
-
exists, env-gated, email committed OK, **password stored globally — see
|
|
168
|
-
`~/.claude/rules/automation-test-accounts.md`**, kill-switch TEST_AUTH_ENABLED=false.
|
|
169
|
-
- `~/.claude/rules/automation-test-accounts.md` per-project registry row (Fable adds at
|
|
170
|
-
verification — outside repo).
|
|
171
|
-
|
|
172
|
-
## Task 5: Gates + commit
|
|
173
|
-
|
|
174
|
-
`php artisan test` (sqlite) + MySQL parity run → green. ONE commit:
|
|
175
|
-
`feat(backend): env-gated UI-less test-auth endpoint for E2E automation (whitelisted t1 accounts)`.
|
|
176
|
-
Update tracker. Push.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Phase 03 — PHPUnit coverage for EVERY API route + MySQL parity
|
|
2
|
-
|
|
3
|
-
**Executor:** Opus 4.8 subagent · **Working dir:** `backend/`
|
|
4
|
-
**Owner instruction (verbatim):** "test it properly, all API end points make sure all works as best as possible" — explicit authorization to extend the PHPUnit suite to full route coverage.
|
|
5
|
-
|
|
6
|
-
## Task 1: Route inventory → coverage matrix
|
|
7
|
-
|
|
8
|
-
Generate the authoritative list and map to existing tests:
|
|
9
|
-
```bash
|
|
10
|
-
cd backend && php artisan route:list --json > ../docs/features/e2e-full-verification/results/route-list.json
|
|
11
|
-
ls tests/Feature/
|
|
12
|
-
```
|
|
13
|
-
Write `docs/features/e2e-full-verification/results/phase03-coverage-matrix.md` — one row per
|
|
14
|
-
route: `method+path | controller@action | existing test file/case | missing cases`. Existing suite
|
|
15
|
-
(134 tests) already covers: ValidateApiKey middleware, UpdateCheck, BundleUpload, ApiKeys, Apps,
|
|
16
|
-
licenses. Do NOT duplicate — extend.
|
|
17
|
-
|
|
18
|
-
## Task 2: Write the missing feature tests
|
|
19
|
-
|
|
20
|
-
Standard per endpoint (adapt where a case doesn't apply):
|
|
21
|
-
1. **Auth gate** — unauthenticated → 401; wrong-permission role → 403 (spatie `can:` gates).
|
|
22
|
-
2. **Happy path** — 200/201 with `assertJsonPath` on the real response fields the website consumes.
|
|
23
|
-
3. **Failure modes** — validation 422s, not-found 404s, cross-user access 403/404 (IDOR).
|
|
24
|
-
4. **DB side-effects** — `assertDatabaseHas`/`Missing` including EVERY column the action writes
|
|
25
|
-
(the phase01 lesson — thin assertions masked the prod 500).
|
|
26
|
-
|
|
27
|
-
Route groups and the key cases each MUST include:
|
|
28
|
-
|
|
29
|
-
| Group | Routes | Must-cover cases |
|
|
30
|
-
|---|---|---|
|
|
31
|
-
| Health | GET /api/health | 200 shape |
|
|
32
|
-
| Auth | google/redirect | 302 to accounts.google.com with redirect_uri param |
|
|
33
|
-
| Auth | google/callback | mock Socialite (`Socialite::shouldReceive`) — new user created + token redirect; ADMIN_EMAILS auto-promote; suspended user rejected |
|
|
34
|
-
| Test auth | (phase02 file exists) | verify present, don't duplicate |
|
|
35
|
-
| v1 | GET updates/check | valid key happy path; channel switch; platform mismatch; rollout bucketing determinism (same device → same bucket); device activity + analytics rows written **with full column asserts (device_hash 71 chars fits)** |
|
|
36
|
-
| v1 | POST analytics/mau, download, install | 200 + row written; invalid key 401; malformed body 422 |
|
|
37
|
-
| v1 | GET bundles/{build}/download | signed/allowed download flow; archived build 404/410; wrong app's key 403/404 |
|
|
38
|
-
| Dashboard apps | CRUD + stats | (phase01 strengthened create) add: update platform, delete cascades builds/keys, stats shape, cross-user 403/404, free-plan limit 403 |
|
|
39
|
-
| Dashboard builds | index/store/show/update/destroy/promote | upload validation (size/mime), promote flips channel/status + busts `app:{id}:latest-build:{channel}` cache (assert next update-check sees it), cross-user denial |
|
|
40
|
-
| API keys | index/store/revoke/deprecate | plaintext shown once; revoked key fails middleware (cover in integration with v1 check); cross-user denial |
|
|
41
|
-
| Signing keys | index/store/public/rotate/destroy | rotate keeps old verifying? (assert per current SigningKey model behavior); public endpoint shape |
|
|
42
|
-
| Google Drive | status/auth-url/callback/disconnect/builds | disconnected status; auth-url returns Google URL; callback with mocked Google client; disconnect clears tokens |
|
|
43
|
-
| Preferences | GET/PUT | roundtrip persists JSON; invalid payload 422 |
|
|
44
|
-
| Me | GET/DELETE | shape incl. roles/permissions (website AdminRoute depends on it); DELETE removes user + cascades (apps, builds, api keys, tokens revoked) + FilesHub delete called (mock `FilesHubService`) |
|
|
45
|
-
| Analytics dashboard | GET apps/{app}/analytics | aggregates shape with seeded events; empty state |
|
|
46
|
-
| Rollouts | GET /rollouts, PATCH builds/{build}/rollout | percentage clamp 0-100 (422 outside), permission gate |
|
|
47
|
-
| Subscription | index/plans/subscribe/activate/cancel/resume/change-plan/billing-portal | mock PayPal client (`srmklive/paypal`) — NEVER hit live PayPal in tests; plan limits change after activate |
|
|
48
|
-
| Admin | overview/users/updateUser/apps/builds | RequireAdmin blocks `user` role; super-admin passes; updateUser suspend → suspended user's token rejected on next request |
|
|
49
|
-
| Webhooks | (whatever exists at api.php tail — read it) | signature verification rejects bad payloads |
|
|
50
|
-
| Nova/web | /nova/login redirect → /admin/login | 302 + branded page 200 (light) |
|
|
51
|
-
|
|
52
|
-
**Test hygiene:** reuse `TestCase::seedRoles()` + factories; no sleeps; freeze time with
|
|
53
|
-
`$this->travelTo()` where TTLs matter (45s build cache); FilesHub + PayPal + Socialite always
|
|
54
|
-
mocked (`Http::fake`, service container binding) — tests must run offline.
|
|
55
|
-
|
|
56
|
-
## Task 3: MySQL parity + gates + commit
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
php artisan test # sqlite
|
|
60
|
-
DB_CONNECTION=mysql DB_DATABASE=laravel_nativeupdate_test php artisan test # parity — MANDATORY
|
|
61
|
-
```
|
|
62
|
-
Both green. Record final counts in the coverage matrix doc. Update tracker. ONE commit:
|
|
63
|
-
`test(backend): full API route coverage (+MySQL parity run) — every endpoint gated/happy/failure-tested`. Push.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Phase 04 — Frontend + plugin (npm package) ↔ backend contract audit
|
|
2
|
-
|
|
3
|
-
**Executor:** Opus 4.8 subagent · **Working dirs:** `website/`, `src/` (plugin root), `example-apps/react-capacitor/`
|
|
4
|
-
**Goal:** zero silent mismatches between what the backend returns/expects and what the website and
|
|
5
|
-
the published plugin send/read.
|
|
6
|
-
|
|
7
|
-
## Task 1: Website services field-by-field audit
|
|
8
|
-
|
|
9
|
-
For every service in `website/src/services/` (`apps-api-service.ts`, builds, api-keys,
|
|
10
|
-
signing-keys, analytics, rollouts, subscription, admin, me/preferences, google-drive, auth):
|
|
11
|
-
1. List each request payload field + each response field the TS types declare (they use zod/TS
|
|
12
|
-
interfaces).
|
|
13
|
-
2. Diff against the ACTUAL backend controller responses (read the controller code; where phase03
|
|
14
|
-
tests assert shapes, cite the test).
|
|
15
|
-
3. Classify: `missing-in-backend | missing-in-frontend | type-mismatch | naming-drift | ok`.
|
|
16
|
-
4. Fix real mismatches — prefer fixing the WRONG side (whichever diverged from the documented
|
|
17
|
-
contract); when ambiguous, backend response is the contract.
|
|
18
|
-
5. Special checks (known risk spots):
|
|
19
|
-
- `apps` responses now include `bundle_id`/`platform` (phase01) — confirm `AppsPage` create +
|
|
20
|
-
edit, `AppDetailPage`, `AdminAppsPage` render them; the zod schema in `AppsPage.tsx:32`
|
|
21
|
-
matches backend validation (max lengths, `in:ios,android,both`).
|
|
22
|
-
- Error rendering: 422 validation errors surface per-field (RHF `setError` from Laravel's
|
|
23
|
-
`errors` bag), 403 plan-limit shows the friendly message, 500 shows a generic toast — the
|
|
24
|
-
original bug surfaced as a blank "Server Error"; verify the UI now explains failures.
|
|
25
|
-
- `me` response roles/permissions match `website/src/constants/permissions.ts` strings.
|
|
26
|
-
6. Write `docs/features/e2e-full-verification/results/phase04-frontend-contract.md` (table).
|
|
27
|
-
|
|
28
|
-
**Gate:** `cd website && yarn typecheck && yarn lint && yarn build` — all clean.
|
|
29
|
-
|
|
30
|
-
## Task 2: Plugin endpoint matrix (the npm package)
|
|
31
|
-
|
|
32
|
-
Known state (Fable's scan): `src/plugin.ts:384-409` is CORRECT (GET `{serverUrl}/v1/updates/check`
|
|
33
|
-
with `X-API-Key`, `X-Device-ID`, `X-Current-Version`, `X-Platform`, `X-App-Version`). But:
|
|
34
|
-
- `src/background-update/background-scheduler.ts:156` → `GET {serverUrl}/app-version`
|
|
35
|
-
- `src/background-update/background-scheduler.ts:233` → `GET {serverUrl}/updates/latest`
|
|
36
|
-
- `src/live-update/version-manager.ts:140` → `GET {serverUrl}/check`
|
|
37
|
-
- `src/app-update/app-update-checker.ts:47` → audit its URL too
|
|
38
|
-
|
|
39
|
-
**The Laravel backend serves NONE of those paths.** Resolve each:
|
|
40
|
-
1. Build the full matrix: every `fetch(` in `src/` → path, headers, expected response → does
|
|
41
|
-
`routes/api.php` serve it? → which docs page documents it?
|
|
42
|
-
2. Decision rule: if the module is part of the **Laravel-backend flow** (README/docs sell it as
|
|
43
|
-
working with this backend), route it through the `/v1/updates/check` contract (reuse the
|
|
44
|
-
plugin.ts request builder — extract a shared `checkForUpdate(baseUrl, apiKey, …)` helper in
|
|
45
|
-
`src/core/` and call it from background-scheduler + version-manager). If it is a **generic
|
|
46
|
-
custom-backend hook** (user brings their own server), keep the path but document the required
|
|
47
|
-
endpoint contract explicitly in `docs/` + JSDoc, so it's an intentional extension point, not drift.
|
|
48
|
-
3. Analytics: plugin should report download/install to `/v1/analytics/download|install` after
|
|
49
|
-
applying an update if the Laravel backend is configured — check whether any code does; if
|
|
50
|
-
missing, note it in the report and implement ONLY if `docs/` already promises it (no new
|
|
51
|
-
feature invention; owner decides extras later).
|
|
52
|
-
4. Update `src/definitions.ts` JSDoc FIRST for anything changed (documentation-first rule), then
|
|
53
|
-
`web.ts`, then docs pages (`website/src/pages/docs-page/sections/`, `docs/api/`), per the
|
|
54
|
-
Cross-Project Consistency rule in root CLAUDE.md.
|
|
55
|
-
|
|
56
|
-
**Gate:** `yarn build` (plugin root, 0 errors) + `yarn lint` clean.
|
|
57
|
-
|
|
58
|
-
## Task 3: Example app round-trip
|
|
59
|
-
|
|
60
|
-
`example-apps/react-capacitor/`:
|
|
61
|
-
1. Replace the `serverUrl: 'http://localhost:3000'` placeholder in `capacitor.config.ts` with
|
|
62
|
-
`http://localhost:5946/api` + a comment that this is the local Laravel backend and users must
|
|
63
|
-
point it at their own deployment; wire `apiKey` from an env/local config the README explains.
|
|
64
|
-
2. `yarn install && yarn build` — web build passes.
|
|
65
|
-
3. Round-trip proof (curl-level acceptable here; full browser E2E happens in phase05 E2E-16):
|
|
66
|
-
with the local backend up and a seeded app + API key + active build, `curl` the exact request
|
|
67
|
-
plugin.ts constructs → assert `available: true` response parses against `src/types/rollout.ts`.
|
|
68
|
-
|
|
69
|
-
## Task 4: Gates + docs + commit
|
|
70
|
-
|
|
71
|
-
- Plugin root: `yarn build` + `yarn lint` green. Website: typecheck/lint/build green.
|
|
72
|
-
- Results docs saved under `results/`. Tracker updated. ONE commit:
|
|
73
|
-
`fix(plugin+website): contract audit — align plugin modules + website services with Laravel backend`. Push.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Phase 05 — Browser E2E: full feature matrix, multi-user, local
|
|
2
|
-
|
|
3
|
-
**Executor:** Opus 4.8 subagent(s) driving `superpowers-chrome` (`use_browser` MCP, CDP).
|
|
4
|
-
**Venue:** local only (owner decision). Prod smoke is phase06.
|
|
5
|
-
**Evidence:** every row logs PASS/FAIL + a screenshot to
|
|
6
|
-
`docs/features/e2e-full-verification/results/phase05-evidence/` and a summary table in
|
|
7
|
-
`results/phase05-e2e-results.md`.
|
|
8
|
-
|
|
9
|
-
## Environment up (Task 1)
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# 1. MySQL fresh (destructive on LOCAL laravel_nativeupdate only — never prod):
|
|
13
|
-
cd backend && php artisan migrate:fresh --seed --force
|
|
14
|
-
# 2. Backend (background):
|
|
15
|
-
php artisan serve # binds 5946 via SERVER_PORT in .env
|
|
16
|
-
# 3. Frontend (background):
|
|
17
|
-
cd ../website && yarn dev # port 5942, VITE_API_URL=http://localhost:5946/api (verify .env first)
|
|
18
|
-
# 4. Verify: curl http://localhost:5946/api/health → ok; curl -I http://localhost:5942 → 200.
|
|
19
|
-
# 5. Promote the local admin alias:
|
|
20
|
-
cd ../backend && php artisan native-update:role-assign aoneahsan.apps.t1+admin@gmail.com super-admin
|
|
21
|
-
# (account must exist first — hit test-login once for +admin, then assign.)
|
|
22
|
-
```
|
|
23
|
-
Browser profiles (isolation = separate user-data-dirs; Chrome ×2 + Brave as a third engine):
|
|
24
|
-
- Profile A (user 1): Chrome, `--user-data-dir=<scratchpad>/e2e-profile-a`, sign in `t1`
|
|
25
|
-
- Profile B (user 2): Chrome, `--user-data-dir=<scratchpad>/e2e-profile-b`, sign in `t1+1`
|
|
26
|
-
- Profile C (admin): Brave (`/Applications/Brave Browser.app`), sign in `t1+admin`
|
|
27
|
-
Headless by default; sign-in per profile = `POST` test-login (fetch inside the tab or curl) →
|
|
28
|
-
navigate `http://localhost:5942/auth/callback?token=<token>` → expect dashboard shell.
|
|
29
|
-
**NEVER type the password into page JS logs; read it from the global secrets file at runtime and
|
|
30
|
-
pass via JSON.stringify** (per `~/.claude/rules/automation-test-accounts.md`).
|
|
31
|
-
|
|
32
|
-
## The matrix (Task 2) — every row: steps → expected → evidence
|
|
33
|
-
|
|
34
|
-
| ID | Feature | Profile(s) | Steps (condensed — expand sensibly) | Expected |
|
|
35
|
-
|---|---|---|---|---|
|
|
36
|
-
| E2E-01 | Sign-in (test auth) | A | test-login t1 → /auth/callback?token → /dashboard | Shell renders, header shows user, /me 200, no console errors |
|
|
37
|
-
| E2E-02 | Signup page + Google button | A (signed out tab) | /signup, /login render; Google button href → backend redirect URL | Pages render; link points at `${API}/api/auth/google/redirect` (do NOT complete Google) |
|
|
38
|
-
| E2E-03 | Profile management | A | SettingsPage: change every preference field, reload | PUT /preferences 200; values persist after reload (URL-state rules respected) |
|
|
39
|
-
| E2E-04 | Apps CRUD (the fixed bug) | A | Create app `{name:"Aoneahsan Portfolio", bundle_id:"com.aoneahsan.app", platform:"both"}` → edit name+platform → attempt duplicate bundle_id → delete a second app | Create 201 + appears in list (REGRESSION for the prod 500); edit persists; duplicate shows per-field 422 error inline; delete removes + confirm dialog with URL state (`?confirmDelete=`) |
|
|
40
|
-
| E2E-05 | Plan limit | A | Create apps up to free-plan limit + 1 | Friendly 403 message, no crash |
|
|
41
|
-
| E2E-06 | API keys | A | Create key on app → copy plaintext (shown once) → list shows masked → deprecate → revoke | Key visible once; revoked key: `curl /api/v1/updates/check` with it → 401 |
|
|
42
|
-
| E2E-07 | Signing keys | A | Create → view public key → rotate → delete | All 2xx; UI states update |
|
|
43
|
-
| E2E-08 | Build upload + promote | A | UploadPage: upload small test bundle zip → BuildsPage lists it → promote to production → BuildDetailPage | Upload 201 (FilesHub mocked/local per backend config — if FilesHub live key configured, use a tiny file + delete after); promote reflected |
|
|
44
|
-
| E2E-09 | Plugin update-check round-trip | A + curl | With E2E-06 key + E2E-08 build: curl the exact plugin.ts request (headers incl. X-Device-ID) | `available:true`, correct version/downloadUrl/checksum; repeat with same device-id → deterministic |
|
|
45
|
-
| E2E-10 | Rollouts | A | Set build rollout to 25% → curl update-check with ~20 distinct X-Device-IDs | Roughly a quarter get the build (deterministic per device); RolloutsPage shows % |
|
|
46
|
-
| E2E-11 | Analytics | A | After E2E-09/10 + mau/download/install pings: AnalyticsPage + app stats | Rows appear (device_hash writes WORK — regression for yesterday's fix); charts render (D3), MAU count ≥1 |
|
|
47
|
-
| E2E-12 | Google Drive page | A | GoogleDrivePage disconnected state → click connect → auth-url received | Graceful disconnected UI; auth-url points at Google (do NOT complete OAuth); disconnect no-op safe |
|
|
48
|
-
| E2E-13 | Subscription (local) | A | PricingPage/subscription page: plans list; IF PayPal sandbox creds in local .env, subscribe→activate→cancel; else assert plans render + subscribe CTA hits backend and surfaces sandbox-config error gracefully | No live PayPal ever; plan limits reflect activation when sandbox runs |
|
|
49
|
-
| E2E-14 | Multi-user isolation | A + B | B lists apps; B opens A's app by direct URL `/dashboard/apps/<A-id>`; B creates app with A's bundle_id | B sees ONLY own apps; direct access 403/404 page (no data leak); duplicate bundle_id → 422 validation message |
|
|
50
|
-
| E2E-15 | Admin RBAC | C + A + B | C: /admin overview/users/apps/builds pages; C suspends B; B makes any API call; C unsuspends. A (regular): direct /admin URL | C sees both users' data; suspended B gets blocked + UI handles it; A gets denied (guard redirect), /api/admin/* 403 |
|
|
51
|
-
| E2E-16 | Account deletion lifecycle | fresh profile, `t1+del` | test-login +del → create app + key → Settings delete-account flow → confirm | DELETE /me 200; re-login creates FRESH empty account; old token dead (401); apps/keys gone from DB |
|
|
52
|
-
| E2E-17 | Logout + guards + public pages | A | Logout → back-button → deep-link /dashboard/apps; smoke Home/Features/Pricing/Docs/Privacy/Terms/Sitemap/Feed | Token cleared, guards bounce to /login; public pages render, zero console errors, no horizontal scroll at 375px (spot-check) |
|
|
53
|
-
|
|
54
|
-
Execution notes:
|
|
55
|
-
- Drive via CDP; prefer role/label selectors; after each mutation assert BOTH the UI change AND the
|
|
56
|
-
network response (watch fetch in the tab) — UI-only green is not a pass.
|
|
57
|
-
- Console: fail a row on any uncaught error/red console entry (logger rule: no stray console.*).
|
|
58
|
-
- Multi-user rows need the profiles open CONCURRENTLY (real simultaneous sessions).
|
|
59
|
-
- If a row FAILS: capture evidence, root-cause per systematic-debugging, fix (backend/frontend),
|
|
60
|
-
re-run the row AND any dependent rows. Fixes land in the same phase commit.
|
|
61
|
-
|
|
62
|
-
## Task 3: Findings triage
|
|
63
|
-
`results/phase05-e2e-results.md`: matrix table with PASS/FAIL, evidence links, fixes applied
|
|
64
|
-
(file:line), and any deferred items (with reason — only product-decision items may defer).
|
|
65
|
-
|
|
66
|
-
## Task 4: Teardown + commit
|
|
67
|
-
Kill backend serve + vite + all browser instances (verify: `lsof -i :5946 -i :5942` → empty).
|
|
68
|
-
Reset any test data pollution in local DB (fresh-migrate again is fine). Tracker updated. ONE
|
|
69
|
-
commit: `test(e2e): full local browser E2E matrix — results + fixes`. Push.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Phase 06 — Deploy queue + prod smoke re-verification
|
|
2
|
-
|
|
3
|
-
**Executor:** Fable 5 (queue + smoke) + OWNER's server agent (the deploy itself — no SSH from
|
|
4
|
-
this machine). Blocks on the owner between 06.1 and 06.3.
|
|
5
|
-
|
|
6
|
-
## Task 1: Append to `docs/DEPLOY_NOTES.md` → Pending deploy actions
|
|
7
|
-
|
|
8
|
-
One consolidated item (plus KEEP yesterday's still-pending device_hash item — verify it wasn't
|
|
9
|
-
cleared; if still queued, the same deploy covers both):
|
|
10
|
-
|
|
11
|
-
```markdown
|
|
12
|
-
- [ ] **2026-07-XX — E2E-verification batch: apps schema fix + test auth + drift fixes.**
|
|
13
|
-
1. `git pull` + standard cache rebuild (standing notes).
|
|
14
|
-
2. **Run migrations** (`php artisan migrate --force`): adds `apps.bundle_id` + `apps.platform`
|
|
15
|
-
(fixes the 500 on POST /api/dashboard/apps) + any phase01 drift-fix migrations.
|
|
16
|
-
Verify: `SHOW COLUMNS FROM apps LIKE 'bundle_id';` → varchar(191) UNI.
|
|
17
|
-
3. **Set new env vars in the server `.env`** (values in the repo's committed `backend/.env` —
|
|
18
|
-
copy exactly): `TEST_AUTH_ENABLED=true`, `TEST_AUTH_ROUTE_SLUG=…`, `TEST_AUTH_PASSWORD_HASH=…`.
|
|
19
|
-
Then `php artisan config:cache` (route registration is config-dependent) + restart PHP-FPM.
|
|
20
|
-
4. Verify test auth: POST /api/auth/test-e2e/<slug>/login with a WRONG password → 401 JSON
|
|
21
|
-
(proves route live without exposing anything).
|
|
22
|
-
5. Leave the smoke to the local agent (it will run the prod smoke below and report).
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Task 2 (OWNER): run the server deploy agent
|
|
26
|
-
`awaitingUser: true`. The server agent reads DEPLOY_NOTES first (standing rule), applies, clears
|
|
27
|
-
the queue items it completed, commits.
|
|
28
|
-
|
|
29
|
-
## Task 3: Fable prod smoke (after owner confirms deploy)
|
|
30
|
-
|
|
31
|
-
All via curl + one headless browser pass against https://nativeupdate.aoneahsan.com:
|
|
32
|
-
1. `GET /api/health` → ok.
|
|
33
|
-
2. Test-login `t1` (password read from `~/.secrets/…` at runtime, never echoed) → token.
|
|
34
|
-
3. Browser: `/auth/callback?token=…` → dashboard renders.
|
|
35
|
-
4. **THE bug:** create app `{name, bundle_id, platform:'both'}` → 201 + appears in list.
|
|
36
|
-
5. Create API key → `GET /api/v1/updates/check` with it → 200 `{available:false}` (no build yet).
|
|
37
|
-
6. `POST /api/v1/analytics/mau` ping with the key → then confirm MAU/stat reflects (also closes
|
|
38
|
-
yesterday's device_hash smoke that DEPLOY_NOTES asked for).
|
|
39
|
-
7. Preferences roundtrip; logout; token revoked check (reuse → 401).
|
|
40
|
-
8. **Cleanup:** delete the created app + key (keep the t1 user for future runs). Prod left clean.
|
|
41
|
-
9. PayPal: `GET /subscription/plans` read-only ONLY.
|
|
42
|
-
|
|
43
|
-
Record results in `results/phase06-prod-smoke.md`. Any failure → root-cause → fix → re-queue →
|
|
44
|
-
repeat (tracker rows re-open).
|
|
45
|
-
|
|
46
|
-
## Task 4: Close out
|
|
47
|
-
- `docs/MANUAL-TASKS.md`: mark the deploy row done (owner) / add anything left.
|
|
48
|
-
- Tracker: all phases complete + runHistory; bump `lastUpdated`.
|
|
49
|
-
- Root `CLAUDE.md` + `AGENTS.md`: Auth Stack section gains the one-line test-auth record +
|
|
50
|
-
pointer here; bump Last Updated.
|
|
51
|
-
- Final commit + push.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Phase 01 — Schema ↔ Code Drift Audit Report
|
|
2
|
-
|
|
3
|
-
**Date:** 2026-07-10 · **Executor:** Opus 4.8 · **Engine of record:** MySQL 8.4.10 (`strict => true`)
|
|
4
|
-
|
|
5
|
-
**Method:** fresh-migrated `laravel_nativeupdate_audit` on real MySQL, dumped every column via
|
|
6
|
-
`information_schema`, then cross-checked each model's `$fillable`/`casts()`/queried columns, every
|
|
7
|
-
FormRequest + inline `validate()` `unique:`/`exists:`/`in:` rule, every Nova resource field, and every
|
|
8
|
-
enum/hash/token column type against the dump. Gate: full PHPUnit suite green on **sqlite AND MySQL**
|
|
9
|
-
(the MySQL parity run is what surfaces truncation/enum bugs sqlite's DQS quirk hides).
|
|
10
|
-
|
|
11
|
-
## Summary
|
|
12
|
-
|
|
13
|
-
| Severity | Count | Fixed in phase01 | Deferred (adjacent, non-schema) |
|
|
14
|
-
|---|---|---|---|
|
|
15
|
-
| CRITICAL | 1 | 1 | 0 |
|
|
16
|
-
| HIGH | 2 | 2 | 1 |
|
|
17
|
-
| MEDIUM | 1 | 1 | 1 |
|
|
18
|
-
| LOW / documented | 3 | 1 | 2 |
|
|
19
|
-
|
|
20
|
-
**4 real schema↔code drifts fixed** (all were latent MySQL-strict failures masked by sqlite). **3
|
|
21
|
-
adjacent non-schema findings documented** for later phases. No further schema drift exists after the
|
|
22
|
-
fixes — every fillable/cast/validation-rule/Nova-field column is present in the migrated MySQL schema
|
|
23
|
-
with a type that fits what the code writes.
|
|
24
|
-
|
|
25
|
-
## Findings
|
|
26
|
-
|
|
27
|
-
| # | Location (file:line) | Code reference | Schema reality (pre-fix) | Severity | Fix |
|
|
28
|
-
|---|---|---|---|---|---|
|
|
29
|
-
| 1 | `create_apps_table` + `StoreAppRequest:25`, `AppController::store:43-48`, website `AppsPage/AppDetailPage/AdminAppsPage` | writes/validates `apps.bundle_id` (unique) + `apps.platform` | **columns did not exist** → `POST /api/dashboard/apps` 500 on prod (Unknown column) | **CRITICAL** | New migration `2026_07_10_000010` adds `bundle_id VARCHAR(191) UNIQUE NULL` + `platform VARCHAR(20) NOT NULL DEFAULT 'both'`, backfills legacy package-style `app_id`→`bundle_id`, dedups cross-user collisions before the unique index. `App::$fillable` + `AppFactory` updated (`app_id`→UUID). |
|
|
30
|
-
| 2 | `RolloutController::update:70` | `$build->status = 'paused'` on pause | `builds.status` enum = `(uploading,processing,active,archived,failed)` — **no `paused`** → every rollout pause 500'd on MySQL strict | **HIGH** | New migration `2026_07_10_000011` adds `'paused'` to the enum (additive; every read filters `status='active'`, so a paused build is correctly never served). Nova Build status badge maps `paused`→warning. |
|
|
31
|
-
| 3 | `UpdateController::check:29` | `$platform = header('X-Platform', 'all')` then written to `device_activities.platform` + `analytics_events.platform` via deferred writes | both enums = `(ios,android,web)` **nullable** — `'all'` is out-of-enum → MySQL strict silently dropped every deferred MAU/analytics write when a client omitted the header | **HIGH** | **Code fix** (cleaner than widening 2 enums, behavior-identical): default to `null` (unknown device platform), matching `AnalyticsController::mauPing`. `isEligibleForDevice()` callsite passes `?? 'all'` to hold its `string` contract (param is unused). Update-check eligibility/compat responses unchanged. |
|
|
32
|
-
| 4 | `AdminController::updateUser:51` | `'plan' => 'nullable\|in:free,pro,enterprise,beta'` | `users.plan` enum = `(free,pro,enterprise)` — **no `beta`**; `'beta'` unsupported in `getPlanLimits`/Nova/PayPal → admin update with `beta` would truncate-error on strict | **MEDIUM** | **Code fix**: removed `beta` from the `in:` rule. Also reconciled `MeController:30` read-side default `?? 'beta'` → `?? 'free'` so no phantom `beta` plan remains anywhere. |
|
|
33
|
-
| 5 | `AnalyticsDashboardController::show:58-63` | buckets on `event_type` values `'download'`/`'install'`/`'error'` | real enum values are `download_start/download_complete/install_complete/...` — the compared strings **never exist**, so every event hits `default => continue` and the dashboard totals are **always zero** | **HIGH (adjacent, non-schema)** | **Deferred to phase03/05.** Not a schema drift (column + values are valid enum members); it's a read-side value mismatch requiring a product decision on which lifecycle event counts as a "download"/"install". Flagged, not guess-fixed. |
|
|
34
|
-
| 6 | `RolloutController::index:24` | lists rollouts `where('status','active')` | after finding #2's fix, a paused build has `status='paused'` and is **excluded from the rollout list** → the UI can pause but then can't see/resume it | **MEDIUM (adjacent, non-schema)** | **Deferred to phase05** (browser E2E of rollout pause/resume). Note for the fix: `index` should include `status IN ('active','paused')`. |
|
|
35
|
-
| 7 | `Build::deleteStoredFile:91` | deletes from FilesHub only when `storage_provider === 'fileshub'` | `BuildController::store:113` writes `storage_provider = 'drive'` (valid enum), never `'fileshub'` → the model `deleting` hook's FilesHub cleanup is a no-op | **LOW (adjacent, non-schema)** | **Deferred.** Not schema drift; `BuildController::destroy` deletes the FilesHub object directly, so the destroy path still cleans up. Cascade deletes (app/user) rely on the hook and would orphan FilesHub files — worth reconciling in a later phase. |
|
|
36
|
-
| 8 | `api_keys.key_hash`, `signing_keys.key_id`, `builds.checksum` (all VARCHAR(64)); `Build` doc mentions SHA-384/512 | code writes SHA-256 (64 hex) + hardcodes `checksum_algorithm='SHA-256'` | VARCHAR(64) — **exact fit** for SHA-256; a future switch to SHA-384 (96) / SHA-512 (128) would truncate | **LOW (documented)** | No change needed today (nothing writes >64). Recorded so any future checksum/hash-algorithm change widens these columns first. |
|
|
37
|
-
|
|
38
|
-
## Columns verified clean (no drift)
|
|
39
|
-
|
|
40
|
-
- **users**: `google_id(64)`, `avatar_url`, `preferences(json)`, `google_drive_token`, admin-control + license columns — all present; `plan` correctly NOT fillable (mass-assignment guard).
|
|
41
|
-
- **builds**: `bundle_id char(36)`=UUID(36) exact; `platform enum(...,all)` already includes `all`; `storage_provider enum(...,drive)` matches the written `'drive'`; `channel`, `event`/counter columns all present.
|
|
42
|
-
- **analytics_events / device_activities**: `device_hash VARCHAR(191)` (71 written) — the 2026-07-09 fix holds; `event_type` enum covers every value `AnalyticsEvent::record` writes.
|
|
43
|
-
- **subscriptions / subscription_items**: provider-agnostic columns present; legacy `stripe_*` nullable and unreferenced by models. (No `SubscriptionItem` model exists — the `subscription_items` table is write-only legacy; nothing to audit there.)
|
|
44
|
-
- **Nova resources** (App, Build, ApiKey, SigningKey, User): every field attribute maps to a real column. Fixed the App resource's stale `app_id` "Bundle identifier" help + added real `bundle_id`/`platform` fields.
|
|
45
|
-
|
|
46
|
-
## Gate results
|
|
47
|
-
|
|
48
|
-
- `php artisan test` (sqlite `:memory:`): **143 passed, 338 assertions**.
|
|
49
|
-
- `DB_CONNECTION=mysql DB_DATABASE=laravel_nativeupdate_test php artisan test` (MySQL 8.4 strict): **143 passed, 338 assertions**.
|
|
50
|
-
- Baseline was 134; +9 new tests: duplicate-`bundle_id` 422, no-`X-Platform` null-platform regression, RolloutController pause/resume/percentage/isolation (4), AdminController beta-reject/valid-plan/non-admin (3).
|