Skip to content

Impossible to access default_headers from ClientOptions for custom HttpConnector #559

@kylebarron

Description

@kylebarron

object_store: Impossible to access default_headers from ClientOptions; thus impossible to pass on to a custom HTTPService. We should make sure that all values from ClientOptions are accessible for custom http implementations.

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

When trying to implement a custom HttpConnector, the connect method takes in a &ClientOptions to be used for creating an HttpClient.

This implies that you should be able access all properties of ClientOptions in order to define the creation of your custom HttpClient.

However the only public API to access data from a ClientOptions is get_config_value, which is only defined for values of ClientConfigKey. This doesn't include (at least) default_headers. There may be other properties not included.

Describe the solution you'd like

Perhaps we should create accessors for all struct fields inside ClientOptions?

Describe alternatives you've considered

Not forward on all configuration options to user-defined HTTP connectors.

Additional context

I'm prototyping integrating the HttpConnector into obstore — Python bindings to object_store — so that someone can define an arbitrary Python-based HTTP client to make the requests initiated by object_store.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions