pub struct Deprecation {
pub since: Option<String>,
pub sunset: Option<String>,
pub uri: Option<String>,
}Expand description
Route-level API deprecation policy (DW-048): automates the RFC deprecation signal headers on every response of the route.
What the block emits (computed once at snapshot compile; see
CompiledDeprecation and dataplane::versioning):
since(header emitted only when set):Deprecation: @<unix-seconds>— the RFC 9745 structured-date form (RFC 9651 dates). RFC 9745 carries no URI inside theDeprecationfield; the human-readable notice travels in theLinkbelow.sunset(optional):Sunset: <HTTP-date>verbatim — RFC 8594 requires an HTTP-date, and validation accepts exactly the IMF-fixdate form generators must send (seeconfig::versioning).uri(optional, requiressince):Link: <uri>; rel="deprecation"appended — the RFC 9745 companion link to the migration documentation.
Semantics (frozen):
- Headers are stamped on the route’s ACTION responses (proxy,
redirect, respond) in the response decoration tail — after
compression wrapping (the codec only rewrites
Content-Length,Content-Encoding, andVary, so these headers pass through verbatim) and beside the CORS headers (independent families). Gateway-generated short-circuits on the route (413/431 limit rejections, CORS preflights, authn/authz/rate-limit rejections, 503 sheds) do NOT carry them: those responses describe the gateway’s opinion of the REQUEST, not the route’s lifecycle. (The eager HMAC body-digest 401 is an action-path response and DOES carry them.) Unrouted traffic (404) never matches the route at all. - The gateway is the source of truth for the headers it is configured
to emit: an upstream-sent
Deprecation/Sunseton a route WITH adeprecationblock is replaced; on a route WITHOUT one, upstream values pass through untouched.Linkis appended (a list header — upstream links survive). - Validation rejects: a block with neither
sincenorsunset(no effect — omit it), dates that are not IMF-fixdate, asunsetalready in the past (advertising a removal that already happened; remove the route or extend the date — this also stops a long-lived generation from silently re-publishing a stale sunset), asunsetbeforesince(removed before deprecated), and auriwithoutsince(the link documents theDeprecationheader).
Fields§
§since: Option<String>When this API version was (or will be) deprecated, as an
IMF-fixdate HTTP-date (Sun, 06 Nov 1994 08:49:37 GMT). Emits
Deprecation: @<unix-seconds> (RFC 9745). A past date is normal
(the deprecation is in effect); a date before 1970 cannot form
the structured date and is rejected.
sunset: Option<String>When this API version is expected to stop working, as an
IMF-fixdate HTTP-date. Emits Sunset (RFC 8594) verbatim.
Validation rejects a date already in the past and a date before
since.
uri: Option<String>URI of the deprecation/migration notice (absolute http(s) URL).
Requires since — the RFC 9745 Link; rel="deprecation" it
emits documents the Deprecation header.
Trait Implementations§
Source§impl Clone for Deprecation
impl Clone for Deprecation
Source§fn clone(&self) -> Deprecation
fn clone(&self) -> Deprecation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Deprecation
impl Debug for Deprecation
Source§impl<'de> Deserialize<'de> for Deprecation
impl<'de> Deserialize<'de> for Deprecation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Deprecation
impl JsonSchema for Deprecation
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for Deprecation
impl PartialEq for Deprecation
Source§impl Serialize for Deprecation
impl Serialize for Deprecation
impl StructuralPartialEq for Deprecation
Auto Trait Implementations§
impl Freeze for Deprecation
impl RefUnwindSafe for Deprecation
impl Send for Deprecation
impl Sync for Deprecation
impl Unpin for Deprecation
impl UnwindSafe for Deprecation
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more