-
Notifications
You must be signed in to change notification settings - Fork 8
fix: STOREFRONT_PROOF is a secret #545
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
base: main
Are you sure you want to change the base?
Conversation
View stack outputs
|
| let id = getServiceSigner({ | ||
| privateKey | ||
| }) | ||
| const storefrontServiceProofs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the proof is parsed but then it's not used anywhere. I guess it should go in the context object below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩 yeah it's going to require changes in storefrontEvents.handleCronTick to accept the proof. It needs the proof so that effect it creates has the correct CID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also do id = id.withDID(DID.parse(did).did()) regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩 yeah it's going to require changes in storefrontEvents.handleCronTick to accept the proof. It needs the proof so that effect it creates has the correct CID.
I just understood this comment 😞
| let storefrontSigner = getServiceSigner({ | ||
| privateKey | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? Shouldn't this have the upload service's DID if we are using a proof?
| issuer: storefrontSigner, | ||
| with: storefrontSigner.did(), | ||
| audience: storefrontSigner, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, ok, so I guess we need both the aggregator service's DID and the upload service's DID to fix this invocation config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the proof should be a proof for the uplaod service to use the aggregator and the aggregator DID needs to be the audience.
hannahhoward
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM by me
alanshaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a consistency POV I like this, but really the only reason the other proofs are secrets is because of the environment variable size limit which we are close to with the ucan-invocation-router.js lambda. We are not anywhere near that limit for these other lambdas so it is not really necessary.
If we do this, I would rather that we combine it with renaming the variable more appropriately. It should be named after the service it is used with, not the service that is using it (otherwise all proofs would be "storefront"/"upload service"!). This is already confused in the code here.
Unfortunately there is a bunch more work here than just moving an environment variable to secrets.
| let id = getServiceSigner({ | ||
| privateKey | ||
| }) | ||
| const storefrontServiceProofs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩 yeah it's going to require changes in storefrontEvents.handleCronTick to accept the proof. It needs the proof so that effect it creates has the correct CID.
| let id = getServiceSigner({ | ||
| privateKey | ||
| }) | ||
| const storefrontServiceProofs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also do id = id.withDID(DID.parse(did).did()) regardless.
| issuer: storefrontSigner, | ||
| with: storefrontSigner.did(), | ||
| audience: storefrontSigner, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the proof should be a proof for the uplaod service to use the aggregator and the aggregator DID needs to be the audience.
It wasn't clear to me that I'm working on this. |
901f47a to
5b1064e
Compare
|
@alanshaw I renamed STOREFRONT_PROOF to AGGREGATOR_SERVICE_PROOF and wired it where needed. The rest of the work required to pass the aggregator proof down is in storacha/upload-service#570. There were also some functions getting a storefront proof, which allows using a storefront service that is not the upload service. I removed this possibility for now to simplify the code because we are not using it today. If you think we need that flexibility, let me know and I'll implement it properly. |
These changes require storacha/upload-service#570 to land first.
Handle
STOREFRONT_PROOFas a secret rather than an environment variable.Also, I noticed that some of the functions that were referencing the proof were not actually having it passed when defined in the stack, so I bound the secret to their configs.
Finally, the STOREFRONT_PROOF was renamed to AGGREGATOR_SERVICE_PROOF, as that aligns with what it actually is. I also removed the storefront proof from everywhere, based on the assumption that the storefront service will always be the upload service. Thus, invocations to the storefront service (the
filecoin/*family of capabilities) are self-signed by the upload service and require no proofs.