-
Notifications
You must be signed in to change notification settings - Fork 123
LSAT aware client interceptor #101
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
Conversation
1b53342
to
54a8ec0
Compare
90007e7
to
0727aa0
Compare
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.
Nice work! It's exciting how close we are to deploying LSAT for Loop! One thing that came up, but which shouldn't block this PR is adding a new loopd
-level RPC to allow the user to obtain and examine their current LSAT token. This may be useful for user support, and also just some insight into the user's current level, their tier, etc.
Should we also consider maintaining a history of all LSATs paid for accounting purposes? |
0727aa0
to
e663f1e
Compare
I updated the store to keep old tokens and not just overwrite them. The reason I implemented a file based token store is so people wanting to integrate the interceptor into their code base don't necessarily need a boltDB. |
e663f1e
to
e9f6f78
Compare
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 🐲
Left some final comments w.r.t updated godoc
comments as well as naming for the new command.
e9f6f78
to
8686dc4
Compare
f62c59c
to
0e96a9c
Compare
We need the ability to connect to a swap server that uses a self-signed certificate. The LSAT proxy cannot proxy insecure gRPC requests since they don't conform to the HTTP 1.1 standard. Therefore the LSAT proxy fill only serve TLS connections. This means, we need the TLS path option to specify the certificate the test environment LSAT proxy uses.
0e96a9c
to
54bca9a
Compare
8b3d2e6
to
a653f15
Compare
a653f15
to
b139209
Compare
023d79f
to
a15c993
Compare
Linter failing with:
|
6295aca
to
664508e
Compare
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.
This is pretty much good to go! Linter is failing again with:
lsat/interceptor.go:125: File is not `goimports`-ed (goimports)
// we know it's not valid.
664508e
to
1650f3a
Compare
Fixed last nits, this should be good to merge. @alexbosworth want to take a final look? |
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 🤺
Once we're ready on the server-side, we'll need to update the client to use our new proxy port.
This PR makes the loop daemon aware of the LSAT authentication scheme.
An unary client gRPC connector is added that intercepts server responses and handles payment challenges sent by the server.
An LSAT token is automatically acquired and paid by the interceptor and then stored in the file
.loop/<network>/lsat.token
.