Fork of github.com/did-method-plc/did-method-plc

Merge branch 'main' into bnewbold/webplc

+1
.github/workflows/build-and-push-aws.yaml
···
jobs:
plc-container-aws:
+
if: github.repository == 'bluesky-social/did-method-plc'
runs-on: ubuntu-latest
permissions:
contents: read
+1
.github/workflows/build-and-push-ghcr.yaml
···
jobs:
plc-container-ghcr:
+
if: github.repository == 'bluesky-social/did-method-plc'
runs-on: ubuntu-latest
permissions:
contents: read
+3 -19
LICENSE
···
-
MIT License
-
-
Copyright (c) 2022-2023 Bluesky PBLLC
-
-
Permission is hereby granted, free of charge, to any person obtaining a copy
-
of this software and associated documentation files (the "Software"), to deal
-
in the Software without restriction, including without limitation the rights
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-
copies of the Software, and to permit persons to whom the Software is
-
furnished to do so, subject to the following conditions:
+
Dual MIT/Apache-2.0 License
-
The above copyright notice and this permission notice shall be included in all
-
copies or substantial portions of the Software.
+
Copyright (c) 2022-2023 Bluesky PBC
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-
SOFTWARE.
+
Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>), at your option.
+202
LICENSE-APACHE
···
+
+
Apache License
+
Version 2.0, January 2004
+
http://www.apache.org/licenses/
+
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+
1. Definitions.
+
+
"License" shall mean the terms and conditions for use, reproduction,
+
and distribution as defined by Sections 1 through 9 of this document.
+
+
"Licensor" shall mean the copyright owner or entity authorized by
+
the copyright owner that is granting the License.
+
+
"Legal Entity" shall mean the union of the acting entity and all
+
other entities that control, are controlled by, or are under common
+
control with that entity. For the purposes of this definition,
+
"control" means (i) the power, direct or indirect, to cause the
+
direction or management of such entity, whether by contract or
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
+
outstanding shares, or (iii) beneficial ownership of such entity.
+
+
"You" (or "Your") shall mean an individual or Legal Entity
+
exercising permissions granted by this License.
+
+
"Source" form shall mean the preferred form for making modifications,
+
including but not limited to software source code, documentation
+
source, and configuration files.
+
+
"Object" form shall mean any form resulting from mechanical
+
transformation or translation of a Source form, including but
+
not limited to compiled object code, generated documentation,
+
and conversions to other media types.
+
+
"Work" shall mean the work of authorship, whether in Source or
+
Object form, made available under the License, as indicated by a
+
copyright notice that is included in or attached to the work
+
(an example is provided in the Appendix below).
+
+
"Derivative Works" shall mean any work, whether in Source or Object
+
form, that is based on (or derived from) the Work and for which the
+
editorial revisions, annotations, elaborations, or other modifications
+
represent, as a whole, an original work of authorship. For the purposes
+
of this License, Derivative Works shall not include works that remain
+
separable from, or merely link (or bind by name) to the interfaces of,
+
the Work and Derivative Works thereof.
+
+
"Contribution" shall mean any work of authorship, including
+
the original version of the Work and any modifications or additions
+
to that Work or Derivative Works thereof, that is intentionally
+
submitted to Licensor for inclusion in the Work by the copyright owner
+
or by an individual or Legal Entity authorized to submit on behalf of
+
the copyright owner. For the purposes of this definition, "submitted"
+
means any form of electronic, verbal, or written communication sent
+
to the Licensor or its representatives, including but not limited to
+
communication on electronic mailing lists, source code control systems,
+
and issue tracking systems that are managed by, or on behalf of, the
+
Licensor for the purpose of discussing and improving the Work, but
+
excluding communication that is conspicuously marked or otherwise
+
designated in writing by the copyright owner as "Not a Contribution."
+
+
"Contributor" shall mean Licensor and any individual or Legal Entity
+
on behalf of whom a Contribution has been received by Licensor and
+
subsequently incorporated within the Work.
+
+
2. Grant of Copyright License. Subject to the terms and conditions of
+
this License, each Contributor hereby grants to You a perpetual,
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+
copyright license to reproduce, prepare Derivative Works of,
+
publicly display, publicly perform, sublicense, and distribute the
+
Work and such Derivative Works in Source or Object form.
+
+
3. Grant of Patent License. Subject to the terms and conditions of
+
this License, each Contributor hereby grants to You a perpetual,
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+
(except as stated in this section) patent license to make, have made,
+
use, offer to sell, sell, import, and otherwise transfer the Work,
+
where such license applies only to those patent claims licensable
+
by such Contributor that are necessarily infringed by their
+
Contribution(s) alone or by combination of their Contribution(s)
+
with the Work to which such Contribution(s) was submitted. If You
+
institute patent litigation against any entity (including a
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
+
or a Contribution incorporated within the Work constitutes direct
+
or contributory patent infringement, then any patent licenses
+
granted to You under this License for that Work shall terminate
+
as of the date such litigation is filed.
+
+
4. Redistribution. You may reproduce and distribute copies of the
+
Work or Derivative Works thereof in any medium, with or without
+
modifications, and in Source or Object form, provided that You
+
meet the following conditions:
+
+
(a) You must give any other recipients of the Work or
+
Derivative Works a copy of this License; and
+
+
(b) You must cause any modified files to carry prominent notices
+
stating that You changed the files; and
+
+
(c) You must retain, in the Source form of any Derivative Works
+
that You distribute, all copyright, patent, trademark, and
+
attribution notices from the Source form of the Work,
+
excluding those notices that do not pertain to any part of
+
the Derivative Works; and
+
+
(d) If the Work includes a "NOTICE" text file as part of its
+
distribution, then any Derivative Works that You distribute must
+
include a readable copy of the attribution notices contained
+
within such NOTICE file, excluding those notices that do not
+
pertain to any part of the Derivative Works, in at least one
+
of the following places: within a NOTICE text file distributed
+
as part of the Derivative Works; within the Source form or
+
documentation, if provided along with the Derivative Works; or,
+
within a display generated by the Derivative Works, if and
+
wherever such third-party notices normally appear. The contents
+
of the NOTICE file are for informational purposes only and
+
do not modify the License. You may add Your own attribution
+
notices within Derivative Works that You distribute, alongside
+
or as an addendum to the NOTICE text from the Work, provided
+
that such additional attribution notices cannot be construed
+
as modifying the License.
+
+
You may add Your own copyright statement to Your modifications and
+
may provide additional or different license terms and conditions
+
for use, reproduction, or distribution of Your modifications, or
+
for any such Derivative Works as a whole, provided Your use,
+
reproduction, and distribution of the Work otherwise complies with
+
the conditions stated in this License.
+
+
5. Submission of Contributions. Unless You explicitly state otherwise,
+
any Contribution intentionally submitted for inclusion in the Work
+
by You to the Licensor shall be under the terms and conditions of
+
this License, without any additional terms or conditions.
+
Notwithstanding the above, nothing herein shall supersede or modify
+
the terms of any separate license agreement you may have executed
+
with Licensor regarding such Contributions.
+
+
6. Trademarks. This License does not grant permission to use the trade
+
names, trademarks, service marks, or product names of the Licensor,
+
except as required for reasonable and customary use in describing the
+
origin of the Work and reproducing the content of the NOTICE file.
+
+
7. Disclaimer of Warranty. Unless required by applicable law or
+
agreed to in writing, Licensor provides the Work (and each
+
Contributor provides its Contributions) on an "AS IS" BASIS,
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+
implied, including, without limitation, any warranties or conditions
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+
PARTICULAR PURPOSE. You are solely responsible for determining the
+
appropriateness of using or redistributing the Work and assume any
+
risks associated with Your exercise of permissions under this License.
+
+
8. Limitation of Liability. In no event and under no legal theory,
+
whether in tort (including negligence), contract, or otherwise,
+
unless required by applicable law (such as deliberate and grossly
+
negligent acts) or agreed to in writing, shall any Contributor be
+
liable to You for damages, including any direct, indirect, special,
+
incidental, or consequential damages of any character arising as a
+
result of this License or out of the use or inability to use the
+
Work (including but not limited to damages for loss of goodwill,
+
work stoppage, computer failure or malfunction, or any and all
+
other commercial damages or losses), even if such Contributor
+
has been advised of the possibility of such damages.
+
+
9. Accepting Warranty or Additional Liability. While redistributing
+
the Work or Derivative Works thereof, You may choose to offer,
+
and charge a fee for, acceptance of support, warranty, indemnity,
+
or other liability obligations and/or rights consistent with this
+
License. However, in accepting such obligations, You may act only
+
on Your own behalf and on Your sole responsibility, not on behalf
+
of any other Contributor, and only if You agree to indemnify,
+
defend, and hold each Contributor harmless for any liability
+
incurred by, or claims asserted against, such Contributor by reason
+
of your accepting any such warranty or additional liability.
+
+
END OF TERMS AND CONDITIONS
+
+
APPENDIX: How to apply the Apache License to your work.
+
+
To apply the Apache License to your work, attach the following
+
boilerplate notice, with the fields enclosed by brackets "[]"
+
replaced with your own identifying information. (Don't include
+
the brackets!) The text should be enclosed in the appropriate
+
comment syntax for the file format. We also recommend that a
+
file or class name and description of purpose be included on the
+
same "printed page" as the copyright notice for easier
+
identification within third-party archives.
+
+
Copyright [yyyy] [name of copyright owner]
+
+
Licensed under the Apache License, Version 2.0 (the "License");
+
you may not use this file except in compliance with the License.
+
You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+
Unless required by applicable law or agreed to in writing, software
+
distributed under the License is distributed on an "AS IS" BASIS,
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
See the License for the specific language governing permissions and
+
limitations under the License.
+19
LICENSE-MIT
···
+
MIT License
+
+
Permission is hereby granted, free of charge, to any person obtaining a copy
+
of this software and associated documentation files (the "Software"), to deal
+
in the Software without restriction, including without limitation the rights
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+
copies of the Software, and to permit persons to whom the Software is
+
furnished to do so, subject to the following conditions:
+
+
The above copyright notice and this permission notice shall be included in all
+
copies or substantial portions of the Software.
+
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
SOFTWARE.
+15 -6
README.md
···
-
# DID Placeholder Method (did:plc)
+
# DID PLC Method (did:plc)
-
DID Placeholder is a self-authenticating [DID](https://www.w3.org/TR/did-core/) which is strongly-consistent, recoverable, and allows for key rotation.
+
DID PLC is a self-authenticating [DID](https://www.w3.org/TR/did-core/) which is strongly-consistent, recoverable, and allows for key rotation.
An example DID is: `did:plc:yk4dd2qkboz2yv6tpubpc6co`
···
## Motivation
-
[Bluesky](https://blueskyweb.xyz/) developed DID Placeholder when designing the [AT Protocol](https://atproto.com) ("atproto") because we were not satisfied with any of the existing DID methods.
+
[Bluesky](https://blueskyweb.xyz/) developed DID PLC when designing the [AT Protocol](https://atproto.com) ("atproto") because we were not satisfied with any of the existing DID methods.
We wanted a strongly consistent, highly available, recoverable, and cryptographically secure method with fast and cheap propagation of updates.
-
We titled the method "Placeholder", because we _don't_ want it to stick around forever in its current form. We are actively hoping to replace it with or evolve it into something less centralized - likely a permissioned DID consortium. That being said, we do intend to support `did:plc` in the current form until after any successor is deployed, with a reasonable grace period. We would also provide a migration route to allow continued use of existing `did:plc` identifiers.
+
We originally titled the method "Placeholder", because we didn't want it to stick around forever in its current form. We are actively hoping to replace it with or evolve it into something less centralized - likely a permissioned DID consortium. That being said, we do intend to support `did:plc` in the current form until after any successor is deployed, with a reasonable grace period. We would also provide a migration route to allow continued use of existing `did:plc` identifiers.
## How it works
···
### Identifier Syntax
-
The DID Placeholder method name is `plc`. The identifier part is 24 characters
+
The DID PLC method name is `plc`. The identifier part is 24 characters
long, including only characters from the `base32` encoding set. An example is
`did:plc:yk4dd2qkboz2yv6tpubpc6co`. This means:
···
We welcome proposals for small additions to make `did:plc` more generic and reusable for applications other than atproto. But no promises: atproto will remain the focus for the near future.
-
Moving governance of the `did:plc` method, and operation of registry servers, out of the sole control of Bluesky PBLLC is something we are enthusiastic about. Audit log snapshots, mirroring, and automated third-party auditing have all been considered as mechanisms to mitigate the centralized nature of the PLC server.
+
Moving governance of the `did:plc` method, and operation of registry servers, out of the sole control of Bluesky PBC is something we are enthusiastic about. Audit log snapshots, mirroring, and automated third-party auditing have all been considered as mechanisms to mitigate the centralized nature of the PLC server.
The size of the `verificationMethods`, `alsoKnownAs`, and `service` mappings/arrays may be specifically constrained. And the maximum DAG-CBOR size may be constrained.
···
A "DID PLC history explorer" web interface would make the public nature of the DID audit log more publicly understandable.
It is concievable that longer DID PLCs, with more of the SHA-256 characters, will be supported in the future. It is also concievable that a different hash algorithm would be allowed. Any such changes would allow existing DIDs in their existing syntax to continue being used.
+
+
## License
+
+
This project is dual-licensed under MIT and Apache 2.0 terms:
+
+
- Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/ipfs/kubo/blob/master/LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
+
- MIT license ([LICENSE-MIT](https://github.com/ipfs/kubo/blob/master/LICENSE-MIT) or http://opensource.org/licenses/MIT)
+
+
Downstream projects and users may chose either license, or both, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
+1 -1
package.json
···
"name": "did-method-plc",
"version": "0.0.1",
"repository": "git@github.com:bluesky-social/did-method-plc.git",
-
"author": "Bluesky PBLLC <hello@blueskyweb.xyz>",
+
"author": "Bluesky PBC <hello@blueskyweb.xyz>",
"license": "MIT",
"private": true,
"engines": {
+50 -1
packages/lib/README.md
···
-
# DID Placeholder Library
+
+
@did-plc/lib - DID PLC Typescript Client Library
+
================================================
+
+
[![NPM](https://img.shields.io/npm/v/@did-plc/lib)](https://www.npmjs.com/package/@did-plc/lib)
+
[![Github CI Status](https://github.com/bluesky-social/did-method-plc/actions/workflows/repo.yaml/badge.svg)](https://github.com/bluesky-social/did-method-plc/actions/workflows/repo.yaml)
+
+
This library provides both a simple client for the PLC directory, and an implementation of the PLC method itself (using a cryptographically signed operation log).
+
+
## Client Usage
+
+
Fetching account data from directory:
+
+
```typescript
+
import * as plc from '@did-plc/lib'
+
+
client = new plc.Client('https://plc.directory')
+
+
let exampleDid = 'did:plc:yk4dd2qkboz2yv6tpubpc6co'
+
+
// current account data, in terse object format
+
const data = await client.getDocumentData(exampleDid)
+
+
// or, the full DID Document
+
const didDoc = await client.getDocument(exampleDid)
+
```
+
+
Registering a new DID PLC:
+
+
```typescript
+
import { Secp256k1Keypair } from '@atproto/crypto'
+
import * as plc from '@did-plc/lib'
+
+
// please test against a sandbox or local development server
+
client = new plc.Client('http://localhost:2582')
+
+
let signingKey = await Secp256k1Keypair.create()
+
let rotationKey = await Secp256k1Keypair.create()
+
+
did = await client.createDid({
+
signingKey: signingKey.did(),
+
handle: 'handle.example.com',
+
pds: 'https://pds.example.com',
+
rotationKeys: [rotationKey.did()],
+
signer: rotationKey,
+
})
+
```
+
## License
+
+
MIT / Apache 2.0 dual-licensed.
+16 -4
packages/lib/package.json
···
{
"name": "@did-plc/lib",
"version": "0.0.4",
-
"main": "src/index.ts",
"license": "MIT",
+
"description": "DID PLC Typescript Client Library",
+
"keywords": [
+
"did-plc",
+
"did",
+
"atproto"
+
],
+
"homepage": "https://web.plc.directory",
+
"repository": {
+
"type": "git",
+
"url": "https://github.com/bluesky-social/did-method-plc",
+
"directory": "packages/lib"
+
},
+
"main": "dist/index.js",
"scripts": {
"test": "jest",
"prettier": "prettier --check src/",
···
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
-
"@atproto/common": "0.1.1",
-
"@atproto/crypto": "0.1.0",
+
"@atproto/common": "0.3.0",
+
"@atproto/crypto": "0.2.2",
"@ipld/dag-cbor": "^7.0.3",
"axios": "^1.3.4",
"multiformats": "^9.6.4",
"uint8arrays": "3.0.0",
-
"zod": "^3.14.2"
+
"zod": "^3.21.4"
},
"devDependencies": {
"eslint-plugin-prettier": "^4.2.1"
-8
packages/lib/src/data.ts
···
import * as t from './types'
import {
assureValidCreationOp,
-
assureValidOp,
assureValidSig,
normalizeOp,
} from './operations'
···
ops: t.IndexedOperation[],
proposed: t.CompatibleOpOrTombstone,
): Promise<{ nullified: CID[]; prev: CID | null }> => {
-
if (check.is(proposed, t.def.createOpV1)) {
-
const normalized = normalizeOp(proposed)
-
await assureValidOp(normalized)
-
} else {
-
await assureValidOp(proposed)
-
}
-
// special case if account creation
if (ops.length === 0) {
await assureValidCreationOp(did, proposed)
+2 -2
packages/lib/src/document.ts
···
import * as crypto from '@atproto/crypto'
import * as t from './types'
import { UnsupportedKeyError } from './error'
-
import { ParsedDidKey } from '@atproto/crypto'
+
import { ParsedMultikey } from '@atproto/crypto'
export const formatDidDoc = (data: t.DocumentData): t.DidDocument => {
const context = ['https://www.w3.org/ns/did/v1']
···
}
const formatKeyAndContext = (key: string): KeyAndContext => {
-
let keyInfo: ParsedDidKey
+
let keyInfo: ParsedMultikey
try {
keyInfo = crypto.parseDidKey(key)
} catch (err) {
+1 -25
packages/lib/src/operations.ts
···
import * as cbor from '@ipld/dag-cbor'
import { CID } from 'multiformats/cid'
import * as uint8arrays from 'uint8arrays'
-
import { Keypair, parseDidKey, sha256, verifySignature } from '@atproto/crypto'
+
import { Keypair, sha256, verifySignature } from '@atproto/crypto'
import { check, cidForCbor } from '@atproto/common'
import * as t from './types'
import {
···
ImproperOperationError,
InvalidSignatureError,
MisorderedOperationError,
-
UnsupportedKeyError,
} from './error'
export const didForCreateOp = async (op: t.CompatibleOp) => {
···
// Verifying operations/signatures
// ---------------------------
-
export const assureValidOp = async (op: t.OpOrTombstone) => {
-
if (check.is(op, t.def.tombstone)) {
-
return true
-
}
-
// ensure we support the op's keys
-
const keys = [...Object.values(op.verificationMethods), ...op.rotationKeys]
-
await Promise.all(
-
keys.map(async (k) => {
-
try {
-
parseDidKey(k)
-
} catch (err) {
-
throw new UnsupportedKeyError(k, err)
-
}
-
}),
-
)
-
if (op.rotationKeys.length > 5) {
-
throw new ImproperOperationError('too many rotation keys', op)
-
} else if (op.rotationKeys.length < 1) {
-
throw new ImproperOperationError('need at least one rotation key', op)
-
}
-
}
-
export const assureValidCreationOp = async (
did: string,
op: t.CompatibleOpOrTombstone,
···
throw new MisorderedOperationError()
}
const normalized = normalizeOp(op)
-
await assureValidOp(normalized)
await assureValidSig(normalized.rotationKeys, op)
const expectedDid = await didForCreateOp(op)
if (expectedDid !== did) {
+18 -14
packages/lib/src/types.ts
···
const createOpV1 = unsignedCreateOpV1.extend({ sig: z.string() })
export type CreateOpV1 = z.infer<typeof createOpV1>
-
const unsignedOperation = z.object({
-
type: z.literal('plc_operation'),
-
rotationKeys: z.array(z.string()),
-
verificationMethods: z.record(z.string()),
-
alsoKnownAs: z.array(z.string()),
-
services: z.record(service),
-
prev: z.string().nullable(),
-
})
+
const unsignedOperation = z
+
.object({
+
type: z.literal('plc_operation'),
+
rotationKeys: z.array(z.string()),
+
verificationMethods: z.record(z.string()),
+
alsoKnownAs: z.array(z.string()),
+
services: z.record(service),
+
prev: z.string().nullable(),
+
})
+
.strict()
export type UnsignedOperation = z.infer<typeof unsignedOperation>
-
const operation = unsignedOperation.extend({ sig: z.string() })
+
const operation = unsignedOperation.extend({ sig: z.string() }).strict()
export type Operation = z.infer<typeof operation>
-
const unsignedTombstone = z.object({
-
type: z.literal('plc_tombstone'),
-
prev: z.string(),
-
})
+
const unsignedTombstone = z
+
.object({
+
type: z.literal('plc_tombstone'),
+
prev: z.string(),
+
})
+
.strict()
export type UnsignedTombstone = z.infer<typeof unsignedTombstone>
-
const tombstone = unsignedTombstone.extend({ sig: z.string() })
+
const tombstone = unsignedTombstone.extend({ sig: z.string() }).strict()
export type Tombstone = z.infer<typeof tombstone>
const opOrTombstone = z.union([operation, tombstone])
+3 -3
packages/lib/tests/data.test.ts
···
import { check, cidForCbor } from '@atproto/common'
-
import { EcdsaKeypair, Secp256k1Keypair } from '@atproto/crypto'
+
import { P256Keypair, Secp256k1Keypair } from '@atproto/crypto'
import {
GenesisHashError,
ImproperOperationError,
···
let signingKey: Secp256k1Keypair
let rotationKey1: Secp256k1Keypair
-
let rotationKey2: EcdsaKeypair
+
let rotationKey2: P256Keypair
let did: string
let handle = 'at://alice.example.com'
let atpPds = 'https://example.com'
···
beforeAll(async () => {
signingKey = await Secp256k1Keypair.create()
rotationKey1 = await Secp256k1Keypair.create()
-
rotationKey2 = await EcdsaKeypair.create()
+
rotationKey2 = await P256Keypair.create()
})
const lastOp = () => {
+3 -3
packages/lib/tests/document.test.ts
···
import * as uint8arrays from 'uint8arrays'
-
import { EcdsaKeypair, parseDidKey, Secp256k1Keypair } from '@atproto/crypto'
+
import { P256Keypair, parseDidKey, Secp256k1Keypair } from '@atproto/crypto'
import * as document from '../src/document'
import * as t from '../src/types'
describe('document', () => {
it('formats a valid DID document', async () => {
const atprotoKey = await Secp256k1Keypair.create()
-
const otherKey = await EcdsaKeypair.create()
+
const otherKey = await P256Keypair.create()
const rotate1 = await Secp256k1Keypair.create()
-
const rotate2 = await EcdsaKeypair.create()
+
const rotate2 = await P256Keypair.create()
const alsoKnownAs = ['at://alice.test', 'https://bob.test']
const atpPds = 'https://example.com'
const otherService = 'https://other.com'
+5 -5
packages/lib/tests/recovery.test.ts
···
import { cidForCbor, DAY, HOUR } from '@atproto/common'
-
import { EcdsaKeypair, Keypair, Secp256k1Keypair } from '@atproto/crypto'
+
import { P256Keypair, Keypair, Secp256k1Keypair } from '@atproto/crypto'
import { CID } from 'multiformats/cid'
import { InvalidSignatureError, LateRecoveryError } from '../src'
import * as data from '../src/data'
···
describe('plc recovery', () => {
let signingKey: Secp256k1Keypair
let rotationKey1: Secp256k1Keypair
-
let rotationKey2: EcdsaKeypair
-
let rotationKey3: EcdsaKeypair
+
let rotationKey2: P256Keypair
+
let rotationKey3: P256Keypair
let did: string
const handle = 'alice.example.com'
const atpPds = 'https://example.com'
···
beforeAll(async () => {
signingKey = await Secp256k1Keypair.create()
rotationKey1 = await Secp256k1Keypair.create()
-
rotationKey2 = await EcdsaKeypair.create()
-
rotationKey3 = await EcdsaKeypair.create()
+
rotationKey2 = await P256Keypair.create()
+
rotationKey3 = await P256Keypair.create()
})
const formatIndexed = async (
+1 -1
packages/server/Dockerfile
···
CMD ["node", "--enable-source-maps", "index.js"]
LABEL org.opencontainers.image.source=https://github.com/bluesky-social/did-method-plc
-
LABEL org.opencontainers.image.description="DID Placeholder server"
+
LABEL org.opencontainers.image.description="DID PLC server"
LABEL org.opencontainers.image.licenses=MIT
+11 -1
packages/server/README.md
···
-
# DID Placeholder Server
+
+
@did-plc/server - DID PLC Directory Service
+
===========================================
+
+
Reference implementation of the PLC DID method, in Typescript.
+
+
This is the software that runs the <https://plc.directory> service.
+
+
## License
+
+
MIT / Apache 2.0 dual-licensed.
+15 -3
packages/server/package.json
···
{
"name": "@did-plc/server",
"version": "0.0.1",
-
"main": "dist/index.js",
"license": "MIT",
+
"description": "DID PLC Directory Service",
+
"keywords": [
+
"did-plc",
+
"did",
+
"atproto"
+
],
+
"homepage": "https://web.plc.directory",
+
"repository": {
+
"type": "git",
+
"url": "https://github.com/bluesky-social/did-method-plc",
+
"directory": "packages/server"
+
},
+
"main": "dist/index.js",
"scripts": {
"start": "node dist/bin.js",
"test": "./pg/with-test-db.sh jest",
···
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
-
"@atproto/common": "0.1.1",
-
"@atproto/crypto": "0.1.0",
+
"@atproto/common": "0.3.0",
+
"@atproto/crypto": "0.2.2",
"@did-plc/lib": "*",
"axios": "^1.3.4",
"cors": "^2.8.5",
+2 -2
packages/server/service/index.js
···
})
}
-
const pgUrl = ({ username, password, host, port }) => {
+
const pgUrl = ({ username = "postgres", password = "postgres", host = "localhost", port = "5432", database = "postgres", sslmode }) => {
const enc = encodeURIComponent
-
return `postgresql://${username}:${enc(password)}@${host}:${port}/postgres`
+
return `postgresql://${username}:${enc(password)}@${host}:${port}/${database}${sslmode ? `?sslmode=${enc(sslmode)}` : ''}`
}
main()
+147
packages/server/src/constraints.ts
···
+
import { DAY, HOUR, cborEncode, check } from '@atproto/common'
+
import * as plc from '@did-plc/lib'
+
import { ServerError } from './error'
+
import { parseDidKey } from '@atproto/crypto'
+
+
const MAX_OP_BYTES = 4000
+
const MAX_AKA_ENTRIES = 10
+
const MAX_AKA_LENGTH = 256
+
const MAX_ROTATION_ENTRIES = 10
+
const MAX_SERVICE_ENTRIES = 10
+
const MAX_SERVICE_TYPE_LENGTH = 256
+
const MAX_SERVICE_ENDPOINT_LENGTH = 512
+
const MAX_ID_LENGTH = 32
+
+
export function assertValidIncomingOp(
+
op: unknown,
+
): asserts op is plc.OpOrTombstone {
+
const byteLength = cborEncode(op).byteLength
+
if (byteLength > MAX_OP_BYTES) {
+
throw new ServerError(
+
400,
+
`Operation too large (${MAX_OP_BYTES} bytes maximum in cbor encoding)`,
+
)
+
}
+
if (!check.is(op, plc.def.opOrTombstone)) {
+
throw new ServerError(400, `Not a valid operation: ${JSON.stringify(op)}`)
+
}
+
if (op.type === 'plc_tombstone') {
+
return
+
}
+
if (op.alsoKnownAs.length > MAX_AKA_ENTRIES) {
+
throw new ServerError(
+
400,
+
`To many alsoKnownAs entries (max ${MAX_AKA_ENTRIES})`,
+
)
+
}
+
const akaDupe: Record<string, boolean> = {}
+
for (const aka of op.alsoKnownAs) {
+
if (aka.length > MAX_AKA_LENGTH) {
+
throw new ServerError(
+
400,
+
`alsoKnownAs entry too long (max ${MAX_AKA_LENGTH}): ${aka}`,
+
)
+
}
+
if (akaDupe[aka]) {
+
throw new ServerError(400, `duplicate alsoKnownAs entry: ${aka}`)
+
} else {
+
akaDupe[aka] = true
+
}
+
}
+
if (op.rotationKeys.length > MAX_ROTATION_ENTRIES) {
+
throw new ServerError(
+
400,
+
`Too many rotationKey entries (max ${MAX_ROTATION_ENTRIES})`,
+
)
+
}
+
for (const key of op.rotationKeys) {
+
try {
+
parseDidKey(key)
+
} catch (err) {
+
throw new ServerError(400, `Invalid rotationKey: ${key}`)
+
}
+
}
+
const serviceEntries = Object.entries(op.services)
+
if (serviceEntries.length > MAX_SERVICE_ENTRIES) {
+
throw new ServerError(
+
400,
+
`To many service entries (max ${MAX_SERVICE_ENTRIES})`,
+
)
+
}
+
for (const [id, service] of serviceEntries) {
+
if (id.length > MAX_ID_LENGTH) {
+
throw new ServerError(
+
400,
+
`Service id too long (max ${MAX_ID_LENGTH}): ${id}`,
+
)
+
}
+
if (service.type.length > MAX_SERVICE_TYPE_LENGTH) {
+
throw new ServerError(
+
400,
+
`Service type too long (max ${MAX_SERVICE_TYPE_LENGTH})`,
+
)
+
}
+
if (service.endpoint.length > MAX_SERVICE_ENDPOINT_LENGTH) {
+
throw new ServerError(
+
400,
+
`Service endpoint too long (max ${MAX_SERVICE_ENDPOINT_LENGTH})`,
+
)
+
}
+
}
+
const verifyMethods = Object.entries(op.verificationMethods)
+
for (const [id, key] of verifyMethods) {
+
if (id.length > MAX_ID_LENGTH) {
+
throw new ServerError(
+
400,
+
`Verification Method id too long (max ${MAX_ID_LENGTH}): ${id}`,
+
)
+
}
+
try {
+
parseDidKey(key)
+
} catch (err) {
+
throw new ServerError(400, `Invalid verificationMethod key: ${key}`)
+
}
+
}
+
}
+
+
const HOUR_LIMIT = 10
+
const DAY_LIMIT = 30
+
const WEEK_LIMIT = 100
+
+
export const enforceOpsRateLimit = (ops: plc.IndexedOperation[]) => {
+
const hourAgo = new Date(Date.now() - HOUR)
+
const dayAgo = new Date(Date.now() - DAY)
+
const weekAgo = new Date(Date.now() - DAY * 7)
+
let withinHour = 0
+
let withinDay = 0
+
let withinWeek = 0
+
for (const op of ops) {
+
if (op.createdAt > weekAgo) {
+
withinWeek++
+
if (withinWeek >= WEEK_LIMIT) {
+
throw new ServerError(
+
400,
+
`To many operations within last week (max ${WEEK_LIMIT})`,
+
)
+
}
+
}
+
if (op.createdAt > dayAgo) {
+
withinDay++
+
if (withinDay >= DAY_LIMIT) {
+
throw new ServerError(
+
400,
+
`To many operations within last day (max ${DAY_LIMIT})`,
+
)
+
}
+
}
+
if (op.createdAt > hourAgo) {
+
withinHour++
+
if (withinHour >= HOUR_LIMIT) {
+
throw new ServerError(
+
400,
+
`To many operations within last hour (max ${HOUR_LIMIT})`,
+
)
+
}
+
}
+
}
+
}
+6
packages/server/src/db/index.ts
···
import * as migrations from '../migrations'
import { DatabaseSchema, PlcDatabase } from './types'
import MockDatabase from './mock'
+
import { enforceOpsRateLimit } from '../constraints'
export * from './mock'
export * from './types'
···
const ops = await this.indexedOpsForDid(did)
// throws if invalid
const { nullified, prev } = await plc.assureValidNextOp(did, ops, proposed)
+
// do not enforce rate limits on recovery operations to prevent DDOS by a bad actor
+
if (nullified.length === 0) {
+
enforceOpsRateLimit(ops)
+
}
+
const cid = await cidForCbor(proposed)
await this.db.transaction().execute(async (tx) => {
+2 -8
packages/server/src/routes.ts
···
import express from 'express'
-
import { cborEncode, check } from '@atproto/common'
import * as plc from '@did-plc/lib'
import { ServerError } from './error'
import { AppContext } from './context'
+
import { assertValidIncomingOp } from './constraints'
export const createRouter = (ctx: AppContext): express.Router => {
const router = express.Router()
···
router.post('/:did', async function (req, res) {
const { did } = req.params
const op = req.body
-
const byteLength = cborEncode(op).byteLength
-
if (byteLength > 7500) {
-
throw new ServerError(400, 'Operation too large')
-
}
-
if (!check.is(op, plc.def.compatibleOpOrTombstone)) {
-
throw new ServerError(400, `Not a valid operation: ${JSON.stringify(op)}`)
-
}
+
assertValidIncomingOp(op)
await ctx.db.validateAndAddOp(did, op)
res.sendStatus(200)
})
+19 -18
packages/server/tests/server.test.ts
···
-
import { EcdsaKeypair } from '@atproto/crypto'
+
import { P256Keypair } from '@atproto/crypto'
import * as plc from '@did-plc/lib'
import { CloseFn, runTestServer } from './_util'
import { check } from '@atproto/common'
···
let db: Database
let client: plc.Client
-
let signingKey: EcdsaKeypair
-
let rotationKey1: EcdsaKeypair
-
let rotationKey2: EcdsaKeypair
+
let signingKey: P256Keypair
+
let rotationKey1: P256Keypair
+
let rotationKey2: P256Keypair
let did: string
···
db = server.db
close = server.close
client = new plc.Client(server.url)
-
signingKey = await EcdsaKeypair.create()
-
rotationKey1 = await EcdsaKeypair.create()
-
rotationKey2 = await EcdsaKeypair.create()
+
signingKey = await P256Keypair.create()
+
rotationKey1 = await P256Keypair.create()
+
rotationKey2 = await P256Keypair.create()
})
afterAll(async () => {
···
})
it('can perform some updates', async () => {
-
const newRotationKey = await EcdsaKeypair.create()
-
signingKey = await EcdsaKeypair.create()
+
const newRotationKey = await P256Keypair.create()
+
signingKey = await P256Keypair.create()
handle = 'at://ali.example2.com'
atpPds = 'https://example2.com'
···
})
it('rejects on bad updates', async () => {
-
const newKey = await EcdsaKeypair.create()
+
const newKey = await P256Keypair.create()
const operation = client.updateAtprotoKey(did, newKey, newKey.did())
await expect(operation).rejects.toThrow()
})
it('allows for recovery through a forked history', async () => {
-
const attackerKey = await EcdsaKeypair.create()
+
const attackerKey = await P256Keypair.create()
await client.updateRotationKeys(did, rotationKey2, [attackerKey.did()])
-
const newKey = await EcdsaKeypair.create()
+
const newKey = await P256Keypair.create()
const ops = await client.getOperationLog(did)
const forkPoint = ops.at(-2)
if (!check.is(forkPoint, plc.def.operation)) {
···
it('handles concurrent requests to many docs', async () => {
const COUNT = 20
-
const keys: EcdsaKeypair[] = []
+
const keys: P256Keypair[] = []
for (let i = 0; i < COUNT; i++) {
-
keys.push(await EcdsaKeypair.create())
+
keys.push(await P256Keypair.create())
}
await Promise.all(
keys.map(async (key, index) => {
···
it('resolves races into a coherent history with no forks', async () => {
const COUNT = 20
-
const keys: EcdsaKeypair[] = []
+
const keys: P256Keypair[] = []
for (let i = 0; i < COUNT; i++) {
-
keys.push(await EcdsaKeypair.create())
+
keys.push(await P256Keypair.create())
}
// const prev = await client.getPrev(did)
···
}
})
-
it('still allows create v1s', async () => {
+
it('disallows create v1s', async () => {
const createV1 = await plc.deprecatedSignCreate(
{
type: 'create',
···
signingKey,
)
const did = await didForCreateOp(createV1)
-
await client.sendOperation(did, createV1 as any)
+
const attempt = client.sendOperation(did, createV1 as any)
+
await expect(attempt).rejects.toThrow()
})
it('healthcheck succeeds when database is available.', async () => {
+121 -32
yarn.lock
···
"@jridgewell/gen-mapping" "^0.1.0"
"@jridgewell/trace-mapping" "^0.3.9"
-
"@atproto/common@0.1.1":
-
version "0.1.1"
-
resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.1.1.tgz#ec33a3b4995c91d3ad2e90fc4cdbc65284ceff84"
-
integrity sha512-GYwot5wF/z8iYGSPjrLHuratLc0CVgovmwfJss7+BUOB6y2/Vw8+1Vw0n9DDI0gb5vmx3UI8z0uJgC8aa8yuJg==
+
"@atproto/common-web@*":
+
version "0.2.0"
+
resolved "https://registry.yarnpkg.com/@atproto/common-web/-/common-web-0.2.0.tgz#8420da28e89dac64ad2a11b6ff10a4023c67151f"
+
integrity sha512-ugKrT8CWf6PDsZ29VOhOCs5K4z9BAFIV7SxPXA+MHC7pINqQ+wyjIq+DtUI8kmUSce1dTqc/lMN1akf/W5whVQ==
+
dependencies:
+
graphemer "^1.4.0"
+
multiformats "^9.6.4"
+
uint8arrays "3.0.0"
+
zod "^3.21.4"
+
+
"@atproto/common@0.3.0":
+
version "0.3.0"
+
resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.3.0.tgz#6ddb0a9bedbf9058353a241b056ae83539da3539"
+
integrity sha512-R5d50Da63wQdAYaHe+rne5nM/rSYIWBaDZtVKpluysG86U1rRIgrG4qEQ/tNDt6WzYcxKXkX4EOeVvGtav2twg==
dependencies:
+
"@atproto/common-web" "*"
"@ipld/dag-cbor" "^7.0.3"
+
cbor-x "^1.5.1"
multiformats "^9.6.4"
pino "^8.6.1"
-
zod "^3.14.2"
-
"@atproto/crypto@0.1.0":
-
version "0.1.0"
-
resolved "https://registry.yarnpkg.com/@atproto/crypto/-/crypto-0.1.0.tgz#bc73a479f9dbe06fa025301c182d7f7ab01bc568"
-
integrity sha512-9xgFEPtsCiJEPt9o3HtJT30IdFTGw5cQRSJVIy5CFhqBA4vDLcdXiRDLCjkzHEVbtNCsHUW6CrlfOgbeLPcmcg==
+
"@atproto/crypto@0.2.2":
+
version "0.2.2"
+
resolved "https://registry.yarnpkg.com/@atproto/crypto/-/crypto-0.2.2.tgz#9832dda885512a36401d24f95990489f521593ef"
+
integrity sha512-yepwM6pLPw/bT7Nl0nfDw251yVDpuhc0llOgD8YdCapUAH7pIn4dBcMgXiA9UzQaHA7OC9ByO5IdGPrMN/DmZw==
dependencies:
-
"@noble/secp256k1" "^1.7.0"
-
big-integer "^1.6.51"
-
multiformats "^9.6.4"
-
one-webcrypto "^1.0.3"
+
"@noble/curves" "^1.1.0"
+
"@noble/hashes" "^1.3.1"
uint8arrays "3.0.0"
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6":
···
version "0.2.3"
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
+
+
"@cbor-extract/cbor-extract-darwin-arm64@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.1.1.tgz#5721f6dd3feae0b96d23122853ce977e0671b7a6"
+
integrity sha512-blVBy5MXz6m36Vx0DfLd7PChOQKEs8lK2bD1WJn/vVgG4FXZiZmZb2GECHFvVPA5T7OnODd9xZiL3nMCv6QUhA==
+
+
"@cbor-extract/cbor-extract-darwin-x64@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-darwin-x64/-/cbor-extract-darwin-x64-2.1.1.tgz#c25e7d0133950d87d101d7b3afafea8d50d83f5f"
+
integrity sha512-h6KFOzqk8jXTvkOftyRIWGrd7sKQzQv2jVdTL9nKSf3D2drCvQB/LHUxAOpPXo3pv2clDtKs3xnHalpEh3rDsw==
+
+
"@cbor-extract/cbor-extract-linux-arm64@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-arm64/-/cbor-extract-linux-arm64-2.1.1.tgz#48f78e7d8f0fcc84ed074b6bfa6d15dd83187c63"
+
integrity sha512-SxAaRcYf8S0QHaMc7gvRSiTSr7nUYMqbUdErBEu+HYA4Q6UNydx1VwFE68hGcp1qvxcy9yT5U7gA+a5XikfwSQ==
+
+
"@cbor-extract/cbor-extract-linux-arm@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-arm/-/cbor-extract-linux-arm-2.1.1.tgz#7507d346389cb682e44fab8fae9534edd52e2e41"
+
integrity sha512-ds0uikdcIGUjPyraV4oJqyVE5gl/qYBpa/Wnh6l6xLE2lj/hwnjT2XcZCChdXwW/YFZ1LUHs6waoYN8PmK0nKQ==
+
+
"@cbor-extract/cbor-extract-linux-x64@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-x64/-/cbor-extract-linux-x64-2.1.1.tgz#b7c1d2be61c58ec18d58afbad52411ded63cd4cd"
+
integrity sha512-GVK+8fNIE9lJQHAlhOROYiI0Yd4bAZ4u++C2ZjlkS3YmO6hi+FUxe6Dqm+OKWTcMpL/l71N6CQAmaRcb4zyJuA==
+
+
"@cbor-extract/cbor-extract-win32-x64@2.1.1":
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-win32-x64/-/cbor-extract-win32-x64-2.1.1.tgz#21b11a1a3f18c3e7d62fd5f87438b7ed2c64c1f7"
+
integrity sha512-2Niq1C41dCRIDeD8LddiH+mxGlO7HJ612Ll3D/E73ZWBmycued+8ghTr/Ho3CMOWPUEr08XtyBMVXAjqF+TcKw==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
···
npmlog "^4.1.2"
write-file-atomic "^3.0.3"
-
"@noble/secp256k1@^1.7.0":
-
version "1.7.0"
-
resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.0.tgz"
-
integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw==
+
"@noble/curves@^1.1.0":
+
version "1.2.0"
+
resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35"
+
integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==
+
dependencies:
+
"@noble/hashes" "1.3.2"
+
+
"@noble/hashes@1.3.2", "@noble/hashes@^1.3.1":
+
version "1.3.2"
+
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39"
+
integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
···
resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz"
integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==
-
big-integer@^1.6.51:
-
version "1.6.51"
-
resolved "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz"
-
integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==
-
body-parser@1.20.1:
version "1.20.1"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668"
···
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==
+
cbor-extract@^2.1.1:
+
version "2.1.1"
+
resolved "https://registry.yarnpkg.com/cbor-extract/-/cbor-extract-2.1.1.tgz#f154b31529fdb6b7c70fb3ca448f44eda96a1b42"
+
integrity sha512-1UX977+L+zOJHsp0mWFG13GLwO6ucKgSmSW6JTl8B9GUvACvHeIVpFqhU92299Z6PfD09aTXDell5p+lp1rUFA==
+
dependencies:
+
node-gyp-build-optional-packages "5.0.3"
+
optionalDependencies:
+
"@cbor-extract/cbor-extract-darwin-arm64" "2.1.1"
+
"@cbor-extract/cbor-extract-darwin-x64" "2.1.1"
+
"@cbor-extract/cbor-extract-linux-arm" "2.1.1"
+
"@cbor-extract/cbor-extract-linux-arm64" "2.1.1"
+
"@cbor-extract/cbor-extract-linux-x64" "2.1.1"
+
"@cbor-extract/cbor-extract-win32-x64" "2.1.1"
+
+
cbor-x@^1.5.1:
+
version "1.5.4"
+
resolved "https://registry.yarnpkg.com/cbor-x/-/cbor-x-1.5.4.tgz#8f0754fa8589cbd7339b613b2b5717d133508e98"
+
integrity sha512-PVKILDn+Rf6MRhhcyzGXi5eizn1i0i3F8Fe6UMMxXBnWkalq9+C5+VTmlIjAYM4iF2IYF2N+zToqAfYOp+3rfw==
+
optionalDependencies:
+
cbor-extract "^2.1.1"
+
cborg@^1.6.0:
version "1.9.5"
resolved "https://registry.npmjs.org/cborg/-/cborg-1.9.5.tgz"
···
integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==
dependencies:
is-obj "^2.0.0"
+
+
dotenv@^16.0.0:
+
version "16.3.1"
+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
+
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==
dotenv@^16.0.3:
version "16.0.3"
···
resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz"
integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==
+
graphemer@^1.4.0:
+
version "1.4.0"
+
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
+
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
+
handlebars@^4.7.7:
version "4.7.7"
resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz"
···
dependencies:
whatwg-url "^5.0.0"
+
node-gyp-build-optional-packages@5.0.3:
+
version "5.0.3"
+
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.3.tgz#92a89d400352c44ad3975010368072b41ad66c17"
+
integrity sha512-k75jcVzk5wnnc/FMxsf4udAoTEUv2jY3ycfdSd3yWu6Cnd1oee6/CfZJApyscA4FJOmdoixWwiwOyf16RzD5JA==
+
node-gyp@^5.0.2:
version "5.1.1"
resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz"
···
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
dependencies:
wrappy "1"
-
-
one-webcrypto@^1.0.3:
-
version "1.0.3"
-
resolved "https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.3.tgz"
-
integrity sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q==
onetime@^5.1.0, onetime@^5.1.2:
version "5.1.2"
···
resolved "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.0.0.tgz"
integrity sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ==
-
pino@^8.0.0, pino@^8.11.0, pino@^8.6.1:
+
pino@^8.0.0, pino@^8.11.0:
version "8.11.0"
resolved "https://registry.yarnpkg.com/pino/-/pino-8.11.0.tgz#2a91f454106b13e708a66c74ebc1c2ab7ab38498"
integrity sha512-Z2eKSvlrl2rH8p5eveNUnTdd4AjJk8tAsLkHYZQKGHP4WTh2Gi1cOSOs3eWPqaj+niS3gj4UkoreoaWgF3ZWYg==
···
sonic-boom "^3.1.0"
thread-stream "^2.0.0"
+
pino@^8.6.1:
+
version "8.15.0"
+
resolved "https://registry.yarnpkg.com/pino/-/pino-8.15.0.tgz#67c61d5e397bf297e5a0433976a7f7b8aa6f876b"
+
integrity sha512-olUADJByk4twxccmAxb1RiGKOSvddHugCV3wkqjyv+3Sooa2KLrmXrKEWOKi0XPCLasRR5jBXxioE1jxUa4KzQ==
+
dependencies:
+
atomic-sleep "^1.0.0"
+
fast-redact "^3.1.1"
+
on-exit-leak-free "^2.1.0"
+
pino-abstract-transport v1.0.0
+
pino-std-serializers "^6.0.0"
+
process-warning "^2.0.0"
+
quick-format-unescaped "^4.0.3"
+
real-require "^0.2.0"
+
safe-stable-stringify "^2.3.1"
+
sonic-boom "^3.1.0"
+
thread-stream "^2.0.0"
+
pirates@^4.0.4:
version "4.0.5"
resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz"
···
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
-
zod@^3.14.2:
-
version "3.19.1"
-
resolved "https://registry.npmjs.org/zod/-/zod-3.19.1.tgz"
-
integrity sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==
+
zod@^3.21.4:
+
version "3.22.2"
+
resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b"
+
integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==