-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I'm building ... well ... a data hub. Some clients will publish private Frictionless datasets, and they'll want tools to read them.
I see no docs on frictionlessdata.io concerning this pattern. So as a brainstorm idea, perhaps let the user define an HTTP transport:
const data = require('frictionless.js')
async function customFetch(options) {
return http.request({ ...options, headers: { 'Authentication': 'Basic abcdef' } })
}
const pathOrDescriptor = 'https://paid-service.com/all-my-secrets/datapackage.json'
const dataset = await data.Dataset.load(pathOrDescriptor, { customFetch })Prior work: Here are some approaches for supporting a zillion HTTP servers:
- Elastic client has an options Object, allowing headers and client-side SSL cert; but no way to add JWT or OAuth tokens: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html
- Apollo (GraphQL client) has an
HttpLinkclass that abstractsFetch: https://www.apollographql.com/docs/react/networking/advanced-http-networking/ - Relay (another GraphQL client) directs you to write your own
fetchQuery()function: https://relay.dev/docs/guides/network-layer/
As a user, I find the Relay approach the most intuitive.
(These clients are all browser-native, so the use cases are a bit different.)
Metadata
Metadata
Assignees
Labels
No labels