Skip to content
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

Feature/enable custom headers #220

Conversation

sidohin-felix
Copy link

  • Fixes issue for HTTPS hosts by forcing https scheme on port 443
  • Allows passing custom headers, in the case the node provider is using headers as a protection mechanism
  • Fixes serialization bug of EC keys (which are of length 34 not 33)

@meywood meywood self-requested a review March 13, 2024 17:32
Copy link
Collaborator

@meywood meywood left a comment

Choose a reason for hiding this comment

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

Hi @sidohin-felix thank you so much for your feedback and suggested changes. We have finally resolved the issue with key desirlaization in the following PR #255 and will be closing your PR.
Thanks again!

@@ -54,9 +54,28 @@ static CasperService usingPeer(String ip, int port) throws MalformedURLException
CasperObjectMapper objectMapper = new CasperObjectMapper();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for this. Would probably be better to refactor and provide a URL as a parameter here rather than guessing 443 is for HTTPS to allow for non-standard ports. I'll refactor for next release to support this

Copy link
Collaborator

Choose a reason for hiding this comment

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

This issues is resolved in issues/245 there is a new method in casper service:
static CasperService usingPeer(URL url, final Map<String, String> additionalHeaders) throws MalformedURLException

@@ -68,7 +70,23 @@ public void serialize(SerializerBuffer ser, Target target) throws NoSuchTypeExce

@Override
public void deserializeCustom(DeserializerBuffer deser) throws Exception {
this.setValue(PublicKey.fromTaggedHexString(ByteUtils.encodeHexString(deser.readByteArray(33))));
byte[] publicKey;
switch (deser.readByteArray(1)[0]){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please provide tests for any changes that are submitted.

@meywood meywood closed this Mar 13, 2024
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.

2 participants