Skip to content

[DRAFT] Pure python request pipeline #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: no-http-auth
Choose a base branch
from

Conversation

JordonPhillips
Copy link
Contributor

@JordonPhillips JordonPhillips commented Mar 12, 2025

This is a draft of the non-codegen request pipeline. It's at a point where it looks like what it'll look like in the final draft, but there's some other components that need to be updated still, namely:

  • Auth needs to be decoupled from HTTP and params need to be standardized
  • Endpoint resolution needs to be decoupled from HTTP and params need to be standardized.
  • Error classification for retries needs to be handled in a robust way. smithy-java is just handing that off to the retry strategy, but that's not good enough IMO. I think there needs to be a shared responsibility:
    • smithy-core needs to perform default classification based on the model.
    • Transports and/or protocols need to classify their own errors, perhaps through a classify method, based on the response.
    • retry strategy can then reclassify if it likes
  • Protocols need to wrap event streams. smithy-java handles this through serde (e.g. write_event_stream / read_event_stream) but Python doesn't have some standard thing like Flow to fall back on so it's not quite so simple.
  • Related to the above, event interfaces need to be moved into smithy-core
  • Requests need to be reset during retries, including seeking seekable bodies. IMO the Request should handle that with a retryable and reset method.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@JordonPhillips JordonPhillips force-pushed the pure-python-request-pipeline branch from bb29685 to 3a6df83 Compare March 12, 2025 17:16
This decouples auth from HTTP, allowing it to be defined centrally.

A number of changes have been made to various interfaces. Notably
identity resolvers are generally expected to have zero-arg
constructors, instead getting everything they need from their
properties where possible.

Construction of event signers has been moved into AuthScheme. Right
now it takes the entire context of the request during construction,
but we should consider passing identity and signing properties in
at signing time like normal signers so that they can be reused.
@JordonPhillips JordonPhillips force-pushed the pure-python-request-pipeline branch 2 times, most recently from ec58e87 to 1890159 Compare April 11, 2025 13:39
@JordonPhillips JordonPhillips changed the base branch from develop to no-http-auth April 11, 2025 13:40
@JordonPhillips JordonPhillips force-pushed the pure-python-request-pipeline branch from 1890159 to 0e83eeb Compare April 11, 2025 13:43
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine conceptually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants