driving_consent 0.1.0
driving_consent: ^0.1.0 copied to clipboard
Automotive-grade privacy consent model with Jidoka semantics — UNKNOWN equals DENIED. Per-purpose consent (fleet location, weather telemetry, diagnostics), multi-jurisdiction support (GDPR, CCPA, APPI [...]
driving_consent #
Automotive-grade privacy consent model with Jidoka semantics — UNKNOWN equals DENIED.
Features #
- Jidoka gate:
ConsentStatus.unknownis treated as denied. The pipeline stops itself. - Per-purpose consent: fleet location, weather telemetry, diagnostics — each independently controlled.
- Multi-jurisdiction: GDPR, CCPA, APPI — design for GDPR, deploy everywhere.
- Pluggable storage: abstract
ConsentServiceinterface. Bring your own persistent backend. - Pure Dart: no Flutter dependency. Works in CLI tools, servers, and Flutter apps.
Usage #
import 'package:driving_consent/driving_consent.dart';
final service = InMemoryConsentService();
// Jidoka gate — check before any data leaves the device
final consent = await service.getConsent(ConsentPurpose.fleetLocation);
if (!consent.isEffectivelyGranted) {
// UNKNOWN or DENIED — pipeline stops. No data sent.
return;
}
// Driver explicitly grants consent
await service.grant(ConsentPurpose.fleetLocation, Jurisdiction.appi);
// Driver revokes — pipeline stops again
await service.revoke(ConsentPurpose.fleetLocation);
Implement a persistent service #
class MyPersistentConsentService implements ConsentService {
@override
Future<ConsentRecord> getConsent(ConsentPurpose purpose) async {
// Read from your database
}
@override
Future<List<ConsentRecord>> getAllConsents() async {
// Read all purposes from your database
}
@override
Future<ConsentRecord> grant(
ConsentPurpose purpose,
Jurisdiction jurisdiction,
) async {
// Write granted record + audit trail
}
@override
Future<ConsentRecord> revoke(ConsentPurpose purpose) async {
// Write denied record + audit trail
}
@override
Future<void> dispose() async {
// Close database
}
}
See Also #
- kalman_dr — Dead reckoning through GPS loss (tunnels, urban canyons)
- routing_engine — Engine-agnostic routing (OSRM, Valhalla, local/public)
- driving_weather — Weather condition model for driving (snow, ice, visibility)
All four packages are extracted from SNGNav, a driver-assisting navigation prototype.
License #
BSD-3-Clause — see LICENSE.