函数 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 的基本功能在调用时不可用而发生错误,则该操作以回滚语义失败,并在 Result 对象中返回 DiagErrc::kServiceNotAvailable [SWS_DM_01142]。
在并发性方面,该方法明确指定为 not thread-safe [SWS_DM_01142]。因此,在同一个 ClientAuthentication 对象上的并行调用是不允许的,必须由应用程序进行同步。
交互和生命周期
获取的 ClientAuthenticationHandle 使应用程序能够为已验证身份的客户端定义或扩展 DynamicAccessList [SWS_DM_01142]。此外,该调用还会启动或引用客户端的不活动监控:如果在默认会话状态下成功完成身份验证后,在 authenticationTimeout 持续时间内未发生进一步的 UDS 请求,则 Diagnostic Server 实例会自动将客户端重置回 kDeAuthenticated [SWS_DM_01210]。为了防止此超时,应用程序可以通过句柄的方法 Refresh 更新定时器 [SWS_DM_01155]。
此文本由 AI 基于 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#46ae5437- Content hash
46ae5437- 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 · 德文原文