rfq: add macaroon option for price oracle authentication#1978
rfq: add macaroon option for price oracle authentication#1978jtobin merged 4 commits intolightninglabs:mainfrom
Conversation
Summary of ChangesHello @jtobin, 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 significantly upgrades the security and flexibility of how the Highlights
🧠 New Feature in Public Preview: You can now enable Memory 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. Changelog
Activity
Using Gemini Code AssistThe 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
Customization To customize 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully adds support for macaroon authentication with the price oracle. The changes are well-structured, with new functionality for handling macaroons and TLS configuration neatly encapsulated in their own files (rfq/macaroon.go, rfq/tls.go). The addition of validation to ensure macaroons are only used with TLS enabled is a good security measure. The test coverage for the new components is thorough. The refactoring of rfq.NewRpcPriceOracle to accept TLS and macaroon options makes the code cleaner and more modular. Overall, this is a high-quality contribution. I have one minor suggestion regarding a comment in the sample configuration file for improved clarity.
Pull Request Test Coverage Report for Build 21947686123Details
💛 - Coveralls |
Add support for authenticating the price oracle gRPC client with a macaroon. This allows tapd node operators to secure their price oracle connections on non-private networks. - add NewMacaroonDialOption helper to read a macaroon from disk and convert it to a gRPC per-RPC credential - add PriceOracleMacaroonPath field to CliConfig - extend NewRpcPriceOracle to accept an optional macaroon dial option via fn.Option[grpc.DialOption] - add table-driven tests for NewMacaroonDialOption Refs: lightninglabs#1370 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
(Note that the lit itest failure in CI is fixed by lightninglabs/lightning-terminal#1190.) |
darioAnongba
left a comment
There was a problem hiding this comment.
Only need to address the Gemini comment.
- expand PriceOracleMacaroonPath in ExperimentalConfig.CleanAndValidate - add getPriceOracleMacaroonOpt helper to load the macaroon and return it as fn.Option[grpc.DialOption] - pass macaroon option to NewRpcPriceOracle in genServerConfig - document new flag in sample-tapd.conf Refs: lightninglabs#1370 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
A macaroon credential requires transport security. Validate this up front in CliConfig.Validate so users get a clear config error rather than a cryptic gRPC dial failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3a93d1f
Resolves #1370.
Adds support to tapd for macaroon authentication with a price oracle. This is based on (and requires) #1775, and simply adds the requisite plumbing in the appropriate places.