-
-
Notifications
You must be signed in to change notification settings - Fork 10
Connection level extensions #67
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
base: main
Are you sure you want to change the base?
Conversation
Some EPP extensions such as change poll didn't map to the present command oriented extensions. The <changePoll> element will be present in the poll response without any elements in the <extension> element of the request. There is no allowed value for the <extension> element for the poll command (if you only support RGP, NameStore, and ChangePoll). This now stores enabled general extensions in the EppClient. This allows you to retrieve command level extensions responses using Response::command_extension and connection level extensions using Response::connection_extension
There is not need for Cow as this is only deserialized and xml::deserialize uses FromXmlOwned.
|
@djc I am looking forward to some feedback here. |
djc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the change poll extension: The element will be present in the poll response's tag without any elements in the element of the request. There is, in fact, no allowed value for the element for the poll command (if you only support RGP, NameStore, and ChangePoll). This makes it impossible to encode the
ChangePollresponse in any call totransactcurrently.This now stores enabled general extensions in the EppClient. This allows you to retrieve command level extensions responses using
Response::command_extensionand connection level extensions using Response::connection_extension.
Can you explain a bit more the conceptual context here? If it only ever appears in the context of a poll response, could we attach it to this specific command (or this specific response type) instead instead of attaching it to the entire connection?
|
|
||
| impl<'c, 'e, C: Command, E: Extension> From<(&'c C, &'e E)> for RequestData<'c, 'e, C, E> { | ||
| fn from((command, extension): (&'c C, &'e E)) -> Self { | ||
| impl<'c, 'e, C: Command, CommandExt: Extension> From<(&'c C, &'e CommandExt)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these impls, it doesn't seem to be an improvement? The Clone and Copy impls are trivial, and the From impl has the bounds right there so it's kind of obvious what's going on?
|
(The generics renaming and making |
Yes. The I gave this another thought yesterday. Having multiple enabled extensions that add elements to But these changes would touch a lot of code in |
I created #68 but dropped the generics rename commit, as all of them only make sense if a third generic for the client level extensions is added. |
I would be open to it if/when I'm paid for the time I spend on it. I agree a type map like what's used in the http crate could make sense. |
Some EPP extensions such as change poll didn't map to the present command oriented extensions. My last PR #60 contained some errors, making it non-working in real life.
Looking at the change poll extension:
The element will be present in the poll response's tag without any elements in the element of the request.
There is, in fact, no allowed value for the element for the poll command (if you only support RGP, NameStore, and ChangePoll). This makes it impossible to encode the
ChangePollresponse in any call totransactcurrently.This now stores enabled general extensions in the EppClient. This allows you to retrieve command level extensions responses using
Response::command_extensionand connection level extensions using Response::connection_extension.I am not totally happy with this, as it assumes these might be present for all commands. (Adding the need to use Option downstream). Adding yet another
Transactionlike trait seems suboptimal, asTransactionalready caused some downstream pain, if you remember.This probably needs some work before it is good enough for a merge.