syncstorage-rs icon indicating copy to clipboard operation
syncstorage-rs copied to clipboard

Remove/cleanup extrude implementations

Open data-sync-user opened this issue 3 years ago • 1 comments

Extractors (i.e. implementations of the FromRequest trait) operate on HttpRequests. Middlewares take ServiceRequests, which are a higher-level abstraction over HTTP requests. We used to do a lot of work in middlewares, and building extractor-like abstractions to improve modularity and readability was desirable. These abstractions took the form of extrude functions defined in numerous places across the codebase and were responsible for extracting information from ServiceRequests (or its constituent parts, like RequestHead).

Now that we do a lot less in middleware (the db transaction handling and precondition checks are no longer middleware), we don't need as many extrude functions. Instead, we should explore writing new extractors or adding to existing extractors to retrieve the information we need from HttpRequest instead of ServiceRequest, simplifying some of their implementations (e.g. the _from_path methods wouldn't need extract path elements as manually as they currently do, requiring them to urldecode).

https://github.com/mozilla-services/syncstorage-rs/issues/833

┆Issue is synchronized with this Jira Task

data-sync-user avatar Mar 15 '22 15:03 data-sync-user

Duplicate of #833

ethowitz avatar Mar 15 '22 15:03 ethowitz