Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Delegate storage auth on market nodes #8978

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Jul 6, 2022

Currently on market nodes all APIs are behind the market API auth, which can be backed by an API secret that's different from the one on the main lotus-miner storage node.

This is for the most part fine, but breaks if there are storage paths attached to the market node - this is because the storage subsystem assumes that all http auth is backed by the same api secret. Storage on workers just delegates auth to the main storage node to keep the api secret in one place.

This PR implements similar mechanism for lotus market nodes.

(boost may need to backport this tho I'm not sure if they support attaching storage paths)

@magik6k magik6k requested a review from a team as a code owner July 6, 2022 20:29
@@ -97,6 +98,9 @@ type StorageMinerAPI struct {
Epp gen.WinningPoStProver `optional:"true"`
DS dtypes.MetadataDS

// StorageService is populated when we're not the main storage node (e.g. we're a markets node)
StorageService modules.MinerStorageService `optional:"true"`
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this get set. I'm guessing there's DI magic but I don't see the field being set or an explicit config to initialize this which I kind of expect since its optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The StorageMinerAPI struct is filled through fx.Extract, with each field being field individually thanks to the fx.In "trait" on the struct. optional tells Fx to not fail if a constructor for modules.MinerStorageService doesn't exist in the DI container - instead it leaves it not set (nil).

@magik6k magik6k merged commit d9311b2 into master Jul 11, 2022
@magik6k magik6k deleted the fix/marketnode-storageauth branch July 11, 2022 10:23
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.

2 participants