Skip to content

Commit

Permalink
Support RPC node custom authentication methods
Browse files Browse the repository at this point in the history
  • Loading branch information
use-strict committed Apr 29, 2020
1 parent 7f254c2 commit d88a7d9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]
## [1.0.0-beta.10] - 2020-04-29

- Update to @alethio/cms@1.0.0-beta.12 (which adds support for plugin data source dependencies)
- Update `eth-lite` plugin version to 4.2.0 (support for custom rpc node auth methods)

## [1.0.0-beta.9] - 2020-04-21

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN npm run build --verbose

RUN acp install \
@alethio/explorer-plugin-eth-common@4.0.0 \
@alethio/explorer-plugin-eth-lite@4.1.0 \
@alethio/explorer-plugin-eth-lite@4.2.0 \
@alethio/explorer-plugin-eth-memento@2.0.2 \
@alethio/explorer-plugin-eth-ibft2@2.0.0 \
@alethio/explorer-plugin-3box@1.1.1
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ No need for servers, hosting or trusting any third parties to display chain data
- [Use a custom ETH currency symbol](#use-a-custom-eth-currency-symbol)
- [Show the transactions per account in account page](#show-the-transactions-per-account-in-account-page)
- [Override specific text strings (translations)](#override-specific-text-strings-translations)
- [Use a custom RPC node authentication method](#use-a-custom-rpc-node-authentication-method)

<!-- /TOC -->
- [Contributing](CONTRIBUTING.md)
Expand Down Expand Up @@ -484,3 +485,9 @@ You can customize texts for each plugin by overriding the corresponding translat
```

You can refer to individual translation keys in the core plugins repo. Follow [this link](https://github.com/Alethio/explorer-core-plugins/tree/master/src/app/eth-lite/translation) for the eth-lite plugin translations and [this one](https://github.com/Alethio/explorer-core-plugins/tree/master/src/app/eth-common/translation) for eth-common plugin translations.

### Use a custom RPC node authentication method

If your RPC node requires a custom authentication step (e.g. Besu), the `eth-lite` plugin supports initialization hooks for the purpose of injecting authorization headers into the web3 instance. You will need to create a plugin that handles the authentication steps (e.g. collects credentials via a login form or 3rd party page redirect). The plugin will export a data adapter returning an object that follows the [IAuthStore](https://github.com/Alethio/explorer-core-plugins/blob/master/src/app/eth-lite/IAuthStore.ts) interface definition. The public URI for that adapter is passed to the `eth-lite` plugin config via the [authStoreUri](https://github.com/Alethio/explorer-core-plugins/blob/master/src/app/eth-lite/EthLitePluginConfig.ts#L14) key. This will pause the initialization of the `eth-lite` plugin until the authentication is handled.

Check out this Besu plugin as an example: https://www.npmjs.com/package/@adetante/explorer-besu-plugin
2 changes: 1 addition & 1 deletion config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ipfsUrlMask": "https://ipfs.infura.io/ipfs/%s"
}
}, {
"uri": "plugin://aleth.io/eth-lite?v=4.1.0",
"uri": "plugin://aleth.io/eth-lite?v=4.2.0",
"config": {
"nodeUrl": "https://mainnet.infura.io/"
}
Expand Down
2 changes: 1 addition & 1 deletion config.ibft2.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ipfsUrlMask": "https://ipfs.infura.io/ipfs/%s"
}
}, {
"uri": "plugin://aleth.io/eth-lite?v=4.1.0",
"uri": "plugin://aleth.io/eth-lite?v=4.2.0",
"config": {
"nodeUrl": "https://mainnet.infura.io/"
}
Expand Down

0 comments on commit d88a7d9

Please sign in to comment.