Skip to content

Commit

Permalink
Delete hand-made auth, not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Aug 10, 2023
1 parent 647c316 commit e162cf6
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions actions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,11 @@ export async function getProvider(
() => undefined
);
const providerConfig: ConnectionInfo =
user && password
? {
url,
// TODO: This is a hack to make it work for HTTP endpoints (while we don't have a HTTPS one for Gnosis Chain), however I will delete once we have it
headers: {
Authorization: getAuthHeader({ user, password }),
},
// user: await getSecret(`NODE_USER_${network}`, context),
// password: await getSecret(`NODE_PASSWORD_${network}`, context),
}
: { url };
user && password ? { url, user, password } : { url };

return new ethers.providers.JsonRpcProvider(providerConfig);
}

function getAuthHeader({ user, password }: { user: string; password: string }) {
return "Basic " + Buffer.from(`${user}:${password}`).toString("base64");
}

export function apiUrl(network: string): string {
switch (network) {
case "1":
Expand Down

0 comments on commit e162cf6

Please sign in to comment.