near / near-cli

General purpose command line tools for interacting with NEAR Protocol
https://docs.near.org
MIT License
193 stars 91 forks source link

fix: move x-api-key logic to middlewares #1052

Closed xilosada closed 1 year ago

xilosada commented 1 year ago

fixes #1051 The current implementation of the Near CLI that sets the x-api-key value in the yargs config. This approach ignores the nodeUrl option passed to the commands. It makes it difficult to manage custom RPCs since the x-api-key is bound to the nodeUrl in the config.

The proposed solution sets the x-api-key value in a middleware instead of the config file. This middleware applies the actual nodeUrl value passed to the command.

volovyks commented 1 year ago

No objections here, but I want to see green CI. We need to setup tests for external contributors (I do not have the rights). I will ping somebody to change it.

chefsale commented 1 year ago

@volovyks any update on this one :)

ailisp commented 1 year ago

Hi @xilosada we just enabled ci for PR from fork. Please merge current master to your branch and that will trigger CI!

ailisp commented 1 year ago

Nice fix! Thank you @xilosada!