Skip to content

Conversation

mmalenic
Copy link
Member

@mmalenic mmalenic commented Oct 1, 2025

Changes

  • Adds the user-agent to all internal request inside htsget-rs as otherwise they can get blocked.
    • The user agent is the package name and version.
    • This took a bit of a refactor of the package info, as I wanted the user-agent to be based on the top-level crate that has htsget-config as a dependency. If package_info!() is called inside htsget-config, it will return "htsget-config/<version>" rather than "htsget-lambda/<version>".
  • Changes the authorization response structure and gives an "backend" as an alias to the location.

@mmalenic mmalenic self-assigned this Oct 1, 2025
@mmalenic mmalenic added the enhancement New feature or request label Oct 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the HTTP client configuration system and adds user-agent headers to all internal requests, while also updating authorization response structure to include "backend" as an alias for location fields.

Key changes:

  • Refactored HTTP client configuration to support late initialization and user-agent injection based on top-level package information
  • Added package information propagation through the configuration system to enable proper user-agent headers
  • Updated authorization response structure with "backend" alias for location fields

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
htsget-config/src/config/advanced/mod.rs Refactored HttpClient to support lazy initialization and user-agent configuration
htsget-config/src/config/mod.rs Added package_info field and propagation logic throughout configuration
htsget-config/src/http/client.rs Added user_agent field to HttpClientConfig
htsget-config/src/storage/url.rs Updated Url storage to use new HttpClient structure
htsget-http/src/middleware/auth.rs Changed auth methods to mutable to support client building
htsget-http/src/http_core.rs Added package_info parameter to get/post functions for user-agent propagation
htsget-config/src/config/advanced/auth/response.rs Added "backend" alias for location fields in authorization responses
htsget-lambda/src/lib.rs Updated to use new package_info configuration pattern
htsget-axum/src/main.rs Updated to use new package_info configuration pattern
htsget-actix/src/main.rs Updated to use new package_info configuration pattern

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mmalenic mmalenic enabled auto-merge October 1, 2025 23:58
@mmalenic mmalenic disabled auto-merge October 1, 2025 23:58
@mmalenic mmalenic merged commit 5b7e28f into main Oct 1, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant