دالة Authenticate [SWS_DM_01142] Upstream: RS_Diag_04251
ara::core::Result< ClientAuthenticationHandle > Authenticate (ara::core::Vector< DiagnosticAuthRole > userRoles) noexcept;
This function is used by the application to report the authenticated state to the Diagnostic Server instance. The authentication could be either done using the Authentication interfaces of the Diagnostic Server instance, or through other means in the application.
الاستخدام والاستدعاء
يستدعي التطبيق الدالة ara::diag::ClientAuthentication::Authenticate لإبلاغ مثيل Diagnostic Server بنجاح مصادقة عميل التشخيص [SWS_DM_01142]. يمكن أن يتم ذلك بعد مصادقة عبر واجهات Diagnostic Server أو عبر آليات خاصة بالتطبيق [SWS_DM_01142].
تأخذ الدالة userRoles (من النوع ara::core::Vector<DiagnosticAuthRole>) كمعلمة إدخال. وعند نجاح الاستدعاء، تنتقل حالة مصادقة المثيل إلى kAuthenticated وتعتمد أدوار المستخدم الممررة بشكل دائم [SWS_DM_01206]. وتُرجع كقيمة إرجاع ara::core::Result<ClientAuthenticationHandle> [SWS_DM_01142]. وبما أنه يتم توفير كائن Result مباشرةً، فمن المرجح أن تتم المعالجة بشكل متزامن في سياق الاستدعاء. سؤال Q-dae22c82694f2103 (مفتوح)
معالجة الأخطاء والتزامن
الطريقة مصرّح عنها كـ noexcept وتُعتبر آمنة ضد الاستثناءات (exception safe) [SWS_DM_01142]. إذا حدث خطأ بسبب عدم توفر وظائف أساسية لـ Diagnostic Manager في وقت الاستدعاء، فإن العملية تفشل مع دلالات التراجع (Rollback Semantics) وتُرجع DiagErrc::kServiceNotAvailable في كائن Result [SWS_DM_01142].
فيما يتعلق بالتزامن، تم تحديد الطريقة صراحةً بأنها not thread-safe [SWS_DM_01142]. وبالتالي، فإن الاستدعاءات المتوازية على كائن ClientAuthentication نفسه غير مسموح بها ويجب مزامنتها بواسطة التطبيق.
التفاعل ودورة الحياة
يتيح كائن ClientAuthenticationHandle الذي تم الحصول عليه للتطبيق تعريف DynamicAccessList لعميل تمت مصادقته أو توسيعها [SWS_DM_01142]. بالإضافة إلى ذلك، يبدأ الاستدعاء أو يشير إلى مراقبة عدم نشاط العميل: إذا لم يَرِد أي طلب UDS آخر بعد نجاح المصادقة في حالة الجلسة الافتراضية طوال مدة authenticationTimeout، يعيد مثيل Diagnostic Server العميل تلقائيًا إلى kDeAuthenticated [SWS_DM_01210]. ولمنع انتهاء المهلة هذا، يمكن للتطبيق تحديث المؤقت عبر الطريقة Refresh للمقبض [SWS_DM_01155].
تم إنشاء هذا النص بواسطة ذكاء اصطناعي بناءً على مواصفات AUTOSAR.
دليل المنفِّذ قيد الإعداد (التعقيد I2)
| Header-Datei | #include "ara/diag/client_authentication.h" |
|---|---|
| Scope | class ara::diag::ClientAuthentication |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | not thread-safe |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| userRoles | The user roles to set on the diagnostic client |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result< ClientAuthenticationHandle > | A handler of the Authentication State, which can be used by the application to set or extend the DynamicAccessList |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| DiagErrc::kServiceNotAvailable | rollback_semantics The call cannot be executed, because essential DM functionality is currently not available. |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_DM_01142- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_DM_01142@rel:R25-11#285a9287- Content hash
285a9287- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01142
Status: valid/unmigrated
Version: rel:R25-11#17cf8f55
Versionshistorie & Revisions (1 transition, 6 revision)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_DM_01142@rel:R25-11#17cf8f55
Recorded Revisions (6):
- R25-11
rel:R25-11#ffd39a4b2026-09-30 - R21-11
rel:R21-11#6f17bd9a2026-10-14 - R22-11
rel:R22-11#1579f1692026-10-14 - R23-11
rel:R23-11#3b67657b2026-10-14 - R24-11
rel:R24-11#575f1e5f2026-10-14 - R25-11
rel:R25-11#17cf8f552026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · الأصل الألماني