Skip to content

Commit c28d53b

Browse files
committed
lint fix
1 parent 97236b4 commit c28d53b

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/middleware/withAuthorizedSpace.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ function extractSpaceDID (space) {
7676
export function withAuthorizedSpace (handler) {
7777
return async (request, env, ctx) => {
7878
const { locator, dataCid } = ctx
79-
79+
8080
console.log(`[withAuthorizedSpace] Locating content: ${dataCid}`)
8181
const locRes = await locator.locate(dataCid.multihash)
8282
if (locRes.error) {
83-
console.log(`[withAuthorizedSpace] Location failed:`, locRes.error)
83+
console.log('[withAuthorizedSpace] Location failed:', locRes.error)
8484
if (locRes.error.name === 'NotFound') {
8585
throw new HttpError('Not Found', { status: 404, cause: locRes.error })
8686
}
8787
throw new Error(`failed to locate: ${dataCid}`, { cause: locRes.error })
8888
}
8989

90-
console.log(`[withAuthorizedSpace] Location result:`, {
90+
console.log('[withAuthorizedSpace] Location result:', {
9191
sites: locRes.ok.site.length,
9292
spaces: locRes.ok.site.map(s => s.space).filter(Boolean)
9393
})
@@ -104,7 +104,7 @@ export function withAuthorizedSpace (handler) {
104104
ctx.authToken === null
105105

106106
if (shouldServeLegacy) {
107-
console.log(`[withAuthorizedSpace] Using legacy path (no space)`)
107+
console.log('[withAuthorizedSpace] Using legacy path (no space)')
108108
return handler(request, env, ctx)
109109
}
110110

@@ -122,7 +122,7 @@ export function withAuthorizedSpace (handler) {
122122
console.log(`Content found in ${uniqueSpaces.length} different spaces - egress tracking will be skipped`)
123123
console.log(`Spaces: ${uniqueSpaces.join(', ')}`)
124124
}
125-
125+
126126
console.log(`[withAuthorizedSpace] Found ${spaces.length} space(s):`, spaces)
127127

128128
try {
@@ -202,19 +202,18 @@ const authorize = async (space, ctx, env) => {
202202
return fail('The gateway is not authorized to serve this content.')
203203
}
204204

205-
206205
// Get the content serve authority (upload service) from environment
207206
// @ts-ignore - env has these properties from wrangler.toml
208207
// const contentServeAuthority =
209208
// env.CONTENT_SERVE_AUTHORITY_PUB_KEY && env.CONTENT_SERVE_AUTHORITY_DID
210-
// ?
209+
// ?
211210
// // @ts-ignore
212211
// Verifier.parse(env.CONTENT_SERVE_AUTHORITY_PUB_KEY).withDID(
213212
// // @ts-ignore
214213
// env.CONTENT_SERVE_AUTHORITY_DID
215214
// )
216215
// : ctx.gatewayIdentity
217-
216+
218217
// Create an invocation of the serve capability.
219218
const invocation = await serve.transportHttp
220219
.invoke({

src/middleware/withGatewayIdentity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function withGatewayIdentity (handler) {
2222
)
2323
return handler(req, env, {
2424
...ctx,
25-
gatewaySigner, //: gatewayIdentity,
25+
gatewaySigner, // : gatewayIdentity,
2626
gatewayIdentity
2727
})
2828
}

src/server/service.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { getValidatorProofs } from './index.js'
1515
* @returns {import('./api.types.js').Service<T>}
1616
*/
1717
export function createService (ctx, env) {
18-
1918
return {
2019
access: {
2120
delegate: UcantoServer.provideAdvanced({
@@ -44,7 +43,7 @@ export function createService (ctx, env) {
4443
{
4544
...context,
4645
authority: ctx.gatewayIdentity,
47-
proofs: [...validatorProofs],
46+
proofs: [...validatorProofs]
4847
}
4948
)
5049
if (validationResult.error) {

0 commit comments

Comments
 (0)