Skip to content
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

Move middleware and other generic components from graph core to the http core library #360

Closed
9 tasks done
baywet opened this issue Jul 21, 2021 · 4 comments · Fixed by #589, #599 or #609
Closed
9 tasks done

Move middleware and other generic components from graph core to the http core library #360

baywet opened this issue Jul 21, 2021 · 4 comments · Fixed by #589, #599 or #609
Assignees
Labels
Csharp Pull requests that update .net code enhancement New feature or request

Comments

@baywet
Copy link
Member

baywet commented Jul 21, 2021

Looking at the sdk-design features list, there are a number of component that exist today in the graph core library which belong to the kiota http core library.
Most of those components are the middlewares.
If they exist, move the following components:

@baywet baywet added enhancement New feature or request Csharp Pull requests that update .net code labels Jul 21, 2021
@baywet baywet added this to the GA milestone Jul 21, 2021
@andrueastman
Copy link
Member

Hey @baywet,

I'm not sure if we really want to add an authorization handler in the kiota http core library by default. This is because,

  • The default HttpCore takes in a mandatory IAuthenticationProvider contructor parameter here which always authenticates the RequestInformation instance before it is sent out here(I believe this may cut across several languages)

  • If we want the authorization handler to use an instance of IAuthenticationProvider for authentication I believe that things might get a little tricky. The current IAuthenticationProvider specification states that it should act on an instance of RequestInformation here while the pipeline structure expects an instance of HttpRequestMessage. Since we convert the RequestInformation instance to a HttpRequestMessage instance to pass the request to the pipeline, it might be counterproductive to convert the HttpRequestMessage instance back to an instance RequestInformation so the IAuthenticationProvider may do its job then convert it back to an instance of HttpRequestMessage so that it may be passed further along the pipeline. (I believe this may cut across several languages as well)

@baywet
Copy link
Member Author

baywet commented Sep 7, 2021

@andrueastman you are correct, this issue was written before we revamped the authentication provider interface. In general I don't think having the authentication middleware is a good idea: it ties the authentication concern with a specific implementation of "transport" (http, with a specific client), which goes against our separation of concerns principles. I think we can skip this one, thanks for putting together the PRs for the other ones, I'll look into it ASAP.

@andrueastman
Copy link
Member

No worries. Thanks for clearing that up @baywet 😄

@andrueastman
Copy link
Member

Closing this for now.
The description has been updated to cover work done. Further enhancements are covered in their own issues below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment