Node authenticated endpoint - #5349
Conversation
| request, err := m.newRequestJSON(http.MethodGet, fmt.Sprintf("providers/statuses?provider_id=%s", providerID), "") | ||
| id := identity.Identity{Address: providerID} | ||
|
|
||
| request, err := requests.NewSignedGetRequest(m.baseURL, fmt.Sprintf("providers/auth-statuses?provider_id=%s", providerID), m.signer(id)) |
There was a problem hiding this comment.
Just something interesting to mention, might be useful for the future: you should now be able to upgrade the API so that you would no longer need to send the provider_id field in URL as you can extract the signer from signature. Obviously you cannot do that now as that would probably break the API.
There was a problem hiding this comment.
Yes, you are right. In side effect of auth we can get it inside signature in context
There was a problem hiding this comment.
yep, let's just use the identity from the signature, it should not be possible to pass anything except it.
| // ProviderStatuses fetch provider connectivity statuses from quality oracle. | ||
| func (m *MysteriumMORQA) ProviderStatuses(providerID string) (node.MonitoringAgentStatuses, error) { | ||
| request, err := m.newRequestJSON(http.MethodGet, fmt.Sprintf("providers/statuses?provider_id=%s", providerID), "") | ||
| id := identity.Identity{Address: providerID} |
There was a problem hiding this comment.
We got a function for this: identity.FromAddress(providerID)
|
Also another thing to mention. This PR has 3 commits, 2 of the are useless and 3rd is editing them. Please fix the commits properly before creating a PR. Commits should help to review, they aren't meant to track your development progress. This could have easily been a single commit. |
No description provided.