Function ros2_medkit_gateway::http::detail::write_oauth2_error

Function Documentation

void ros2_medkit_gateway::http::detail::write_oauth2_error(FrameworkOrPluginAccess token, httplib::Response &res, const ErrorInfo &err)

Write an OAuth 2.0 RFC 6749 error response.

Body shape (per RFC 6749 §5.2):

{ "error": "<code>", "error_description": "<message>" }
Used only by the auth endpoints (/auth/token, /auth/revoke) which by spec must speak the OAuth2 error shape, not the SOVD GenericError shape. The error field carries the snake_case OAuth2 error code, not the SOVD error_code key. There is no parameters wrapper.

Parameters:
  • token – Framework access token (constructible only by friends).

  • res – HTTP response to mutate.

  • err – Transport-neutral error descriptor. err.http_status is clamped into the SOVD range 400-599.