Navigation Menu

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

Allow to set headers in xmlrpc.client.ServerProxy #79334

Closed
cedk mannequin opened this issue Nov 3, 2018 · 7 comments
Closed

Allow to set headers in xmlrpc.client.ServerProxy #79334

cedk mannequin opened this issue Nov 3, 2018 · 7 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@cedk
Copy link
Mannequin

cedk mannequin commented Nov 3, 2018

BPO 35153
Nosy @vstinner, @cedk, @matrixise
PRs
  • bpo-35153: Add headers to xmlrpc.client.ServerProxy #10308
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-02-19.16:19:33.364>
    created_at = <Date 2018-11-03.11:26:11.599>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Allow to set headers in xmlrpc.client.ServerProxy'
    updated_at = <Date 2019-02-19.16:19:33.364>
    user = 'https://github.com/cedk'

    bugs.python.org fields:

    activity = <Date 2019-02-19.16:19:33.364>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-19.16:19:33.364>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2018-11-03.11:26:11.599>
    creator = 'ced'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35153
    keywords = ['patch']
    message_count = 7.0
    messages = ['329191', '329192', '329194', '329196', '329197', '335780', '335965']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'ced', 'matrixise']
    pr_nums = ['10308']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35153'
    versions = ['Python 3.8']

    @cedk
    Copy link
    Mannequin Author

    cedk mannequin commented Nov 3, 2018

    If we want to support other authentication method than basic, we need to be able to set headers to the request sent.
    I propose to add an argument headers to ServerProxy which is a list of header tuples that will be put as header.

    @cedk cedk mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Nov 3, 2018
    @matrixise
    Copy link
    Member

    Do you have an example where we need to have extra headers?

    but +1 for the feature, I marked this issue for 3.8

    @matrixise matrixise added the 3.8 only security fixes label Nov 3, 2018
    @matrixise
    Copy link
    Member

    and could you add some tests for this new feature?

    Thank you.

    @cedk
    Copy link
    Mannequin Author

    cedk mannequin commented Nov 3, 2018

    We have a library proteus which uses xmlrpc.client to connect to our server. The server support basic authentication but also session authentication. The session authentication is much faster because the password hash verification is slow by design.
    So to be able to use our session authentication method with the library, we need to be able to set our own Authorization header to the ServerProxy. It could be done with a custom Transport class but then we will have to do it twice for Transport and SafeTransport and to replicate the code that select the class out of the uri.
    The proposal started from this discussion: https://bugs.tryton.org/issue7783

    @matrixise
    Copy link
    Member

    ok +1 for me and I understand the need.

    But there is no defined experts for the xmlrpc part. We have to wait for a review just for the feature.

    @cedk
    Copy link
    Mannequin Author

    cedk mannequin commented Feb 17, 2019

    I have another use case to be able to set headers to xmlrpc: http://www.roundup-tracker.org/docs/xmlrpc.html#advanced-python-client-adding-anti-csrf-headers

    @vstinner
    Copy link
    Member

    New changeset beda52e by Victor Stinner (Cédric Krier) in branch 'master':
    bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308)
    beda52e

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants