Skip to content

backend: add scoped user agent for shift hosts#4086

Open
jstrnbrg wants to merge 1 commit into
BitBoxSwiss:masterfrom
jstrnbrg:user_agent
Open

backend: add scoped user agent for shift hosts#4086
jstrnbrg wants to merge 1 commit into
BitBoxSwiss:masterfrom
jstrnbrg:user_agent

Conversation

@jstrnbrg
Copy link
Copy Markdown
Collaborator

No description provided.

@jstrnbrg jstrnbrg requested a review from a team as a code owner April 29, 2026 11:41
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0d0cb12a-a20e-450d-b9ce-a818eae0b334

📥 Commits

Reviewing files that changed from the base of the PR and between 3bdf46d and 0e8807c.

📒 Files selected for processing (14)
  • backend/backend.go
  • backend/backend_test.go
  • backend/bridgecommon/bridgecommon.go
  • backend/bridgecommon/bridgecommon_test.go
  • backend/handlers/handlers_test.go
  • backend/mobileserver/mobileserver.go
  • cmd/servewallet/main.go
  • frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/GoViewModel.java
  • frontends/ios/BitBoxApp/BitBoxApp/BitBoxAppApp.swift
  • frontends/qt/server/server.go
  • util/socksproxy/socksproxy.go
  • util/socksproxy/socksproxy_test.go
  • util/useragent/useragent.go
  • util/useragent/useragent_test.go

📝 Walkthrough

Walkthrough

A new useragent utility package is introduced to generate and apply User-Agent headers to HTTP requests. The Environment interface is extended with a UserAgentHost() method that returns environment-specific host tokens. This method is implemented across backend, mobile server, webdev, Android, and iOS frontends. The SocksProxy utility is updated with a WithUserAgent method to configure HTTP clients with custom User-Agent headers. The new transport wrapper conditionally applies User-Agent headers only to requests targeting BitBox/Shift-owned hostnames.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 2/3 reviews remaining, refill in 20 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant