Skip to content

rfq: auth/transport harmonization pass#2147

Merged
jtobin merged 7 commits into
lightninglabs:mainfrom
jtobin:auth-transport-pass
May 26, 2026
Merged

rfq: auth/transport harmonization pass#2147
jtobin merged 7 commits into
lightninglabs:mainfrom
jtobin:auth-transport-pass

Conversation

@jtobin

@jtobin jtobin commented May 26, 2026

Copy link
Copy Markdown
Member

Mostly adds configurable TLS certificate verification to the portfolio pilot, bringing it to parity with the price oracle, but also smooths over a few loose ends:

First, it seems righteous to have a single RFQ TLS config, so I folded the price oracle and portfolio pilot's TLS configs together into a single RFQ TLS config. So instead of separate flags, à la:

  experimental.rfq.{priceoracletls,portfoliopilottls}.*

we just deal with a single one:

  experimental.rfq.tls.*

Second, I added basic macaroon auth to portfolio pilot, again bringing it up to scratch with what we support for price oracles. But I didn't fold these together, as it seems correct for each service to have its own macaroon auth.

Also includes some misc. cleanup of existing minor issues (e.g. switching away from that deprecated gRPC call). Note also that I'll harmonize the release note with the cleaned-up, feature-first notes I have on the v0.8 branch; just want it in a standard form here.

jtobin added 5 commits May 26, 2026 11:50
Bring the portfolio pilot RPC client in line with the price oracle: it
now takes an rfq.TLSConfig built from new
portfoliopilottls{disable,insecure,nosystemcas,certpath} flags and
reuses the existing configureTransportCredentials helper. Previously
the pilot dialed unconditionally with InsecureSkipVerify=true; the new
default is real TLS verification against system roots.
NewRpcPortfolioPilot now accepts an optional macaroon dial option,
sourced from a new portfoliopilotmacaroonpath flag. Validate rejects
a configured macaroon when pilot TLS is disabled, matching the price
oracle.
Replace the duplicated per-service TLS flag sets (priceoracletls* and
portfoliopilottls*) with a single shared rfq.TLSCliConfig embedded
under experimental.rfq.tls.*, consumed by both the price oracle and
portfolio pilot clients. Macaroon paths remain per-service since
macaroons are per-service identity tokens.

Also collapses the two getPriceOracleTLSConfig / getPortfolioPilotTLS-
Config helpers in tapcfg into one getRfqTLSConfig, drops the obsolete
default* constants for fields that are already zero-valued, and adds
CleanAndExpandPath for the portfolio pilot macaroon path (which was
missing the same treatment as the oracle macaroon path).

itest call sites updated to the new flag name.
Two small cleanups:

* Swap grpc.Dial (deprecated) for grpc.NewClient in the price oracle
  client, matching the portfolio pilot client.

* Reject macaroon paths set without a corresponding real service
  address (oracle: empty or mock; pilot: empty), since the macaroon
  would be silently read and never used.
@jtobin jtobin added this to the v0.8 milestone May 26, 2026
@jtobin jtobin requested review from darioAnongba and djkazic May 26, 2026 16:01
@jtobin jtobin self-assigned this May 26, 2026
@jtobin jtobin added mainnet preparedness Goal issues to be completed before mainnet release RFQ Work relating to TAP channel Request For Quote (RFQ). labels May 26, 2026
@jtobin jtobin removed the request for review from djkazic May 26, 2026 16:01
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request harmonizes the transport and authentication settings for RFQ-related gRPC services. By unifying the TLS configuration and extending macaroon authentication to the portfolio pilot, the changes improve consistency and security across the RFQ stack. The update also includes necessary adjustments to integration tests and documentation to reflect the new configuration structure.

Highlights

  • Unified RFQ TLS Configuration: Consolidated separate TLS configurations for the price oracle and portfolio pilot into a single shared 'experimental.rfq.tls.*' namespace.
  • Portfolio Pilot Macaroon Authentication: Added support for macaroon-based authentication to the portfolio pilot, aligning it with the existing price oracle security model.
  • Configuration Cleanup: Removed deprecated individual TLS flags in favor of the new unified namespace and updated validation logic to ensure macaroon paths are correctly associated with active services.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@jtobin

jtobin commented May 26, 2026

Copy link
Copy Markdown
Member Author

(Sorry @djkazic, accidental collateral tag.)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request extends TLS and macaroon authentication to the external portfolio pilot client and unifies the TLS configuration across both RFQ gRPC clients (price oracle and portfolio pilot) under a single shared experimental.rfq.tls.* namespace. One review comment was provided regarding a potential nil pointer dereference when configuring transport credentials for the portfolio pilot client.

Comment thread rfq/portfolio_pilot_rpc.go

@darioAnongba darioAnongba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with nits.

Comment thread rfq/cli.go Outdated
Comment thread rfq/oracle.go
@github-project-automation github-project-automation Bot moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board May 26, 2026
A macaroon is a bearer token, so sending it over a connection where
the server certificate isn't verified means anyone who can MITM the
connection (and present any cert, including self-signed) can capture
it. Tighten the validation to reject macaroon paths when either
tls.disable or tls.insecure is set.
@jtobin jtobin enabled auto-merge May 26, 2026 17:43
grpc.NewClient (which both RFQ clients now use) is stricter about
address parsing than the legacy grpc.Dial. The fmt.Sprintf form
\"%s:%s\" produces e.g. \"::1:8080\" for IPv6 literals, which the
modern resolver registry can mis-parse. net.JoinHostPort wraps IPv6
addresses in brackets per RFC 3986 (\"[::1]:8080\") and is a no-op
for IPv4/hostnames.
@jtobin jtobin added this pull request to the merge queue May 26, 2026
Merged via the queue into lightninglabs:main with commit 9b41d9c May 26, 2026
44 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mainnet preparedness Goal issues to be completed before mainnet release RFQ Work relating to TAP channel Request For Quote (RFQ).

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants