Ethers.js: Add support for Infura Project Secrets

Created on 20 Mar 2019  路  3Comments  路  Source: ethers-io/ethers.js

Infura has added support for an optional project secret to their API.

From https://infura.io/docs/gettingStarted/authentication
"As additional protection for your request traffic, you should use HTTP Basic Authentication to access our API when you are able to ensure the confidentiality of the Project Secret:"

curl --user :YOUR-PROJECT-SECRET \
  https://<network>.infura.io/v3/YOUR-PROJECT-ID

It'd be good if the InfuraProvider construction could take an optional project secret argument that is used to do the HTTP Basic Authentication.

Thanks
Nick

enhancement

Most helpful comment

Good catch, I had not noticed that you could use that for authentication.

I'll add it soon. :)

All 3 comments

Good catch, I had not noticed that you could use that for authentication.

I'll add it soon. :)

I've added a PR to add this functionality. Please take a look and let me know what you think.

This was added a while ago to v5. I'm going to close this issue now, but if you have any problems, please re-open, or create a new issues.

Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dagogodboss picture dagogodboss  路  3Comments

adamdossa picture adamdossa  路  3Comments

abhishekp1996 picture abhishekp1996  路  3Comments

ricmoo picture ricmoo  路  3Comments

thegostep picture thegostep  路  3Comments