Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/quiet/qn3http.om # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / quiet / qn3http.om` 701 lines ยท 11012 bytes Raw Blame History 1 note quiet/qn3http.om: /notifications, /notifications.json, the patch receipt section and .receipt JSON. 2 note qnpage only reads a digest file. qnregen runs from qnpost and from forge-contribute. 3 text tqnrel "notifications" 4 text tqjv "{\"format\":\"FORGE-EVIDENCE\",\"v\":1,\"verify\":\"" 5 text tqjv2 "\",\"reason\":\"" 6 text tqjv3 "\",\"commit\":\"" 7 text tqjv4 "\",\"tree\":\"" 8 text tqjv5 "\",\"rc\":" 9 text tqjv6 ",\"out\":\"" 10 text tqjv7 "\",\"agent\":\"" 11 text tqjv8 "\",\"cmd\":\"" 12 text tqempty "{\"format\":\"QUIET-DIGEST\",\"v\":1,\"quiet\":true,\"count\":0}\n" 13 text tqjd1 "{\"format\":\"QUIET-DIGEST\",\"v\":1,\"quiet\":false,\"count\":" 14 text tqjd2 ",\"body\":\"" 15 text tqnt "Notifications" 16 text tqnp "/notifications" 17 text tqnj "/notifications.json" 18 text tqrsuf ".receipt" 19 text tqrevp "rev-parse" 20 text tqtree "^{tree}" 21 text tqlogin "login" 22 text tqjson "application/json" 23 text tqpass "PASS" 24 text tqref "REFUSED" 25 text tqmiss "missing" 26 text tqred "redacted" 27 text tqpar "parse" 28 text tqbind "bind" 29 text tqcom "commit" 30 text tqtreer "tree" 31 text tqnull "null" 32 text tqagent "agent" 33 text tqrepo "repo" 34 text tqdash "-" 35 text tqh1 "

Evidence receipt

\n" 36 text tqh2 "

verify " 37 text tqh3 "

\n

commit " 38 text tqh4 "

\n

tree " 39 text tqh5 "

\n

command " 40 text tqh6 "

\n

exit " 41 text tqh7 " · output sha256 " 42 text tqh8 "

\n

agent " 43 text tqh9 "

\n

machine-checkable receipt

\n
\n" 45 text tqhb "

No evidence receipt on this patch. The machine-checkable link still answers, and it refuses.

\n

" 47 text tqbad "" 48 text tqbe "" 49 text tqnp1 "

Notifications

\n

Quiet by default. One digest, written when you save a filter or when a patch event arrives. Opening this page does not write a digest.

\n" 50 text tqnp2 "
"

51 text tqnp3 "
\n" 52 text tqnp4 "

No digest file. Nothing is listed.

\n" 53 text tqfm1 "
\n\n\n
\n

Use * for any. Put - in either field to go quiet again.

