Security Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
The security architecture of Driveway Estimator Pro is designed to protect user data, ensure secure sharing of estimates with contractors, and maintain the integrity of mobile-native operations. The system employs a combination of OAuth-based authentication, role-based access control (RBAC), and tokenized public sharing to balance accessibility with data protection.
This guide outlines the security protocols implemented across the frontend, backend, and native mobile environments. It covers authentication flows, sensitive data handling in logs, and the versioning policy for security updates.
Authentication and Identity Management
The application leverages an external OAuth provider for identity management, minimizing the risk of storing plaintext credentials. User identities are anchored to a unique openId provided by the Manus OAuth server.
Authentication Flow
The system uses JSON Web Tokens (JWT) for session management. Environment variables like JWT_SECRET and OAUTH_SERVER_URL configure the backend to validate incoming requests.
Access Control and Sharing
Project data is restricted by default to the owner (userId). However, the system provides a controlled sharing mechanism for contractors via non-sequential, unique tokens.
Role-Based Access Control (RBAC)
The database schema defines a role enum to distinguish between standard users and administrators.
- User: Can create, read, update, and delete their own projects.
- Admin: Elevated privileges for system management.
Tokenized Project Sharing
Sharing is implemented through the projectShares table, which decouples project IDs from public-facing URLs.
- A unique
shareTokenis generated for a project. - The token allows public, read-only access to a specific estimate summary.
- Optional expiration dates and view counts can be enforced via the schema.
| Table | Field | Security Purpose |
|---|---|---|
users | openId | Unique OAuth identifier; prevents account collision. |
projects | userId | Foreign key to enforce ownership boundaries. |
projectShares | shareToken | Obfuscates project IDs; provides secure public access. |
Sources: drizzle/schema.ts:24-80, client/src/pages/ProjectDetail.tsx:28-44, todo.md:14-19
Mobile and Hardware Security
The mobile implementation via Capacitor requires explicit user consent for hardware access. Permissions are strictly scoped to the functionality required for driveway measurement.
Native Permissions
| Platform | Permission Key | Usage Description |
|---|---|---|
| iOS | NSCameraUsageDescription | Required to capture driveway photos for AI edge detection. |
| iOS | NSLocationWhenInUseUsageDescription | Required to fetch local material pricing via ZIP code. |
| Android | CAMERA | Standard permission for photo capture. |
| Android | ACCESS_FINE_LOCATION | Precise GPS access for regional price accuracy. |
Sources: MOBILE_BUILD.md:166-180, README.md:46-51
Sensitive Data Handling and Logging
To facilitate debugging without compromising privacy, the application includes a debug-collector that automatically redacts sensitive information before transmitting logs to the server.
Automated Redaction
The collector monitors console logs, network requests (Fetch/XHR), and UI events. It uses a blacklist to mask values associated with the following fields:
password,token,secret,keyauthorization,cookie,session
// Example of redaction logic in the debug collector
var isSensitive = CONFIG.sensitiveFields.some(function (f) {
return k.toLowerCase().indexOf(f) !== -1;
});
if (isSensitive) {
sanitized[k] = "[REDACTED]";
}
Sources: client/public/manus/debug-collector.js:33-41, client/public/manus/debug-collector.js:93-108
Vulnerability Management and Lifecycle
The project maintains a structured support window for security updates. Users are encouraged to report vulnerabilities through official channels defined in the security policy.
Supported Versions
| Version | Security Support Status |
|---|---|
| 5.1.x | ✅ Supported |
| 5.0.x | ❌ End of Life |
| 4.0.x | ✅ Supported |
| < 4.0 | ❌ End of Life |
Reporting a Vulnerability
Vulnerabilities should be reported directly to the maintainers. The project does not currently specify a public bug bounty, but it maintains an active response policy for accepted reports.
Sources: SECURITY.md:1-24
Summary
The security of Driveway Estimator Pro is centered on verified identity via OAuth, scoped access through owner-linked project records, and secure sharing via randomized tokens. Mobile-native security is managed through platform-standard permission prompts, while diagnostic logging is safeguarded by an automated redaction system. Adherence to supported version tracks is critical for maintaining a secure deployment.