Skip to content

Commit

Permalink
chore: remove jwt auth as not used within eth_ RPC calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed May 15, 2024
1 parent 49352c5 commit 32bfef2
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/ethereum_test_tools/rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
JSON-RPC methods and helper functions for EEST consume based hive simulators.
"""

import time
from typing import Dict, List

import requests
from jwt import encode
from tenacity import retry, stop_after_attempt, wait_exponential

from ethereum_test_tools import Address
Expand All @@ -22,16 +20,6 @@ class BaseRPC:
def __init__(self, client):
self.client = client
self.url = f"http://{client.ip}:8551"
self.jwt_secret = (
b"secretsecretsecretsecretsecretse" # oh wow, guess its not a secret anymore
)

def generate_jwt_token(self):
"""
Generates a JWT token based on the issued at timestamp and JWT secret.
"""
iat = int(time.time())
return encode({"iat": iat}, self.jwt_secret, algorithm="HS256")

@retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, max=10))
def post_request(self, method, params):
Expand All @@ -46,7 +34,6 @@ def post_request(self, method, params):
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {self.generate_jwt_token()}",
}

response = requests.post(self.url, json=payload, headers=headers)
Expand Down

0 comments on commit 32bfef2

Please sign in to comment.