Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support custom config for ipfs-http-client #24

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Sep 9, 2020

This adds tests and hardening necessary for passing an object with custom config for ipfs-http-client in apiAddress.
It is useful if API is protected by basic auth, bearer token or custom HTTP header.

Goal is to make ipfs/ipfs-webui#1613 more future-proof.

This adds tests for passing an object with custom config for
ipfs-http-client. It is useful if API is protected by basic auth, bearer
token or custom HTTP header.

License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
// Returns js-ipfs-http-client instance or null
async function maybeApi ({ apiAddress, connectionTest, httpClient }) {
try {
const ipfs = httpClient(apiAddress)
const ipfs = httpClient(copyIfObject(apiAddress))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👉 This is literally the only code change in this PR, everything else is docs and updated comments. :-)

@lidel lidel marked this pull request as ready for review September 9, 2020 09:28
Making it work with latest JS API

License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
@lidel lidel merged commit 319ba34 into master Sep 9, 2020
@lidel lidel deleted the feat/basic-auth-support branch September 9, 2020 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant