DEENESPTFRRUARHIKOZHNL

结构体 ara::diag::SovdAuthorization::ValidateAuthorizationOutput

[SWS_DM_01927] Upstream: RS_Diag_04268

struct ValidateAuthorizationOutput {...};

Return type for ValidateAuthorization().

Header-Datei#include "ara/diag/sovd_authorization.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopeclass ara::diag::SovdAuthorization

用户指南人工智能生成

捆绑包含客户端身份和缓存有效期的 SOVD 授权检查结果。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6613e74c168c 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

捆绑包含客户端身份和缓存有效期的 SOVD 授权检查结果。

结构体 ara::diag::SovdAuthorization::ValidateAuthorizationOutput 用作模块 diag [SWS_DM_01927] 中授权检查 ValidateAuthorization() 的返回类型。它传输用于重新识别以及维持对例程或锁定等临时资源的访问权限的可选客户端身份 [SWS_DM_01819],以及用于缓存验证结果的有效时间点 [SWS_DM_01820]。如果身份字段保持未设置,则一旦传输的令牌过期或失效,对受保护资源的访问权限即告终止 [SWS_DM_01819]。

上下文

结构体 ara::diag::SovdAuthorization::ValidateAuthorizationOutput 充当 AUTOSAR Adaptive Platform 模块 diag 中操作 ValidateAuthorization() 的标准化返回类型 [SWS_DM_01927] AUTOSAR_AP_SWS_Diagnostics §8.52.2 “Struct: ValidateAuthorizationOutput”。它在面向服务的诊断访问(SOVD)中用作应用程序端授权逻辑与 Diagnostic Management 之间的接口元素。一旦外部诊断客户端想要通过 SOVD 令牌访问车辆资源,Diagnostic Management 就会请求验证。该结构体传输此检查的两个核心结果:客户端的可选标识特征(identity)[SWS_DM_01819] 以及用于缓存授权的有效时间点(validUntil)[SWS_DM_01820]。

生命周期

作为普通数据结构(Plain Struct),ValidateAuthorizationOutput 具有瞬态生命周期 [SWS_DM_01927]。它由授权检查的应用特定实现进行实例化,填入验证结果,并通过值(按值返回即移动语义)传递给调用方 Diagnostic Management。该结构体将 ara::core::Optional<ara::core::String> [SWS_DM_01819] 类型的字段 identity 和 std::chrono::system_clock::time_point [SWS_DM_01820] 类型的字段 validUntil 作为直接成员变量持有。对象本身没有内部状态或状态转换,但通过字段 validUntil 直接决定 Diagnostic Management 中保留的授权状态(Caching)的生命周期 [SWS_DM_01820]。在并发方面,该实例应当在验证调用内线程本地生成;未对同一结构体的并发写访问进行规范(Interpretation: 防止数据竞争由调用环境负责)。 问题 Q-0579316b13023b31 (未决)在被框架评估后,结构体实例的生命周期在离开作用域时正常结束。

使用路径

使用 ValidateAuthorizationOutput 的典型流程分为以下步骤:

  • 接收请求:外部客户端向 Diagnostic Management 发送带有安全令牌的 SOVD 诊断请求。
  • 请求验证:Diagnostic Management 通过 ValidateAuthorization() 将令牌转发给特定于应用的授权实例。
  • 创建返回值:应用程序检查令牌,实例化 ValidateAuthorizationOutput,并将 validUntil 设置为此授权可被重用的时间点 [SWS_DM_01820] AUTOSAR_AP_SWS_Diagnostics §8.52.2.1.2 “validUntil”。
  • 分配身份:如果安全概念包含重新识别机制,应用程序将设置可选字段 identity(例如 client_id、sub 或其组合)[SWS_DM_01819] AUTOSAR_AP_SWS_Diagnostics §8.52.2.1.1 “identity”。
  • 评估结果:Diagnostic Management 接收结构体,将验证结果缓冲至 validUntil,并将临时资源(如正在运行的诊断例程或锁)分配给传递的身份 [SWS_DM_01819] [SWS_DM_01820]。
Validierung von SOVD-ZugriffstokensSOVD-Client诊断管理SovdAuthorization-Handler带有令牌的诊断请求ValidateAuthorization(token)Erzeuge ValidateAuthorizationOutputValidateAuthorizationOutput(identity, validUntil)Cache Token bis validUntil将资源与 identity 关联Diagnoseantwort

