-
-
Notifications
You must be signed in to change notification settings - Fork 10
Add enode link URL endpoint #86
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
Codecov Report
@@ Coverage Diff @@
## h4i/enode #86 +/- ##
=============================================
+ Coverage 86.93% 91.97% +5.04%
=============================================
Files 9 8 -1
Lines 398 324 -74
=============================================
- Hits 346 298 -48
+ Misses 52 26 -26
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
with httpx.Client() as httpx_client: | ||
data = {"vendorType": "inverter", "redirectUri": redirect_uri} | ||
res = httpx_client.post( | ||
f"https://enode-api.production.enode.io/users/{client.client_uuid}/link", data=data | ||
).json() | ||
|
||
return res["linkUrl"] |
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.
Do you think we can just do this with a fastapi RedirectResponse?
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.
nevermind
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.
Opted for this in the end. On the frontend, we can just use a fetch
as usual, we just won't read the response body (Enode Link UI) and instead just history push the page to the Response.url
.
* Add enode link URL endpoint * Fix lint * Rename test var for clarity * Add comment to mock urls fixtuer * Use redirect response
* Add enode link URL endpoint * Fix lint * Rename test var for clarity * Add comment to mock urls fixtuer * Use redirect response
Pull Request
Description
Adds an endpoint for getting a valid Enode link URL for a user.
Fixes #72
Need to use env vars for Enode URLs, but coming in another PR
How Has This Been Tested?
Adds a test for both fake and mock Enode requests.
Checklist: