Skip to content

Commit

Permalink
minor fix to use the correct capability
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Dec 10, 2024
1 parent d67fb4a commit 046b70e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
3 changes: 1 addition & 2 deletions scripts/delegate-serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import sade from 'sade'
import { Schema } from '@ucanto/core'
import { getClient } from '@storacha/cli/lib.js'
import { Space } from '@web3-storage/capabilities'
import * as serve from '../src/capabilities/serve.js'

const MailtoDID =
/** @type {import('@ucanto/validator').StringSchema<`did:mailto:${string}:${string}`, unknown>} */ (
Expand Down Expand Up @@ -51,7 +50,7 @@ sade('delegate-serve.js [space]')

if (proofs.length === 0) {
throw new Error(
`No proofs found. Are you authorized to ${serve.star.can} ${space}?`
`No proofs found. Are you authorized to ${Space.contentServe.can} ${space}?`
)
}

Expand Down
20 changes: 0 additions & 20 deletions src/capabilities/serve.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
import { capability, Schema, DID, nullable, string } from '@ucanto/validator'

/**
* "Manage the serving of content owned by the subject Space."
*
* A Principal who may `space/content/serve/*` is permitted to perform all
* operations related to serving content owned by the Space, including actually
* serving it and recording egress charges.
*/
export const star = capability({
can: 'space/content/serve/*',
/**
* The Space which contains the content. This Space will be charged egress
* fees if content is actually retrieved by way of this invocation.
*/
with: DID,
nb: Schema.struct({
/** The authorization token, if any, used for this request. */
token: nullable(string())
})
})

/**
* "Serve content owned by the subject Space over HTTP."
*
Expand Down

0 comments on commit 046b70e

Please sign in to comment.