时序图:用于授权检查和缓冲的验证流程及 ValidateAuthorizationOutput 的返回。来源:[SWS_DM_01819]、[SWS_DM_01820]、[SWS_DM_01927]。

错误场景

虽然 ValidateAuthorizationOutput 作为简单数据类型不抛出自身的错误码或异常,但错误或不完整的赋值会导致运行故障:

  • 令牌续期时缺少客户端标识:如果未对 identity 进行赋值(空 Optional),则客户端仅在存在相同令牌且 validUntil 未过期的时间内访问临时资源 [SWS_DM_01819]。若客户端对已过期的令牌进行续期,Diagnostic Management 在未设置标识的情况下将无法重新识别它;对活动例程或现有锁定的访问权限将会丢失 [SWS_DM_01819]。
  • 无效或已失效的时间戳:若在 validUntil 中传递的时间点已属于过去,则 Diagnostic Management 中大概会立即放弃缓存(解释:后续的每个客户端请求都会强制触发一次重新验证调用)。 问题 Q-c715941f9302fd13 (未决)
  • 标识冲突:若授权应用程序意外为不同客户端返回相同的标识字符串,Diagnostic Management 会将它们归类为相同 [SWS_DM_01819],这可能导致未授权地接管锁定和临时资源。

本指南由 AI 基于 AUTOSAR Adaptive Platform R25-11 规范(diag 模块)策划。

UML 类图

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__diag__SovdAuthorization__ValidateAuthorizationOutput846 «struct» ValidateAuthorizationOutput + identity + validUntil

常量

identity 变量

Identity of the client. This identity string if present will be used to re-identify a client even if it uses a new token (e.g. because the old one expired) so that it has access to the temporary resources (e.g. running routines, locks, etc.). If the identity string is the same as one returned earlier, the client will be considered identical. Depending on the security concept it could be for example the ’client_id’, the ’sub’, or a combination of both. If the identity string is not provided, the client will only have access to the temporary resources as long as it provides the same access token and validUntil is not yet expired.

validUntil 变量

Time until this validation may be reused. The point in time until which the authentication state may be reused if the same token is provided by the client (caching).

常量 / 变量文档

变量 identity [SWS_DM_01819] Upstream: RS_Diag_04268

ara::core::Optional<ara::core::String> identity;

Identity of the client. This identity string if present will be used to re-identify a client even if it uses a new token (e.g. because the old one expired) so that it has access to the temporary resources (e.g. running routines, locks, etc.). If the identity string is the same as one returned earlier, the client will be considered identical. Depending on the security concept it could be for example the ’client_id’, the ’sub’, or a combination of both. If the identity string is not provided, the client will only have access to the temporary resources as long as it provides the same access token and validUntil is not yet expired.

Header-Datei#include "ara/diag/sovd_authorization.h"
Scopestruct ara::diag::SovdAuthorization::ValidateAuthorizationOutput
Symbolidentity
Typara::core::Optional< ara::core::String >

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_DM_01819
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01819@rel:R25-11#27f23f12
Content hash
27f23f12
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01819
Status: valid/unmigrated Version: rel:R25-11#4cf57b0a Versionshistorie & Revisions (1 transition, 4 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_01819@rel:R25-11#4cf57b0a
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#8dd343072026-09-30
  • R23-11rel:R23-11#7d3b6a842026-10-14
  • R24-11rel:R24-11#4cf57b0a2026-10-14
  • R25-11rel:R25-11#4cf57b0a2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

变量 validUntil [SWS_DM_01820] Upstream: RS_Diag_04268

std::chrono::system_clock::time_point validUntil;

Time until this validation may be reused. The point in time until which the authentication state may be reused if the same token is provided by the client (caching).

Header-Datei#include "ara/diag/sovd_authorization.h"
Scopestruct ara::diag::SovdAuthorization::ValidateAuthorizationOutput
SymbolvalidUntil
Typstd::chrono::system_clock::time_point

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_DM_01820
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_01820@rel:R25-11#a830b969
Content hash
a830b969
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_01820
Status: valid/unmigrated Version: rel:R25-11#bd4ad359 Versionshistorie & Revisions (1 transition, 4 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_01820@rel:R25-11#bd4ad359
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#530250dc2026-09-30
  • R23-11rel:R23-11#bd4ad3592026-10-14
  • R24-11rel:R24-11#bd4ad3592026-10-14
  • R25-11rel:R25-11#bd4ad3592026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill