From 8082ab4d749fc70156f700e9b5cd122ed41228e0 Mon Sep 17 00:00:00 2001 From: mrchatam Date: Sat, 12 Sep 2026 12:43:22 +0330 Subject: [PATCH] feat(clients): show short HWID fingerprint in admin device list (#6464) * feat(clients): show short HWID fingerprint in admin device list Expose a 12-char prefix of the stored hwid_hash in the admin HWID list API and UI so admins can distinguish devices without querying the database. Full hashes and raw HWIDs remain unexposed. Fixes #6359 * ci: retrigger release matrix after 386 dependency download flake --------- Co-authored-by: mrchatam Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com> --- docs/content/docs/en/reference/api/clients.mdx | 8 ++++---- docs/public/openapi.json | 5 +++-- frontend/public/openapi.json | 5 +++-- frontend/src/components/clients/ClientHwidList.tsx | 8 ++++++++ frontend/src/lib/clients/hwid-log.ts | 1 + frontend/src/pages/api-docs/endpoints.ts | 5 +++-- internal/web/service/client_hwid.go | 14 +++++++++++++- internal/web/service/client_hwid_test.go | 7 +++++++ internal/web/translation/ar-EG.json | 1 + internal/web/translation/en-US.json | 1 + internal/web/translation/es-ES.json | 1 + internal/web/translation/fa-IR.json | 1 + internal/web/translation/id-ID.json | 1 + internal/web/translation/ja-JP.json | 1 + internal/web/translation/pt-BR.json | 1 + internal/web/translation/ru-RU.json | 1 + internal/web/translation/tr-TR.json | 1 + internal/web/translation/uk-UA.json | 1 + internal/web/translation/vi-VN.json | 1 + internal/web/translation/zh-CN.json | 1 + internal/web/translation/zh-TW.json | 1 + 21 files changed, 55 insertions(+), 11 deletions(-) diff --git a/docs/content/docs/en/reference/api/clients.mdx b/docs/content/docs/en/reference/api/clients.mdx index 7befebe7b..67c5aedec 100644 --- a/docs/content/docs/en/reference/api/clients.mdx +++ b/docs/content/docs/en/reference/api/clients.mdx @@ -227,8 +227,8 @@ _openapi: title: Reset the recorded IP list for a client. url: '#reset-the-recorded-ip-list-for-a-client' - depth: 2 - title: List registered HWID devices for a client. Hashes are not exposed. - url: '#list-registered-hwid-devices-for-a-client-hashes-are-not-exposed' + title: List registered HWID devices for a client with a short fingerprint. Full hashes are not exposed. + url: '#list-registered-hwid-devices-for-a-client-with-a-short-fingerprint-full-hashes-are-not-exposed' - depth: 2 title: Clear all registered HWID devices for a client so new devices can register again. @@ -473,8 +473,8 @@ _openapi: id: list-source-ips-that-have-connected-with-the-given-clients-credentials-returns-an-array-of-ip-timestamp-strings - content: Reset the recorded IP list for a client. id: reset-the-recorded-ip-list-for-a-client - - content: List registered HWID devices for a client. Hashes are not exposed. - id: list-registered-hwid-devices-for-a-client-hashes-are-not-exposed + - content: List registered HWID devices for a client with a short fingerprint. Full hashes are not exposed. + id: list-registered-hwid-devices-for-a-client-with-a-short-fingerprint-full-hashes-are-not-exposed - content: Clear all registered HWID devices for a client so new devices can register again. id: clear-all-registered-hwid-devices-for-a-client-so-new-devices-can-register-again diff --git a/docs/public/openapi.json b/docs/public/openapi.json index 0df587bf6..8b2231561 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -9604,7 +9604,7 @@ "tags": [ "Clients" ], - "summary": "List registered HWID devices for a client. Hashes are not exposed.", + "summary": "List registered HWID devices for a client with a short fingerprint. Full hashes are not exposed.", "operationId": "post_panel_api_clients_hwids_email", "parameters": [ { @@ -9644,7 +9644,8 @@ "userAgent": "Happ/1.0", "deviceOs": "android", "osVersion": "15", - "deviceModel": "Pixel 9" + "deviceModel": "Pixel 9", + "fingerprint": "6ad17c93e821" } ] } diff --git a/frontend/public/openapi.json b/frontend/public/openapi.json index 0df587bf6..8b2231561 100644 --- a/frontend/public/openapi.json +++ b/frontend/public/openapi.json @@ -9604,7 +9604,7 @@ "tags": [ "Clients" ], - "summary": "List registered HWID devices for a client. Hashes are not exposed.", + "summary": "List registered HWID devices for a client with a short fingerprint. Full hashes are not exposed.", "operationId": "post_panel_api_clients_hwids_email", "parameters": [ { @@ -9644,7 +9644,8 @@ "userAgent": "Happ/1.0", "deviceOs": "android", "osVersion": "15", - "deviceModel": "Pixel 9" + "deviceModel": "Pixel 9", + "fingerprint": "6ad17c93e821" } ] } diff --git a/frontend/src/components/clients/ClientHwidList.tsx b/frontend/src/components/clients/ClientHwidList.tsx index 8c3380a02..5b3302831 100644 --- a/frontend/src/components/clients/ClientHwidList.tsx +++ b/frontend/src/components/clients/ClientHwidList.tsx @@ -101,6 +101,14 @@ export default function ClientHwidListModal({ )} + {entry.fingerprint && ( + <> +
+ + {t('pages.clients.hwidFingerprint')}: {entry.fingerprint} + + + )}