profile_metadata.v1.json (14852B)
1 { 2 "suite": "profile_metadata", 3 "contract_version": "1.0.0", 4 "vectors": [ 5 { 6 "id": "profile_nip05_valid_root_identifier_001", 7 "kind": "profile.nip05.parse.valid", 8 "input": { 9 "identifier": "_@mossstreet.example" 10 }, 11 "expected": { 12 "identifier": "_@mossstreet.example", 13 "local_part": "_", 14 "domain": "mossstreet.example", 15 "identity_verification": "not_performed" 16 } 17 }, 18 { 19 "id": "profile_nip05_valid_uppercase_domain_001", 20 "kind": "profile.nip05.parse.valid", 21 "input": { 22 "identifier": "alice@MossStreet.EXAMPLE" 23 }, 24 "expected": { 25 "identifier": "alice@mossstreet.example", 26 "local_part": "alice", 27 "domain": "mossstreet.example", 28 "identity_verification": "not_performed" 29 } 30 }, 31 { 32 "id": "profile_nip05_invalid_upper_local_001", 33 "kind": "profile.nip05.parse.invalid", 34 "input": { 35 "identifier": "Alice@mossstreet.example" 36 }, 37 "expected": { 38 "error": "invalid_local_part" 39 } 40 }, 41 { 42 "id": "profile_nip05_invalid_multiple_separator_001", 43 "kind": "profile.nip05.parse.invalid", 44 "input": { 45 "identifier": "alice@mossstreet.example@other.example" 46 }, 47 "expected": { 48 "error": "multiple_separators" 49 } 50 }, 51 { 52 "id": "profile_authored_required_name_001", 53 "kind": "profile.build_authored_draft.valid", 54 "input": { 55 "profile": { 56 "name": "moss-street-farm" 57 } 58 }, 59 "expected": { 60 "wire_parts": { 61 "kind": 0, 62 "content": "{\"name\":\"moss-street-farm\"}", 63 "tags": [] 64 }, 65 "upload_completion": "not_attested_by_codec" 66 } 67 }, 68 { 69 "id": "profile_authored_content_limit_exact_001", 70 "kind": "profile.build_authored_draft.limit.valid", 71 "input": { 72 "generated_name_bytes": 131061 73 }, 74 "expected": { 75 "kind": 0, 76 "content_bytes": 131072, 77 "tags": [], 78 "upload_completion": "not_attested_by_codec" 79 } 80 }, 81 { 82 "id": "profile_authored_complete_blossom_metadata_001", 83 "kind": "profile.build_authored_draft.valid", 84 "input": { 85 "profile": { 86 "name": "moss-street-farm", 87 "display_name": "Moss Street Farm", 88 "about": "Small urban farm in Victoria, B.C.", 89 "picture": { 90 "bytes_utf8": "victoria-profile", 91 "descriptor": { 92 "url": "https://media.example/9c31d190b20b9ccf039ed13f758e976f13b716cd73dee6cb57a7b0550540d06d.webp", 93 "sha256": "9c31d190b20b9ccf039ed13f758e976f13b716cd73dee6cb57a7b0550540d06d", 94 "size": 16, 95 "type": "image/webp", 96 "uploaded": 1784347200 97 } 98 }, 99 "banner": { 100 "bytes_utf8": "victoria-banner", 101 "descriptor": { 102 "url": "https://media.example/55384b73c8df8a842891346dcf614e46f9fedd6c15fde95a157f7172a113209a.webp", 103 "sha256": "55384b73c8df8a842891346dcf614e46f9fedd6c15fde95a157f7172a113209a", 104 "size": 15, 105 "type": "image/webp", 106 "uploaded": 1784347201 107 } 108 }, 109 "nip05": "_@mossstreet.example", 110 "bot": false 111 } 112 }, 113 "expected": { 114 "wire_parts": { 115 "kind": 0, 116 "content": "{\"name\":\"moss-street-farm\",\"display_name\":\"Moss Street Farm\",\"about\":\"Small urban farm in Victoria, B.C.\",\"picture\":\"https://media.example/9c31d190b20b9ccf039ed13f758e976f13b716cd73dee6cb57a7b0550540d06d.webp\",\"banner\":\"https://media.example/55384b73c8df8a842891346dcf614e46f9fedd6c15fde95a157f7172a113209a.webp\",\"nip05\":\"_@mossstreet.example\",\"bot\":false}", 117 "tags": [] 118 }, 119 "upload_completion": "not_attested_by_codec" 120 } 121 }, 122 { 123 "id": "profile_authored_boolean_true_001", 124 "kind": "profile.build_authored_draft.valid", 125 "input": { 126 "profile": { 127 "name": "harvest-bot", 128 "bot": true 129 } 130 }, 131 "expected": { 132 "wire_parts": { 133 "kind": 0, 134 "content": "{\"name\":\"harvest-bot\",\"bot\":true}", 135 "tags": [] 136 }, 137 "upload_completion": "not_attested_by_codec" 138 } 139 }, 140 { 141 "id": "profile_authored_json_escaping_001", 142 "kind": "profile.build_authored_draft.valid", 143 "input": { 144 "profile": { 145 "name": "moss\"\\farm", 146 "about": "line\nfeed\t\u00e9" 147 } 148 }, 149 "expected": { 150 "wire_parts": { 151 "kind": 0, 152 "content": "{\"name\":\"moss\\\"\\\\farm\",\"about\":\"line\\nfeed\\t\u00e9\"}", 153 "tags": [] 154 }, 155 "upload_completion": "not_attested_by_codec" 156 } 157 }, 158 { 159 "id": "profile_authored_empty_name_001", 160 "kind": "profile.authored.new.invalid", 161 "input": { 162 "name": "" 163 }, 164 "expected": { 165 "error": "invalid_name" 166 } 167 }, 168 { 169 "id": "profile_authored_whitespace_name_001", 170 "kind": "profile.authored.new.invalid", 171 "input": { 172 "name": " \t " 173 }, 174 "expected": { 175 "error": "invalid_name" 176 } 177 }, 178 { 179 "id": "profile_authored_control_name_001", 180 "kind": "profile.authored.new.invalid", 181 "input": { 182 "name": "moss\nstreet" 183 }, 184 "expected": { 185 "error": "invalid_name" 186 } 187 }, 188 { 189 "id": "profile_authored_non_image_descriptor_001", 190 "kind": "profile.image.from_verified_descriptor.invalid", 191 "input": { 192 "media": { 193 "bytes_utf8": "not-an-image", 194 "descriptor": { 195 "url": "https://media.example/f2e2c6db1745cc40df646dc40c385487c36e4ceb3f1d5c8d6ad1f7620af1ebae.txt", 196 "sha256": "f2e2c6db1745cc40df646dc40c385487c36e4ceb3f1d5c8d6ad1f7620af1ebae", 197 "size": 12, 198 "type": "text/plain", 199 "uploaded": 1784347202 200 } 201 } 202 }, 203 "expected": { 204 "error": "media_type_not_image" 205 } 206 }, 207 { 208 "id": "profile_authored_content_too_large_001", 209 "kind": "profile.build_authored_draft.invalid", 210 "input": { 211 "generated_name_bytes": 131062 212 }, 213 "expected": { 214 "error": "content_too_large", 215 "max": 131072, 216 "actual": 131073 217 } 218 }, 219 { 220 "id": "profile_inbound_missing_name_001", 221 "kind": "profile.parse_inbound_metadata.valid", 222 "input": { 223 "content": "{}" 224 }, 225 "expected": { 226 "projected": {}, 227 "residual_fields": {}, 228 "identity_verification": "not_performed" 229 } 230 }, 231 { 232 "id": "profile_inbound_complete_boolean_true_001", 233 "kind": "profile.parse_inbound_metadata.valid", 234 "input": { 235 "content": "{\"name\":\"alice\",\"display_name\":\"Alice\",\"about\":\"Victoria gardener\",\"website\":\"https://alice.example\",\"nip05\":\"alice@example.com\",\"lud06\":\"lnurl1alice\",\"lud16\":\"alice@example.com\",\"bot\":true}" 236 }, 237 "expected": { 238 "projected": { 239 "name": "alice", 240 "display_name": "Alice", 241 "about": "Victoria gardener", 242 "nip05": "alice@example.com", 243 "bot": true 244 }, 245 "residual_fields": { 246 "website": "https://alice.example", 247 "lud06": "lnurl1alice", 248 "lud16": "alice@example.com" 249 }, 250 "identity_verification": "not_performed" 251 } 252 }, 253 { 254 "id": "profile_inbound_uppercase_nip05_domain_001", 255 "kind": "profile.parse_inbound_metadata.valid", 256 "input": { 257 "content": "{\"nip05\":\"alice@MossStreet.EXAMPLE\"}" 258 }, 259 "expected": { 260 "projected": { 261 "nip05": "alice@mossstreet.example" 262 }, 263 "residual_fields": {}, 264 "identity_verification": "not_performed" 265 } 266 }, 267 { 268 "id": "profile_inbound_boolean_false_001", 269 "kind": "profile.parse_inbound_metadata.valid", 270 "input": { 271 "content": "{\"bot\":false}" 272 }, 273 "expected": { 274 "projected": { 275 "bot": false 276 }, 277 "residual_fields": {}, 278 "identity_verification": "not_performed" 279 } 280 }, 281 { 282 "id": "profile_inbound_arbitrary_media_unverified_001", 283 "kind": "profile.parse_inbound_metadata.valid", 284 "input": { 285 "content": "{\"picture\":\"https://legacy.example/avatar.jpg\",\"banner\":\"ipfs://legacy-banner\"}" 286 }, 287 "expected": { 288 "projected": { 289 "picture": "https://legacy.example/avatar.jpg", 290 "banner": "ipfs://legacy-banner" 291 }, 292 "residual_fields": {}, 293 "media_verification": { 294 "picture": "unverified", 295 "banner": "unverified" 296 }, 297 "identity_verification": "not_performed" 298 } 299 }, 300 { 301 "id": "profile_inbound_blossom_shape_still_unverified_001", 302 "kind": "profile.parse_inbound_metadata.valid", 303 "input": { 304 "content": "{\"picture\":\"https://media.example/9c31d190b20b9ccf039ed13f758e976f13b716cd73dee6cb57a7b0550540d06d.webp\"}" 305 }, 306 "expected": { 307 "projected": { 308 "picture": "https://media.example/9c31d190b20b9ccf039ed13f758e976f13b716cd73dee6cb57a7b0550540d06d.webp" 309 }, 310 "residual_fields": {}, 311 "media_verification": { 312 "picture": "unverified" 313 }, 314 "identity_verification": "not_performed" 315 } 316 }, 317 { 318 "id": "profile_inbound_wrong_types_and_unknown_fields_001", 319 "kind": "profile.parse_inbound_metadata.valid", 320 "input": { 321 "content": "{\"name\":42,\"display_name\":null,\"nip05\":\"Alice@example.com\",\"picture\":{\"url\":\"https://legacy.example/avatar.jpg\"},\"bot\":\"true\",\"birthday\":{\"year\":1988,\"month\":6},\"custom\":{\"nested\":[1,true]}}" 322 }, 323 "expected": { 324 "projected": {}, 325 "residual_fields": { 326 "name": 42, 327 "display_name": null, 328 "nip05": "Alice@example.com", 329 "picture": { 330 "url": "https://legacy.example/avatar.jpg" 331 }, 332 "bot": "true", 333 "birthday": { 334 "year": 1988, 335 "month": 6 336 }, 337 "custom": { 338 "nested": [ 339 1, 340 true 341 ] 342 } 343 }, 344 "identity_verification": "not_performed" 345 } 346 }, 347 { 348 "id": "profile_inbound_wrong_type_nip05_001", 349 "kind": "profile.parse_inbound_metadata.valid", 350 "input": { 351 "content": "{\"nip05\":42}" 352 }, 353 "expected": { 354 "projected": {}, 355 "residual_fields": { 356 "nip05": 42 357 }, 358 "identity_verification": "not_performed" 359 } 360 }, 361 { 362 "id": "profile_inbound_deprecated_fields_retained_001", 363 "kind": "profile.parse_inbound_metadata.valid", 364 "input": { 365 "content": "{\"displayName\":\"Legacy Display\",\"username\":\"legacy-name\"}" 366 }, 367 "expected": { 368 "projected": {}, 369 "residual_fields": { 370 "displayName": "Legacy Display", 371 "username": "legacy-name" 372 }, 373 "identity_verification": "not_performed" 374 } 375 }, 376 { 377 "id": "profile_inbound_raw_whitespace_escape_nested_duplicate_001", 378 "kind": "profile.parse_inbound_metadata.valid", 379 "input": { 380 "content": " { \"about\":\"line\\nfeed\", \"custom\":{\"key\":1,\"key\":2} } " 381 }, 382 "expected": { 383 "projected": { 384 "about": "line\nfeed" 385 }, 386 "residual_fields": { 387 "custom": { 388 "key": 2 389 } 390 }, 391 "identity_verification": "not_performed" 392 } 393 }, 394 { 395 "id": "profile_inbound_content_limit_exact_001", 396 "kind": "profile.parse_inbound_metadata.limit.valid", 397 "input": { 398 "generated_content_bytes": 131072 399 }, 400 "expected": { 401 "content_bytes": 131072 402 } 403 }, 404 { 405 "id": "profile_inbound_content_limit_exceeded_001", 406 "kind": "profile.parse_inbound_metadata.invalid", 407 "input": { 408 "generated_content_bytes": 131073 409 }, 410 "expected": { 411 "error": "content_too_large", 412 "max": 131072, 413 "actual": 131073 414 } 415 }, 416 { 417 "id": "profile_inbound_malformed_json_001", 418 "kind": "profile.parse_inbound_metadata.invalid", 419 "input": { 420 "content": "{" 421 }, 422 "expected": { 423 "error": "invalid_json" 424 } 425 }, 426 { 427 "id": "profile_inbound_malformed_array_001", 428 "kind": "profile.parse_inbound_metadata.invalid", 429 "input": { 430 "content": "[1," 431 }, 432 "expected": { 433 "error": "invalid_json" 434 } 435 }, 436 { 437 "id": "profile_inbound_non_object_array_001", 438 "kind": "profile.parse_inbound_metadata.invalid", 439 "input": { 440 "content": "[1]" 441 }, 442 "expected": { 443 "error": "root_not_object" 444 } 445 }, 446 { 447 "id": "profile_inbound_non_object_null_001", 448 "kind": "profile.parse_inbound_metadata.invalid", 449 "input": { 450 "content": "null" 451 }, 452 "expected": { 453 "error": "root_not_object" 454 } 455 }, 456 { 457 "id": "profile_inbound_non_object_boolean_001", 458 "kind": "profile.parse_inbound_metadata.invalid", 459 "input": { 460 "content": "true" 461 }, 462 "expected": { 463 "error": "root_not_object" 464 } 465 }, 466 { 467 "id": "profile_inbound_non_object_negative_integer_001", 468 "kind": "profile.parse_inbound_metadata.invalid", 469 "input": { 470 "content": "-1" 471 }, 472 "expected": { 473 "error": "root_not_object" 474 } 475 }, 476 { 477 "id": "profile_inbound_non_object_unsigned_integer_001", 478 "kind": "profile.parse_inbound_metadata.invalid", 479 "input": { 480 "content": "1" 481 }, 482 "expected": { 483 "error": "root_not_object" 484 } 485 }, 486 { 487 "id": "profile_inbound_non_object_float_001", 488 "kind": "profile.parse_inbound_metadata.invalid", 489 "input": { 490 "content": "1.5" 491 }, 492 "expected": { 493 "error": "root_not_object" 494 } 495 }, 496 { 497 "id": "profile_inbound_non_object_string_001", 498 "kind": "profile.parse_inbound_metadata.invalid", 499 "input": { 500 "content": "\"profile\"" 501 }, 502 "expected": { 503 "error": "root_not_object" 504 } 505 }, 506 { 507 "id": "profile_inbound_duplicate_field_001", 508 "kind": "profile.parse_inbound_metadata.invalid", 509 "input": { 510 "content": "{\"name\":\"first\",\"name\":\"second\",\"name\":\"third\"}" 511 }, 512 "expected": { 513 "error": "duplicate_field", 514 "field": "name" 515 } 516 } 517 ] 518 }