Skip to content

JSON-RPC Cache improvements (authorization in dispatcher, poll error metric fix)#858

Merged
dkeysil merged 3 commits intomasterfrom
jsonrpc-cache-improvements
Apr 4, 2024
Merged

JSON-RPC Cache improvements (authorization in dispatcher, poll error metric fix)#858
dkeysil merged 3 commits intomasterfrom
jsonrpc-cache-improvements

Conversation

@dkeysil
Copy link
Contributor

@dkeysil dkeysil commented Apr 3, 2024

  • I'm adding support of JWT authorization on dispatcher in blocksdata client
  • Poll error metric should be created as system metric

@dkeysil dkeysil requested a review from aomerk April 4, 2024 10:46
@dkeysil dkeysil merged commit a329087 into master Apr 4, 2024
@dkeysil dkeysil deleted the jsonrpc-cache-improvements branch April 4, 2024 11:04
b, err := io.ReadAll(resp.Body)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", scannerJwt))

resp, err := httpclient.Default.Get(dispatcherUrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

no one uses the request....

Copy link
Contributor

Choose a reason for hiding this comment

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

it should be http.DefaultClient.Do(req)

Copy link
Contributor

Choose a reason for hiding this comment

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

(Please note the difference between httpclient.Default and http.DefaultClient - the former is from our core repo and has some defaults.)

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, the constructed request is not used and therefore the requests don't have the auth bearer header - client is making a generic GET call to dispatcher

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.

3 participants