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

feat!: upgrade access-api @ucanto/* and @ipld/dag-ucan major versions #246

Merged
merged 26 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5911726
upgrade ucanto in access-client
gobengo Dec 1, 2022
c73b355
start access-client cli test-ucanto-connection
gobengo Dec 1, 2022
98f17b3
upgrade all packages dep on @ucanto/interface and @ucanto/principal t…
gobengo Dec 2, 2022
6e792ac
access-client connection principal typefix
gobengo Dec 2, 2022
eedd403
access - upgrade @ucanto/princpal to 4.0.1
gobengo Dec 2, 2022
9394b30
rm unused ts-expect-error
gobengo Dec 2, 2022
750b6d7
capabilities,access: upgrade ucanto libraries to latest patch versions
gobengo Dec 2, 2022
56f69d2
fix IndexedDB store test to handle new SignerArchive type with keys n…
gobengo Dec 2, 2022
158f0da
upgrade ucanto packages in access-client,capabilities
gobengo Dec 2, 2022
7558a0d
upload-client upgrade ucanto libs
gobengo Dec 2, 2022
32b9a87
access-api upgrade ucanto versions
gobengo Dec 2, 2022
d1d3d3e
fix type issue in packages/access-api/test/helpers/utils.js
gobengo Dec 2, 2022
7030238
finish upgrade of @ucanto/{core,interface,principal,transport,validat…
gobengo Dec 2, 2022
00db6c2
rm unused dependencies from packages/capabilities/package.json
gobengo Dec 2, 2022
c28311f
update pnpm-lock.yaml
gobengo Dec 2, 2022
02017b7
rm unnecessary WIP changes to access-client cli (test-ucanto-connection)
gobengo Dec 2, 2022
4bca15c
Update packages/access-client/src/stores/types.ts
gobengo Dec 2, 2022
2bf043c
Update packages/access-client/test/stores/store-indexeddb.browser.tes…
gobengo Dec 2, 2022
f32a6e7
Update packages/access-client/src/stores/types.ts
gobengo Dec 2, 2022
ea4f24a
Update packages/access-client/src/stores/types.ts
gobengo Dec 2, 2022
f3e5ca5
fix comment in voucher capabilities
gobengo Dec 2, 2022
f4fcc4a
lint
gobengo Dec 2, 2022
993672c
Merge branch 'main' into ucanto-interface-4.0.0
gobengo Dec 5, 2022
04440cc
Merge branch 'main' into ucanto-interface-4.0.0
gobengo Dec 7, 2022
627eea5
upgrade @ipld/dag-ucan from v2 to v3 in access-client and upload-client
gobengo Dec 7, 2022
e483d1e
clean up diff
gobengo Dec 7, 2022
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
12 changes: 6 additions & 6 deletions packages/access-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"author": "Hugo Dias <[email protected]> (hugodias.me)",
"license": "(Apache-2.0 OR MIT)",
"dependencies": {
"@ipld/dag-ucan": "^2.0.1",
"@ucanto/core": "^3.0.2",
"@ucanto/interface": "^3.0.1",
"@ucanto/principal": "^3.0.1",
"@ucanto/server": "^3.0.4",
"@ucanto/transport": "^3.0.2",
"@ipld/dag-ucan": "^3.0.1",
"@ucanto/core": "^4.0.2",
"@ucanto/interface": "^4.0.2",
"@ucanto/principal": "^4.0.2",
"@ucanto/server": "^4.0.2",
"@ucanto/transport": "^4.0.2",
"@web3-storage/access": "workspace:^",
"@web3-storage/capabilities": "workspace:^",
"@web3-storage/worker-utils": "0.4.3-dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/access-api/test/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function send(ucan, mf) {

/**
* @param {Types.Signer} issuer
* @param {Types.Principal<"key">} service
* @param {Types.Principal<UCAN.DID>} service
* @param {Types.ConnectionView<import('@web3-storage/access/types').Service>} conn
* @param {string} email
*/
Expand Down
16 changes: 8 additions & 8 deletions packages/access-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
],
"dependencies": {
"@ipld/car": "^5.0.1",
"@ipld/dag-ucan": "^2.0.1",
"@ucanto/client": "^3.0.2",
"@ucanto/core": "^3.0.2",
"@ucanto/interface": "^3.0.1",
"@ucanto/principal": "^3.0.1",
"@ucanto/transport": "^3.0.2",
"@ucanto/validator": "^3.0.4",
"@ipld/dag-ucan": "^3.0.1",
"@ucanto/client": "^4.0.2",
"@ucanto/core": "^4.0.2",
"@ucanto/interface": "^4.0.2",
"@ucanto/principal": "^4.0.2",
"@ucanto/transport": "^4.0.2",
"@ucanto/validator": "^4.0.2",
"@web3-storage/capabilities": "workspace:^",
"bigint-mod-arith": "^3.1.2",
"conf": "^10.2.0",
Expand All @@ -87,7 +87,7 @@
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.9",
"@types/ws": "^8.5.3",
"@ucanto/server": "^3.0.4",
"@ucanto/server": "^4.0.2",
"assert": "^2.0.0",
"delay": "^5.0.0",
"hd-scripts": "^3.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/access-client/src/agent-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class AgentData {
return new AgentData(
{
meta: raw.meta,
// @ts-expect-error
principal: Signer.from(raw.principal),
currentSpace: raw.currentSpace,
spaces: raw.spaces,
Expand Down
3 changes: 1 addition & 2 deletions packages/access-client/src/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PRINCIPAL = DID.parse(
* import { connection } from '@web3-storage/access/agent'
* ```
*
* @template {string} T - DID method
* @template {Ucanto.DID} T - DID method
* @param {object} [options]
* @param {Ucanto.Principal<T>} [options.principal] - w3access API Principal
* @param {URL} [options.url] - w3access API URL
Expand Down Expand Up @@ -403,7 +403,6 @@ export class Agent {
nb: {
identity: URI.from(`mailto:${email}`),
product: 'product:free',
// @ts-expect-error expected did:key but connection can be did:any
service: service.did(),
},
})
Expand Down
3 changes: 2 additions & 1 deletion packages/access-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
DID,
Signer,
SignerArchive,
SigAlg,
} from '@ucanto/interface'

import type {
Expand Down Expand Up @@ -92,7 +93,7 @@ export type AgentDataExport = Pick<
AgentDataModel,
'meta' | 'currentSpace' | 'spaces'
> & {
principal: SignerArchive<Signer>
principal: SignerArchive<DID, SigAlg>
delegations: Map<
CIDString,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ describe('IndexedDB store', () => {
// principal private key is not extractable
const archive = exportData.principal
assert(!(archive instanceof Uint8Array))
assert(archive.key instanceof CryptoKey)
assert.equal(archive.key.extractable, false)
// eslint-disable-next-line no-unused-vars
const [[_, key], ...keys] = [...Object.entries(archive.keys)]
assert.deepEqual(keys, [])
assert(key instanceof CryptoKey)
assert.equal(key.extractable, false)

// no accounts or delegations yet
assert.equal(exportData.spaces.size, 0)
Expand Down
10 changes: 5 additions & 5 deletions packages/capabilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
"dist/src/**/*.d.ts.map"
],
"dependencies": {
"@ucanto/core": "^3.0.2",
"@ucanto/interface": "^3.0.1",
"@ucanto/principal": "^3.0.1",
"@ucanto/transport": "^3.0.2",
"@ucanto/validator": "^3.0.4"
"@ucanto/core": "^4.0.2",
"@ucanto/interface": "^4.0.2",
"@ucanto/principal": "^4.0.2",
"@ucanto/transport": "^4.0.2",
"@ucanto/validator": "^4.0.2"
},
"devDependencies": {
"@types/assert": "^1.5.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/capabilities/src/voucher.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const Product = URI.uri()
export const Identity = URI.match({ protocol: 'mailto:' })

/**
* Services are identified using did:key identifier.
* Services are identified using a decentralized identifier.
*/
export const Service = DID.match({ method: 'key' })
export const Service = DID.match({})

/**
* Capability can only be delegated (but not invoked) allowing audience to
Expand Down
12 changes: 6 additions & 6 deletions packages/upload-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
],
"dependencies": {
"@ipld/car": "^5.0.0",
"@ipld/dag-ucan": "^2.0.1",
"@ipld/dag-ucan": "^3.0.1",
"@ipld/unixfs": "^2.0.0",
"@ucanto/client": "^3.0.1",
"@ucanto/interface": "^3.0.0",
"@ucanto/transport": "^3.0.1",
"@ucanto/client": "^4.0.2",
"@ucanto/interface": "^4.0.2",
"@ucanto/transport": "^4.0.2",
"@web3-storage/capabilities": "workspace:^",
"multiformats": "^10.0.2",
"p-queue": "^7.3.0",
Expand All @@ -77,8 +77,8 @@
"devDependencies": {
"@types/assert": "^1.5.6",
"@types/mocha": "^10.0.1",
"@ucanto/principal": "^3.0.0",
"@ucanto/server": "^3.0.1",
"@ucanto/principal": "^4.0.2",
"@ucanto/server": "^4.0.2",
"assert": "^2.0.0",
"blockstore-core": "^2.0.2",
"c8": "^7.12.0",
Expand Down
Loading