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

fix: gateway conformance improvements #85

Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb50c3e
feat: resolve IPFS_NS_MAP with @multiformats/dns
SgtPooki May 21, 2024
cb724f4
fix: various fixes to gateway conformance
SgtPooki May 21, 2024
b3019ad
fix: gateway-conformance expects 301 to path
SgtPooki May 21, 2024
38839ed
fix: gateway conformance subdomain handling
SgtPooki May 21, 2024
95fff64
fix: more testgatewaysubdomain passing tests
SgtPooki May 21, 2024
bce2239
fix: more testgatewaysubdomain passing tests
SgtPooki May 21, 2024
1b96aa2
fix: some redirect and url parsing
SgtPooki May 22, 2024
cd9db44
test: make sure test constructs proper unixfs data
SgtPooki May 22, 2024
b329b2d
fix: more gwc improvements for testgatewaysubdomains
SgtPooki May 22, 2024
ba5f6a0
test: some adjustments of default tests enabled
SgtPooki May 22, 2024
58d6835
test: adjust total success expectation
SgtPooki May 22, 2024
e3c11bd
test: update latest sucess rates
SgtPooki May 22, 2024
ddd6900
test: update 'all' test success rate and remove reverse proxy
SgtPooki May 22, 2024
39ceb6d
fix: pass datastore and blockstore to helia instance
SgtPooki May 22, 2024
93c1ca5
chore: lint fix and header types
SgtPooki May 22, 2024
8307ec0
deps: update deps
SgtPooki May 22, 2024
d017874
Merge branch 'main' into 84-fix-infinite-querying-bug-reproducible-on…
SgtPooki May 22, 2024
03ac442
chore: modify log prefixes slightly
SgtPooki May 23, 2024
3abd960
chore: cleanup and re-enable tests not timing out
SgtPooki May 23, 2024
d2dbb62
fix: pull out fetch->nodejs header logic
SgtPooki May 23, 2024
a5c2e83
chore: apply suggestions from code review
SgtPooki May 23, 2024
d5c44df
chore: lint fix after gh pr suggestions
SgtPooki May 23, 2024
e5d6ae4
chore: apply suggestions from code review
SgtPooki May 24, 2024
967a4e3
chore: apply suggestions from code review
SgtPooki May 24, 2024
2be475c
test: add handle-redirects tests
SgtPooki May 24, 2024
f9bfa62
chore: fix build after applying pr suggestions
SgtPooki May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"docs:no-publish": "aegir docs --publish false"
},
"devDependencies": {
"aegir": "^42.2.5",
"aegir": "^42.2.11",
"npm-run-all": "^4.1.5"
},
"type": "module",
Expand Down
28 changes: 13 additions & 15 deletions packages/gateway-conformance/.aegir.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @ts-check
import getPort from 'aegir/get-port'
import { logger } from '@libp2p/logger'
const log = logger('aegir')

/** @type {import('aegir').PartialOptions} */
export default {
Expand All @@ -12,50 +14,46 @@ export default {

const { createKuboNode } = await import('./dist/src/fixtures/create-kubo.js')
const KUBO_PORT = await getPort(3440)
const SERVER_PORT = await getPort(3441)
const { node: controller, gatewayUrl, repoPath } = await createKuboNode(KUBO_PORT)
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
await controller.start()
const { loadKuboFixtures } = await import('./dist/src/fixtures/kubo-mgmt.js')
const IPFS_NS_MAP = await loadKuboFixtures(repoPath)
const kuboGateway = gatewayUrl

const { startBasicServer } = await import('./dist/src/fixtures/basic-server.js')
const SERVER_PORT = await getPort(3441)
const stopBasicServer = await startBasicServer({
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
serverPort: SERVER_PORT,
kuboGateway
})

const { startReverseProxy } = await import('./dist/src/fixtures/reverse-proxy.js')
const PROXY_PORT = await getPort(3442)
const stopReverseProxy = await startReverseProxy({
backendPort: SERVER_PORT,
targetHost: 'localhost',
proxyPort: PROXY_PORT
kuboGateway,
IPFS_NS_MAP
}).catch((err) => {
log.error(err)
})

const CONFORMANCE_HOST = 'localhost'

return {
controller,
stopReverseProxy,
stopBasicServer,
env: {
IPFS_NS_MAP,
CONFORMANCE_HOST,
KUBO_PORT: `${KUBO_PORT}`,
PROXY_PORT: `${PROXY_PORT}`,
SERVER_PORT: `${SERVER_PORT}`,
KUBO_GATEWAY: kuboGateway
}
}
},
after: async (options, beforeResult) => {
log('aegir test after hook')
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
// @ts-expect-error - broken aegir types
await beforeResult.stopReverseProxy()
await beforeResult.controller.stop()
log('controller stopped')

// @ts-expect-error - broken aegir types
await beforeResult.stopBasicServer()
// @ts-expect-error - broken aegir types
await beforeResult.controller.stop()
log('basic server stopped')

}
}
}
22 changes: 17 additions & 5 deletions packages/gateway-conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,29 @@
"test": "aegir test -t node"
},
"dependencies": {
"@helia/block-brokers": "^3.0.1",
"@helia/http": "^1.0.8",
"@helia/interface": "^4.3.0",
"@helia/routers": "^1.1.0",
"@helia/verified-fetch": "1.4.2",
"@libp2p/logger": "^4.0.11",
"@libp2p/kad-dht": "^12.0.17",
"@libp2p/logger": "^4.0.13",
"@libp2p/peer-id": "^4.1.2",
"@multiformats/dns": "^1.0.6",
"@sgtpooki/file-type": "^1.0.1",
"aegir": "^42.2.5",
"execa": "^8.0.1",
"aegir": "^42.2.11",
"blockstore-core": "^4.4.1",
"datastore-core": "^9.2.9",
"execa": "^9.1.0",
"fast-glob": "^3.3.2",
"interface-blockstore": "^5.2.10",
"interface-datastore": "^8.2.11",
"ipfsd-ctl": "^14.1.0",
"kubo": "^0.27.0",
"ipns": "^9.1.0",
"kubo": "^0.28.0",
"kubo-rpc-client": "^4.1.1",
"undici": "^6.15.0"
"uint8arrays": "^5.1.0",
"undici": "^6.18.1"
},
"browser": {
"./dist/src/fixtures/create-kubo.js": "./dist/src/fixtures/create-kubo.browser.js",
Expand Down
Loading
Loading