From 5f414b0eb2847c124802278c1af0c307d0ca8072 Mon Sep 17 00:00:00 2001 From: Felipe Forbeck Date: Mon, 2 Dec 2024 10:46:17 -0300 Subject: [PATCH] reviewer suggestions implemented --- packages/w3up-client/src/client.js | 59 +++++----- packages/w3up-client/test/account.test.js | 10 +- .../test/capability/access.test.js | 2 +- .../w3up-client/test/capability/blob.test.js | 8 +- .../test/capability/filecoin.test.js | 4 +- .../w3up-client/test/capability/index.test.js | 2 +- .../w3up-client/test/capability/space.test.js | 12 +- .../w3up-client/test/capability/store.test.js | 8 +- .../test/capability/subscription.test.js | 2 +- .../test/capability/upload.test.js | 8 +- .../w3up-client/test/capability/usage.test.js | 4 +- packages/w3up-client/test/client.test.js | 104 +++++------------- packages/w3up-client/test/coupon.test.js | 2 +- packages/w3up-client/test/space.test.js | 2 +- 14 files changed, 83 insertions(+), 144 deletions(-) diff --git a/packages/w3up-client/src/client.js b/packages/w3up-client/src/client.js index 982a4ece2..b331449a3 100644 --- a/packages/w3up-client/src/client.js +++ b/packages/w3up-client/src/client.js @@ -248,20 +248,20 @@ export class Client extends Base { } /** - * Create a new space with a given name. + * Creates a new space with a given name. * If an account is not provided, the space is created without any delegation and is not saved, hence it is a temporary space. * When an account is provided in the options argument, then it creates a delegated recovery account * by provisioning the space, saving it and then delegating access to the recovery account. - * In addition, it authorizes the listed Content Serve Services to serve content from the created space. - * It is done by delegating the `space/content/serve/*` capability to the Content Serve Service. - * User can skip the Content Serve authorization by setting the `skipContentServeAuthorization` option to `true`. + * In addition, it authorizes the listed Gateway Services to serve content from the created space. + * It is done by delegating the `space/content/serve/*` capability to the Gateway Service. + * User can skip the Gateway authorization by setting the `skipGatewayAuthorization` option to `true`. + * + * @typedef {import('./types.js').ConnectionView} ConnectionView * * @typedef {object} SpaceCreateOptions - * @property {boolean} [skipContentServeAuthorization] - Whether to skip the Content Serve authorization. It means that the content of the space will not be served by any Content Serve Service. - * @property {`did:${string}:${string}`[]} [authorizeContentServeServices] - The DID Key or DID Web of the Content Serve Service to authorize to serve content from the created space. - * @property {import('./types.js').ConnectionView} [connection] - The connection to the Content Serve Service that will handle, validate, and store the access/delegate UCAN invocation. * @property {Account.Account} [account] - The account configured as the recovery account for the space. - * @property {string} [name] - The name of the space to create. + * @property {Array} [authorizeGatewayServices] - The DID Key or DID Web of the Gateway to authorize to serve content from the created space. + * @property {boolean} [skipGatewayAuthorization] - Whether to skip the Gateway authorization. It means that the content of the space will not be served by any Gateway. * * @param {string} name - The name of the space to create. * @param {SpaceCreateOptions} options - Options for the space creation. @@ -289,41 +289,32 @@ export class Client extends Base { const recovery = await space.createRecovery(account.did()) // Delegate space access to the recovery - const result = await this.capability.access.delegate({ + const delegationResult = await this.capability.access.delegate({ space: space.did(), delegations: [recovery], }) - if (result.error) { + if (delegationResult.error) { throw new Error( - `failed to authorize recovery account: ${result.error.message}`, - { cause: result.error } + `failed to authorize recovery account: ${delegationResult.error.message}`, + { cause: delegationResult.error } ) } } - // Authorize the listed Content Serve Services to serve content from the created space - if (options.skipContentServeAuthorization !== true) { + // Authorize the listed Gateway Services to serve content from the created space + if (options.skipGatewayAuthorization !== true) { if ( - !options.authorizeContentServeServices || - options.authorizeContentServeServices.length === 0 + !options.authorizeGatewayServices || + options.authorizeGatewayServices.length === 0 ) { throw new Error( - 'failed to authorize Content Serve Services: missing option' - ) - } - - if (!options.connection) { - throw new Error( - 'failed to authorize Content Serve Services: missing option' + 'failed to authorize Gateway Services: missing option' ) } - for (const service of options.authorizeContentServeServices) { - await this.authorizeContentServe(space, { - audience: service, - connection: options.connection, - }) + for (const serviceConnection of options.authorizeGatewayServices) { + await this.authorizeContentServe(space, serviceConnection) } } @@ -337,12 +328,12 @@ export class Client extends Base { * - `space/content/serve/*` * * @param {import('./types.js').OwnedSpace} space - The space to authorize the audience for. - * @param {object} options - Options for the authorization. - * @param {`did:${string}:${string}`} options.audience - The Web DID of the audience (gateway or peer) to authorize. - * @param {import('./types.js').ConnectionView} options.connection - The connection to the Content Serve Service that will handle, validate, and store the access/delegate UCAN invocation. + * @param {import('./types.js').ConnectionView} connection - The connection to the Content Serve Service that will handle, validate, and store the access/delegate UCAN invocation. + * @param {object} [options] - Options for the content serve authorization invocation. + * @param {`did:${string}:${string}`} [options.audience] - The Web DID of the audience (gateway or peer) to authorize. * @param {number} [options.expiration] - The time at which the delegation expires in seconds from unix epoch. */ - async authorizeContentServe(space, options) { + async authorizeContentServe(space, connection, options = {}) { const currentSpace = this.currentSpace() try { // Set the current space to the space we are authorizing the gateway for, otherwise the delegation will fail @@ -350,7 +341,7 @@ export class Client extends Base { /** @type {import('@ucanto/client').Principal<`did:${string}:${string}`>} */ const audience = { - did: () => options.audience, + did: () => options.audience ?? connection.id.did(), } // Grant the audience the ability to serve content from the space, it includes existing proofs automatically @@ -378,7 +369,7 @@ export class Client extends Base { }, }, }) - .execute(options.connection) + .execute(connection) /* c8 ignore next 8 - can't mock this error */ if (verificationResult.out.error) { diff --git a/packages/w3up-client/test/account.test.js b/packages/w3up-client/test/account.test.js index 0278c527b..154e43e5b 100644 --- a/packages/w3up-client/test/account.test.js +++ b/packages/w3up-client/test/account.test.js @@ -112,7 +112,7 @@ export const testAccount = Test.withContext({ { client, mail, grantAccess } ) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const mnemonic = space.toMnemonic() const { signer } = await Space.fromMnemonic(mnemonic, { name: 'import' }) @@ -150,7 +150,7 @@ export const testAccount = Test.withContext({ 'multi device workflow': async (asserts, { connect, mail, grantAccess }) => { const laptop = await connect() const space = await laptop.createSpace('main', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) // want to provision space ? @@ -188,7 +188,7 @@ export const testAccount = Test.withContext({ }, 'setup recovery': async (assert, { client, mail, grantAccess }) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const email = 'alice@web.mail' @@ -287,7 +287,7 @@ export const testAccount = Test.withContext({ { client, mail, grantAccess } ) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const email = 'alice@web.mail' @@ -309,7 +309,7 @@ export const testAccount = Test.withContext({ 'space.save': async (assert, { client }) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.deepEqual(client.spaces(), []) diff --git a/packages/w3up-client/test/capability/access.test.js b/packages/w3up-client/test/capability/access.test.js index 938bb05b7..baf6add3d 100644 --- a/packages/w3up-client/test/capability/access.test.js +++ b/packages/w3up-client/test/capability/access.test.js @@ -31,7 +31,7 @@ export const AccessClient = Test.withContext({ }) const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/blob.test.js b/packages/w3up-client/test/capability/blob.test.js index 7e5f9481e..6c0d21470 100644 --- a/packages/w3up-client/test/capability/blob.test.js +++ b/packages/w3up-client/test/capability/blob.test.js @@ -20,7 +20,7 @@ export const BlobClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -59,7 +59,7 @@ export const BlobClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -99,7 +99,7 @@ export const BlobClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -133,7 +133,7 @@ export const BlobClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/filecoin.test.js b/packages/w3up-client/test/capability/filecoin.test.js index c8795171a..7d51d4c78 100644 --- a/packages/w3up-client/test/capability/filecoin.test.js +++ b/packages/w3up-client/test/capability/filecoin.test.js @@ -6,7 +6,7 @@ export const FilecoinClient = Test.withContext({ offer: { 'should send an offer': async (assert, { client: alice }) => { const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -39,7 +39,7 @@ export const FilecoinClient = Test.withContext({ } const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/index.test.js b/packages/w3up-client/test/capability/index.test.js index 3dbd4f4bf..1e4bdc0a4 100644 --- a/packages/w3up-client/test/capability/index.test.js +++ b/packages/w3up-client/test/capability/index.test.js @@ -15,7 +15,7 @@ export const IndexClient = Test.withContext({ const car = await randomCAR(128) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/space.test.js b/packages/w3up-client/test/capability/space.test.js index dd07ae227..3b71e3798 100644 --- a/packages/w3up-client/test/capability/space.test.js +++ b/packages/w3up-client/test/capability/space.test.js @@ -20,7 +20,7 @@ export const SpaceClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice, { access: { 'space/info': {} }, @@ -58,7 +58,7 @@ export const SpaceClient = Test.withContext({ }, }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await alice.addSpace(await space.createAuthorization(alice)) assert.ok(auth) @@ -170,7 +170,7 @@ export const SpaceClient = Test.withContext({ }, }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await alice.addSpace(await space.createAuthorization(alice)) assert.ok(auth) @@ -280,7 +280,7 @@ export const SpaceClient = Test.withContext({ }, }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await alice.addSpace( await space.createAuthorization(alice) @@ -394,7 +394,7 @@ export const SpaceClient = Test.withContext({ }, }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await alice.addSpace( await space.createAuthorization(alice) @@ -510,7 +510,7 @@ export const SpaceClient = Test.withContext({ }, }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await alice.addSpace(await space.createAuthorization(alice)) assert.ok(auth) diff --git a/packages/w3up-client/test/capability/store.test.js b/packages/w3up-client/test/capability/store.test.js index c0ac10b3f..a58ba0f9e 100644 --- a/packages/w3up-client/test/capability/store.test.js +++ b/packages/w3up-client/test/capability/store.test.js @@ -17,7 +17,7 @@ export const StoreClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -54,7 +54,7 @@ export const StoreClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -92,7 +92,7 @@ export const StoreClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -128,7 +128,7 @@ export const StoreClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/subscription.test.js b/packages/w3up-client/test/capability/subscription.test.js index 67fa48277..82860a127 100644 --- a/packages/w3up-client/test/capability/subscription.test.js +++ b/packages/w3up-client/test/capability/subscription.test.js @@ -9,7 +9,7 @@ export const SubscriptionClient = Test.withContext({ { client, connection, service, plansStorage, grantAccess, mail } ) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const email = 'alice@web.mail' const login = Account.login(client, email) diff --git a/packages/w3up-client/test/capability/upload.test.js b/packages/w3up-client/test/capability/upload.test.js index efbf5252e..649d91ce0 100644 --- a/packages/w3up-client/test/capability/upload.test.js +++ b/packages/w3up-client/test/capability/upload.test.js @@ -10,7 +10,7 @@ export const UploadClient = Test.withContext({ const car = await randomCAR(128) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -41,7 +41,7 @@ export const UploadClient = Test.withContext({ const car = await randomCAR(128) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -82,7 +82,7 @@ export const UploadClient = Test.withContext({ const car = await randomCAR(128) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -116,7 +116,7 @@ export const UploadClient = Test.withContext({ const car = await randomCAR(128) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/capability/usage.test.js b/packages/w3up-client/test/capability/usage.test.js index d04b8fffb..45a2d9182 100644 --- a/packages/w3up-client/test/capability/usage.test.js +++ b/packages/w3up-client/test/capability/usage.test.js @@ -19,7 +19,7 @@ export const UsageClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -63,7 +63,7 @@ export const UsageClient = Test.withContext({ }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/client.test.js b/packages/w3up-client/test/client.test.js index 42cee03e4..8b2285fda 100644 --- a/packages/w3up-client/test/client.test.js +++ b/packages/w3up-client/test/client.test.js @@ -46,7 +46,7 @@ export const testClient = { }) const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -125,7 +125,7 @@ export const testClient = { }) const space = await alice.createSpace('upload-dir-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -172,7 +172,7 @@ export const testClient = { }) const space = await alice.createSpace('car-space', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace(await space.createAuthorization(alice)) await alice.setCurrentSpace(space.did()) @@ -235,7 +235,7 @@ export const testClient = { assert.equal(current0, undefined) const space = await alice.createSpace('new-space', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace(await space.createAuthorization(alice)) await alice.setCurrentSpace(space.did()) @@ -251,7 +251,7 @@ export const testClient = { const name = `space-${Date.now()}` const space = await alice.createSpace(name, { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -267,7 +267,7 @@ export const testClient = { const bob = new Client(await AgentData.create()) const space = await alice.createSpace('new-space', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace( await space.createAuthorization(alice, { @@ -303,7 +303,7 @@ export const testClient = { // Step 2: Alice creates a space with her account as the recovery account const space = await client.createSpace('recovery-space-test', { account: aliceAccount, // The account is the recovery account - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.ok(space) @@ -336,7 +336,7 @@ export const testClient = { // Step 2: Alice creates a space without providing a recovery account const space = await client.createSpace('no-recovery-space-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.ok(space) @@ -440,7 +440,7 @@ export const testClient = { // Step 2: Alice creates a space const space = await aliceClient.createSpace('share-space-test', { account: aliceAccount, - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.ok(space) @@ -493,7 +493,7 @@ export const testClient = { 'share-space-delegate-fail-test', { account: aliceAccount, - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, } ) assert.ok(space) @@ -530,14 +530,14 @@ export const testClient = { // Step 2: Alice creates a space const spaceA = await client.createSpace('test-space-a', { account: aliceAccount, - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.ok(spaceA) // Step 3: Alice creates another space to share with a friend const spaceB = await client.createSpace('test-space-b', { account: aliceAccount, - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) assert.ok(spaceB) @@ -583,7 +583,7 @@ export const testClient = { 'authorize-gateway-space', { account: aliceAccount, - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, } ) assert.ok(spaceA) @@ -597,10 +597,7 @@ export const testClient = { // Step 3: Alice authorizes the gateway to serve content from the space const delegationResult = await aliceClient.authorizeContentServe( spaceA, - { - audience: gateway.did(), - connection: gatewayConnection, - } + gatewayConnection ) assert.ok(delegationResult.ok) const { delegation } = delegationResult.ok @@ -650,8 +647,7 @@ export const testClient = { 'authorize-gateway-space', { account: aliceAccount, - authorizeContentServeServices: [gateway.did()], - connection: gatewayConnection, + authorizeGatewayServices: [gatewayConnection], } ) assert.ok(spaceA, 'should create the space') @@ -659,47 +655,6 @@ export const testClient = { assert.fail(error, 'should not throw when creating the space') } }, - 'should throw when the content serve authorization fails due to missing connection configuration': - async (assert, { mail, grantAccess, connection }) => { - // Step 1: Create a client for Alice and login - const aliceClient = new Client( - await AgentData.create({ - principal: alice, - }), - { - // @ts-ignore - serviceConf: { - access: connection, - upload: connection, - }, - } - ) - - const aliceEmail = 'alice@web.mail' - const aliceLogin = aliceClient.login(aliceEmail) - const message = await mail.take() - assert.deepEqual(message.to, aliceEmail) - await grantAccess(message) - const aliceAccount = await aliceLogin - - try { - const spaceA = await aliceClient.createSpace( - 'authorize-gateway-space', - { - account: aliceAccount, - authorizeContentServeServices: [gateway.did()], - } - ) - assert.fail(spaceA, 'should not create the space') - } catch (error) { - assert.match( - // @ts-expect-error - error.message, - /missing option/, - 'should throw when creating the space' - ) - } - }, 'should throw when the content serve authorization fails due to missing service configuration': async (assert, { mail, grantAccess, connection }) => { // Step 1: Create a client for Alice and login @@ -723,18 +678,12 @@ export const testClient = { await grantAccess(message) const aliceAccount = await aliceLogin - const gatewayService = getContentServeMockService() - const gatewayConnection = getConnection( - gateway, - gatewayService - ).connection try { const spaceA = await aliceClient.createSpace( 'authorize-gateway-space', { account: aliceAccount, - authorizeContentServeServices: [], // No services to authorize - connection: gatewayConnection, + authorizeGatewayServices: [], // No services to authorize } ) assert.fail(spaceA, 'should not create the space') @@ -742,7 +691,7 @@ export const testClient = { assert.match( // @ts-expect-error error.message, - /missing option/, + /missing option/, 'should throw when creating the space' ) } @@ -784,8 +733,7 @@ export const testClient = { try { await aliceClient.createSpace('authorize-gateway-space', { account: aliceAccount, - authorizeContentServeServices: [gateway.did()], - connection: gatewayConnection, + authorizeGatewayServices: [gatewayConnection], }) assert.fail('should not create the space') } catch (error) { @@ -804,7 +752,7 @@ export const testClient = { const bob = new Client(await AgentData.create()) const space = await alice.createSpace('proof-space', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace(await space.createAuthorization(alice)) await alice.setCurrentSpace(space.did()) @@ -824,7 +772,7 @@ export const testClient = { const bob = new Client(await AgentData.create()) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace(await space.createAuthorization(alice)) await alice.setCurrentSpace(space.did()) @@ -862,7 +810,7 @@ export const testClient = { }) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace( await space.createAuthorization(alice, { @@ -886,7 +834,7 @@ export const testClient = { const bob = new Client(await AgentData.create()) const space = await alice.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) await alice.addSpace(await space.createAuthorization(alice)) await alice.setCurrentSpace(space.did()) @@ -939,7 +887,7 @@ export const testClient = { // setup space const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -990,7 +938,7 @@ export const testClient = { // setup space const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -1044,7 +992,7 @@ export const testClient = { // setup space const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) @@ -1070,7 +1018,7 @@ export const testClient = { // setup space const space = await alice.createSpace('upload-test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const auth = await space.createAuthorization(alice) await alice.addSpace(auth) diff --git a/packages/w3up-client/test/coupon.test.js b/packages/w3up-client/test/coupon.test.js index c44aa7fce..d75c9ee27 100644 --- a/packages/w3up-client/test/coupon.test.js +++ b/packages/w3up-client/test/coupon.test.js @@ -38,7 +38,7 @@ export const testCoupon = Test.withContext({ // creates a space and provision it with redeemed coupon const space = await alice.createSpace('home', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const result = await space.provision(access) await space.save() diff --git a/packages/w3up-client/test/space.test.js b/packages/w3up-client/test/space.test.js index 838b534ec..65c7f54b0 100644 --- a/packages/w3up-client/test/space.test.js +++ b/packages/w3up-client/test/space.test.js @@ -25,7 +25,7 @@ export const testSpace = Test.withContext({ 'should get usage': async (assert, { client, grantAccess, mail }) => { const space = await client.createSpace('test', { - skipContentServeAuthorization: true, + skipGatewayAuthorization: true, }) const email = 'alice@web.mail'