\n
\n" 56 text tqwhy "Set a display name of letters, digits and hyphens before saving a filter." 57 text tqbadf "Agent and repo use letters, digits, hyphens, or * . - clears the filter." 58 global qnhd uchar 40 59 global qndig uchar 8192 60 global qndigl ulong 1 61 global qnba uchar 40 62 global qnbal ulong 1 63 global qnbr uchar 40 64 global qnbrl ulong 1 65 global qnbuf uchar 8192 66 global qnbl ulong 1 67 global qnbov ulong 1 68 fn qnends a ulong n ulong to bool 69 if le n add a 8 70 ret false 71 end 72 s = sub n 8 73 for i ulong 8 74 if ne get frest add s i get tqrsuf i 75 ret false 76 end 77 end 78 ret true 79 end 80 fn qnload to void 81 put qnrcl 0 0 82 put qnst 0 0 83 if eq get gcrn 0 0 84 ret 85 end 86 r = sub get gcrn 0 1 87 for i ulong 40 88 put qnhd i get gcro add mul r 40 i 89 end 90 if eq get gcrx r 1 91 put qnst 0 1 92 ret 93 end 94 o = get gcrd mul r 2 95 n = get gcrd add mul r 2 1 96 if gt n 1024 97 n = ulong 1024 98 end 99 for i ulong n bound 1024 100 put qnrc i get gcpool add o i 101 end 102 put qnrcl 0 n 103 end 104 fn qnheq to bool 105 for i ulong 40 106 if ne get qncm i get qnhd i 107 ret false 108 end 109 end 110 ret true 111 end 112 fn qngitree to bool 113 fkgit 114 fka tqrevp 115 fkopen 116 for i ulong 40 117 fkc get qnhd i 118 end 119 fkt tqtree 120 r = fexec `5000000000` 121 if ne r 0 122 ret false 123 end 124 if lt get fxol 0 40 125 ret false 126 end 127 for i ulong 40 128 if ne get fxo i get qntr i 129 ret false 130 end 131 end 132 ret true 133 end 134 fn qncheck to void 135 qnload 136 if eq get qnst 0 1 137 ret 138 end 139 if not qnparse 140 ret 141 end 142 if not qnbindok 143 ret 144 end 145 if not qnheq 146 put qnst 0 4 147 ret 148 end 149 if not qngitree 150 put qnst 0 5 151 ret 152 end 153 put qnst 0 6 154 end 155 fn qnwhy to void 156 s = get qnst 0 157 if eq s 6 158 fput tqpass 159 ret 160 end 161 if eq s 0 162 fput tqmiss 163 ret 164 end 165 if eq s 1 166 fput tqred 167 ret 168 end 169 if eq s 2 170 fput tqpar 171 ret 172 end 173 if eq s 3 174 fput tqbind 175 ret 176 end 177 if eq s 4 178 fput tqcom 179 ret 180 end 181 fput tqtreer 182 end 183 fn qnlink to void 184 fputb 185 fputrepo 186 fput tcpats 187 fputc 47 188 for i ulong get gcrql 0 bound 40 189 fescc get gcrq i 190 end 191 fput tqrsuf 192 end 193 fn qnshow to void 194 qncheck 195 fput tqh1 196 fput tqh2 197 if eq get qnst 0 6 198 fput tqok1 199 fput tqpass 200 fput tqbe 201 end 202 if ne get qnst 0 6 203 fput tqbad 204 fput tqref 205 fputc 32 206 qnwhy 207 fput tqbe 208 end 209 fput tqh3 210 if gt get qnst 0 2 211 for i ulong 40 212 fescc get qncm i 213 end 214 end 215 fput tqh4 216 if gt get qnst 0 2 217 for i ulong 40 218 fescc get qntr i 219 end 220 end 221 fput tqh5 222 if gt get qnst 0 2 223 for i ulong get qncmdl 0 bound 200 224 fescc get qncmd i 225 end 226 end 227 fput tqh6 228 if gt get qnst 0 2 229 fnum get qnrcn 0 230 end 231 fput tqh7 232 if gt get qnst 0 2 233 for i ulong 64 234 fescc get qnout64 i 235 end 236 end 237 fput tqh8 238 if gt get qnst 0 2 239 for i ulong get qnagl 0 bound 40 240 fescc get qnag i 241 end 242 end 243 fput tqh9 244 qnlink 245 fput tqha 246 end 247 fn qnjesc c uchar to void 248 if eq c 34 249 fputc 92 250 fputc 34 251 ret 252 end 253 if eq c 92 254 fputc 92 255 fputc 92 256 ret 257 end 258 if or lt c 32 eq c 127 259 fputc 63 260 ret 261 end 262 fputc c 263 end 264 fn qnjson to void 265 put fkind 0 1 266 fsetct tqjson 267 fput tqjv 268 if eq get qnst 0 6 269 fput tqpass 270 end 271 if ne get qnst 0 6 272 fput tqref 273 end 274 fput tqjv2 275 qnwhy 276 fput tqjv3 277 if gt get qnst 0 2 278 for i ulong 40 279 fputc get qncm i 280 end 281 end 282 fput tqjv4 283 if gt get qnst 0 2 284 for i ulong 40 285 fputc get qntr i 286 end 287 end 288 fput tqjv5 289 if gt get qnst 0 2 290 fnum get qnrcn 0 291 end 292 if le get qnst 0 2 293 fput tqnull 294 end 295 fput tqjv6 296 if gt get qnst 0 2 297 for i ulong 64 298 fputc get qnout64 i 299 end 300 end 301 fput tqjv7 302 if gt get qnst 0 2 303 for i ulong get qnagl 0 bound 40 304 qnjesc get qnag i 305 end 306 end 307 fput tqjv8 308 if gt get qnst 0 2 309 for i ulong get qncmdl 0 bound 200 310 qnjesc get qncmd i 311 end 312 end 313 fputc 34 314 fputc 125 315 fputc 10 316 end 317 fn qnraw to long 318 if eq corefs 1 false 319 ret 500 320 end 321 if eq coresolve false 322 ret 404 323 end 324 if eq coload 1 false 325 ret 404 326 end 327 if ne get gcov 0 0 328 fincut 329 ret 500 330 end 331 qncheck 332 qnjson 333 ret 200 334 end 335 fn qnsess to long 336 x = sosess 337 ret x 338 end 339 fn qnpage js ulong to long 340 x = sosess 341 if eq get fuserl 0 0 342 if eq js 1 343 put fkind 0 1 344 fsetct tqjson 345 fput tqempty 346 ret 401 347 end 348 put fkind 0 2 349 flocb 350 floct tqlogin 351 ret 303 352 end 353 qnsetg 354 qnpfx tqod 355 for i ulong get fuserl 0 bound 64 356 fpc get fuser i 357 end 358 put qndigl 0 0 359 if qnread 360 n = get fxol 0 361 if gt n 8192 362 n = ulong 8192 363 end 364 for i ulong n bound 8192 365 put qndig i get fxo i 366 end 367 put qndigl 0 n 368 end 369 if eq js 1 370 ret qnjd 371 end 372 fsetti tqnt 373 fput tqnp1 374 if eq get qndigl 0 0 375 fput tqnp4 376 end 377 if gt get qndigl 0 0 378 fput tqnp2 379 for i ulong get qndigl 0 bound 8192 380 fescc get qndig i 381 end 382 fput tqnp3 383 end 384 fput tqfm1 385 fputb 386 fput tqnrel 387 fput tqfm2 388 socsrfout 389 fput tqfm3 390 ret 200 391 end 392 fn qnjd to long 393 put fkind 0 1 394 fsetct tqjson 395 if eq get qndigl 0 0 396 fput tqempty 397 ret 200 398 end 399 fput tqjd1 400 c = qncount 401 fnum c 402 fput tqjd2 403 for i ulong get qndigl 0 bound 8192 404 qnjesc get qndig i 405 end 406 fputc 34 407 fputc 125 408 fputc 10 409 ret 200 410 end 411 fn qncount to ulong 412 n = ulong 0 413 head = true 414 p = ulong 0 415 while lt p get qndigl 0 bound 8192 416 c = get qndig p 417 if and head and ge c 48 le c 57 418 n = add n 1 419 end 420 head = eq c 10 421 p = add p 1 422 end 423 ret n 424 end 425 fn qntok1 c uchar to bool 426 if and ge c 48 le c 57 427 ret true 428 end 429 if and ge c 97 le c 122 430 ret true 431 end 432 if eq c 45 433 ret true 434 end 435 if eq c 42 436 ret true 437 end 438 ret false 439 end 440 fn qnokb w ulong i ulong to uchar 441 if eq w 1 442 ret get qnbr i 443 end 444 ret get qnba i 445 end 446 fn qnokg w ulong to bool 447 n = get qnbal 0 448 if eq w 1 449 n = get qnbrl 0 450 end 451 if or eq n 0 gt n 39 452 ret false 453 end 454 if and eq n 1 eq (qnokb w 0) 45 455 ret true 456 end 457 for i ulong n bound 39 458 if not qntok1 (qnokb w i) 459 ret false 460 end 461 end 462 ret true 463 end 464 fn qnfok to bool 465 n = get fuserl 0 466 if or eq n 0 gt n 39 467 ret false 468 end 469 for i ulong n bound 39 470 c = get fuser i 471 ok = false 472 if and ge c 48 le c 57 473 ok = true 474 end 475 if and ge c 97 le c 122 476 ok = true 477 end 478 if eq c 45 479 ok = true 480 end 481 if not ok 482 ret false 483 end 484 end 485 ret true 486 end 487 fn qnpost to long 488 x = sosess 489 r = sowpre 490 if ne r 0 491 ret r 492 end 493 if not qnfok 494 fsetti tqnt 495 fput tqwhy 496 ret 400 497 end 498 note fbget gives up to 4096 bytes; qnba and qnbr hold 40 and the copy loops are bounded at 40, so a 499 note length outside 0..39 is refused here, before it is stored or copied (41 was trap 4, exit 104). 500 note qnokg still checks the bytes. 501 al = fbget tqagent 502 if lt al 0 503 ret 400 504 end 505 if gt al 39 506 fsetti tqnt 507 fput tqbadf 508 ret 400 509 end 510 put qnbal 0 ulong al 511 for i ulong get qnbal 0 bound 40 512 put qnba i get fval i 513 end 514 rl = fbget tqrepo 515 if lt rl 0 516 ret 400 517 end 518 if gt rl 39 519 fsetti tqnt 520 fput tqbadf 521 ret 400 522 end 523 put qnbrl 0 ulong rl 524 for i ulong get qnbrl 0 bound 40 525 put qnbr i get fval i 526 end 527 if not qnokg 0 528 fsetti tqnt 529 fput tqbadf 530 ret 400 531 end 532 if not qnokg 1 533 fsetti tqnt 534 fput tqbadf 535 ret 400 536 end 537 qnsetg 538 if not qnsubw 539 ret 500 540 end 541 if not qnregen 542 ret 500 543 end 544 put fkind 0 2 545 flocb 546 floct tqnrel 547 ret 303 548 end 549 fn qnsubw to bool 550 qnmk 551 qnpfx tqsb 552 qnsubrd 553 qnsubfit 554 if not qndrop 555 qnsubadd 556 end 557 note a full subscription file is refused, never cut: a cut would drop other names' filters 558 if eq get qnbov 0 1 559 ret false 560 end 561 ret qnsubsv 562 end 563 fn qnsubrd to void 564 put qnsl 0 0 565 if not qnread 566 ret 567 end 568 n = get fxol 0 569 if gt n 8192 570 n = ulong 8192 571 end 572 for i ulong n bound 8192 573 put qnsub i get fxo i 574 end 575 put qnsl 0 n 576 end 577 fn qnsubfit to void 578 put qnbl 0 0 579 put qnbov 0 0 580 p = ulong 0 581 while lt p get qnsl 0 bound 8192 582 e = qnsube p 583 if not qnuserline p e 584 qnsubcopy p e 585 end 586 if lt e get qnsl 0 587 p = add e 1 588 end 589 if ge e get qnsl 0 590 p = e 591 end 592 end 593 end 594 fn qnsube p ulong to ulong 595 e = p 596 while lt e get qnsl 0 bound 8192 597 if eq get qnsub e 10 598 break 599 end 600 e = add e 1 601 end 602 ret e 603 end 604 note qnsubcopy: a line of another name is kept as it is. Its length is at most len qnsub = 8192 605 note (qnsubrd), so the bound is 8192; forged writes lines of at most 119 bytes, and a longer line in 606 note a hand-edited file used to pass the old bound of 256 (trap 4). 607 fn qnsubcopy p ulong e ulong to void 608 for i ulong sub e p bound 8192 609 qnbbc get qnsub add p i 610 end 611 if lt e get qnsl 0 612 qnbbc 10 613 end 614 end 615 fn qnbbc c uchar to void 616 n = get qnbl 0 617 if lt n 8191 618 put qnbuf n c 619 put qnbl 0 add n 1 620 end 621 if ge n 8191 622 put qnbov 0 1 623 end 624 end 625 fn qndrop to bool 626 if and eq get qnbal 0 1 eq get qnba 0 45 627 ret true 628 end 629 ret and eq get qnbrl 0 1 eq get qnbr 0 45 630 end 631 fn qnsubadd to void 632 for i ulong get fuserl 0 bound 40 633 qnbbc get fuser i 634 end 635 qnbbc 32 636 for i ulong get qnbal 0 bound 40 637 qnbbc get qnba i 638 end 639 qnbbc 32 640 for i ulong get qnbrl 0 bound 40 641 qnbbc get qnbr i 642 end 643 qnbbc 10 644 end 645 fn qnsubsv to bool 646 fd = fopen fpth 0 get fpthl 0 524865 384 647 if lt fd 0 648 ret false 649 end 650 off = ulong 0 651 left = get qnbl 0 652 ok = true 653 while gt left 0 bound 8192 654 k = write int fd qnbuf off left 655 if le k 0 656 ok = false 657 left = ulong 0 658 end 659 if gt k 0 660 off = add off ulong k 661 left = sub left ulong k 662 end 663 end 664 x = fsync int fd 665 x = fclose int fd 666 ret ok 667 end 668 fn qnuserline p ulong e ulong to bool 669 n = get fuserl 0 670 if lt sub e p n 671 ret false 672 end 673 for i ulong n bound 40 674 if ne get qnsub add p i get fuser i 675 ret false 676 end 677 end 678 if eq sub e p n 679 ret true 680 end 681 ret eq get qnsub add p n 32 682 end 683 fn qnroute to long 684 m = get fmeth 0 685 if fpeq tqnp 686 if eq m 3 687 ret qnpost 688 end 689 if eq m 1 690 ret qnpage 0 691 end 692 ret 405 693 end 694 if fpeq tqnj 695 if eq m 1 696 ret qnpage 1 697 end 698 ret 405 699 end 700 ret 0 701 end