Warranty phase 2: real Dell provider + settings UI + PC hero badge

- DellProvider: real Dell TechDirect lookup. OAuth2 via HTTP Basic auth,
  asset-entitlements under /PROD/sbil/eapi/v5 (the device.warranty path 404s
  for this account), map latest dated entitlement to service level + dates.
  Cache the token process-wide; Dell rate-limits the token endpoint and a
  fresh request per refresh trips a 401 cooldown. Verified against live Dell.
- Lenovo/HP stay config-shaped stubs.
- Settings: warranty_dell_* keys (category integrations); Dell Warranty Lookup
  block in System Settings > Integrations (enable + client id/secret masked +
  optional token/API URL overrides).
- WarrantyPanel takes optional pre-fetched items; PCDetail fetches once and
  feeds both the panel and a new hero warranty-status/end-date badge.
- tools/mock_dell.py for offline testing of the provider flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-07-09 16:05:26 -04:00
parent 78a0ee8d83
commit 7e9650a62b
8 changed files with 370 additions and 30 deletions

View File

@@ -301,6 +301,42 @@ def build_default_settings():
'category': 'integrations',
'description': 'Zabbix API authentication token'
},
# Dell warranty lookup (Dell TechDirect Warranty API, OAuth2)
{
'key': 'warranty_dell_enabled',
'value': 'false',
'valuetype': 'boolean',
'category': 'integrations',
'description': 'Enable Dell warranty lookups (service-tag entitlements)'
},
{
'key': 'warranty_dell_clientid',
'value': '',
'valuetype': 'string',
'category': 'integrations',
'description': 'Dell TechDirect API client id'
},
{
'key': 'warranty_dell_clientsecret',
'value': '',
'valuetype': 'string',
'category': 'integrations',
'description': 'Dell TechDirect API client secret'
},
{
'key': 'warranty_dell_tokenurl',
'value': '',
'valuetype': 'string',
'category': 'integrations',
'description': 'Dell OAuth token URL (blank = Dell default)'
},
{
'key': 'warranty_dell_apiurl',
'value': '',
'valuetype': 'string',
'category': 'integrations',
'description': 'Dell warranty API URL (blank = Dell default)'
},
# Email/SMTP settings
{
'key': 'smtp_enabled',