Skip to content

Commit

Permalink
always allow admin
Browse files Browse the repository at this point in the history
  • Loading branch information
BlowaterNostr committed Jun 5, 2024
1 parent fab96e4 commit 5fa78a8
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 2 deletions.
139 changes: 139 additions & 0 deletions deno.test.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"version": "3",
"redirects": {
"https://esm.sh/v135/@types/json-stable-stringify@~1/index.d.ts": "https://esm.sh/v135/@types/[email protected]/index.d.ts"
},
"remote": {
"https://deno.land/[email protected]/assert/_constants.ts": "8a9da298c26750b28b326b297316cdde860bc237533b07e1337c021379e6b2a9",
"https://deno.land/[email protected]/assert/_diff.ts": "1a3c044aedf77647d6cac86b798c6417603361b66b54c53331b312caeb447aea",
"https://deno.land/[email protected]/assert/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7",
"https://deno.land/[email protected]/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee",
"https://deno.land/[email protected]/assert/assert_almost_equals.ts": "e15ca1f34d0d5e0afae63b3f5d975cbd18335a132e42b0c747d282f62ad2cd6c",
"https://deno.land/[email protected]/assert/assert_array_includes.ts": "6856d7f2c3544bc6e62fb4646dfefa3d1df5ff14744d1bca19f0cbaf3b0d66c9",
"https://deno.land/[email protected]/assert/assert_equals.ts": "d8ec8a22447fbaf2fc9d7c3ed2e66790fdb74beae3e482855d75782218d68227",
"https://deno.land/[email protected]/assert/assert_exists.ts": "407cb6b9fb23a835cd8d5ad804e2e2edbbbf3870e322d53f79e1c7a512e2efd7",
"https://deno.land/[email protected]/assert/assert_false.ts": "0ccbcaae910f52c857192ff16ea08bda40fdc79de80846c206bfc061e8c851c6",
"https://deno.land/[email protected]/assert/assert_greater.ts": "ae2158a2d19313bf675bf7251d31c6dc52973edb12ac64ac8fc7064152af3e63",
"https://deno.land/[email protected]/assert/assert_greater_or_equal.ts": "1439da5ebbe20855446cac50097ac78b9742abe8e9a43e7de1ce1426d556e89c",
"https://deno.land/[email protected]/assert/assert_instance_of.ts": "3aedb3d8186e120812d2b3a5dea66a6e42bf8c57a8bd927645770bd21eea554c",
"https://deno.land/[email protected]/assert/assert_is_error.ts": "c21113094a51a296ffaf036767d616a78a2ae5f9f7bbd464cd0197476498b94b",
"https://deno.land/[email protected]/assert/assert_less.ts": "aec695db57db42ec3e2b62e97e1e93db0063f5a6ec133326cc290ff4b71b47e4",
"https://deno.land/[email protected]/assert/assert_less_or_equal.ts": "5fa8b6a3ffa20fd0a05032fe7257bf985d207b85685fdbcd23651b70f928c848",
"https://deno.land/[email protected]/assert/assert_match.ts": "c4083f80600bc190309903c95e397a7c9257ff8b5ae5c7ef91e834704e672e9b",
"https://deno.land/[email protected]/assert/assert_not_equals.ts": "9f1acab95bd1f5fc9a1b17b8027d894509a745d91bac1718fdab51dc76831754",
"https://deno.land/[email protected]/assert/assert_not_instance_of.ts": "0c14d3dfd9ab7a5276ed8ed0b18c703d79a3d106102077ec437bfe7ed912bd22",
"https://deno.land/[email protected]/assert/assert_not_match.ts": "3796a5b0c57a1ce6c1c57883dd4286be13a26f715ea662318ab43a8491a13ab0",
"https://deno.land/[email protected]/assert/assert_not_strict_equals.ts": "ca6c6d645e95fbc873d25320efeb8c4c6089a9a5e09f92d7c1c4b6e935c2a6ad",
"https://deno.land/[email protected]/assert/assert_object_match.ts": "d8fc2867cfd92eeacf9cea621e10336b666de1874a6767b5ec48988838370b54",
"https://deno.land/[email protected]/assert/assert_rejects.ts": "45c59724de2701e3b1f67c391d6c71c392363635aad3f68a1b3408f9efca0057",
"https://deno.land/[email protected]/assert/assert_strict_equals.ts": "b1f538a7ea5f8348aeca261d4f9ca603127c665e0f2bbfeb91fa272787c87265",
"https://deno.land/[email protected]/assert/assert_string_includes.ts": "b821d39ebf5cb0200a348863c86d8c4c4b398e02012ce74ad15666fc4b631b0c",
"https://deno.land/[email protected]/assert/assert_throws.ts": "63784e951475cb7bdfd59878cd25a0931e18f6dc32a6077c454b2cd94f4f4bcd",
"https://deno.land/[email protected]/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56",
"https://deno.land/[email protected]/assert/equal.ts": "9f1a46d5993966d2596c44e5858eec821859b45f783a5ee2f7a695dfc12d8ece",
"https://deno.land/[email protected]/assert/fail.ts": "c36353d7ae6e1f7933d45f8ea51e358c8c4b67d7e7502028598fe1fea062e278",
"https://deno.land/[email protected]/assert/mod.ts": "37c49a26aae2b254bbe25723434dc28cd7532e444cf0b481a97c045d110ec085",
"https://deno.land/[email protected]/assert/unimplemented.ts": "d56fbeecb1f108331a380f72e3e010a1f161baa6956fd0f7cf3e095ae1a4c75a",
"https://deno.land/[email protected]/assert/unreachable.ts": "4600dc0baf7d9c15a7f7d234f00c23bca8f3eba8b140286aaca7aa998cf9a536",
"https://deno.land/[email protected]/encoding/hex.ts": "b4e346619c0535a5db48d6bdb6e057c8d1179c64a2b0ba8d3b0b8a79ae361a90",
"https://deno.land/[email protected]/fmt/colors.ts": "c51c4642678eb690dcf5ffee5918b675bf01a33fba82acf303701ae1a4f8c8d9",
"https://deno.land/[email protected]/assert/assert.ts": "09d30564c09de846855b7b071e62b5974b001bb72a4b797958fe0660e7849834",
"https://deno.land/[email protected]/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917",
"https://deno.land/[email protected]/http/cookie.ts": "a377fa60175ba5f61dd4b8a70b34f2bbfbc70782dfd5faf36d314c42e4306006",
"https://deno.land/x/[email protected]/deps.ts": "5696461c8bb42db7c83486db452e125f7cfdc62a2c628bb470a4447d934b90b3",
"https://deno.land/x/[email protected]/mod.ts": "57fd56de5f7cbc66e23ce896cc8e99521d286e89969d83e09d960642b0a9d652",
"https://deno.land/x/[email protected]/build/sqlite.js": "72f63689fffcb9bb5ae10b1e8f7db09ea845cdf713e0e3a9693d8416a28f92a6",
"https://deno.land/x/[email protected]/build/vfs.js": "08533cc78fb29b9d9bd62f6bb93e5ef333407013fed185776808f11223ba0e70",
"https://deno.land/x/[email protected]/mod.ts": "e09fc79d8065fe222578114b109b1fd60077bff1bb75448532077f784f4d6a83",
"https://deno.land/x/[email protected]/src/constants.ts": "90f3be047ec0a89bcb5d6fc30db121685fc82cb00b1c476124ff47a4b0472aa9",
"https://deno.land/x/[email protected]/src/db.ts": "7d3251021756fa80f382c3952217c7446c5c8c1642b63511da0938fe33562663",
"https://deno.land/x/[email protected]/src/error.ts": "f7a15cb00d7c3797da1aefee3cf86d23e0ae92e73f0ba3165496c3816ab9503a",
"https://deno.land/x/[email protected]/src/function.ts": "e4c83b8ec64bf88bafad2407376b0c6a3b54e777593c70336fb40d43a79865f2",
"https://deno.land/x/[email protected]/src/query.ts": "d58abda928f6582d77bad685ecf551b1be8a15e8e38403e293ec38522e030cad",
"https://deno.land/x/[email protected]/src/wasm.ts": "e79d0baa6e42423257fb3c7cc98091c54399254867e0f34a09b5bdef37bd9487",
"https://esm.sh/@noble/[email protected]/chacha": "7a4f831bac30d9ea271916ba892de547c30e0b93bf1034a412a7d443c222fdf5",
"https://esm.sh/@noble/[email protected]/utils": "dab4bff2315f22a8ac409ddd30c2650ca581fcb050efbf9f01d59e1a377083b1",
"https://esm.sh/@noble/[email protected]/secp256k1": "5252f1cfd6e12be71ea2826f76d171458040f168424e59d97a30cc5f54032460",
"https://esm.sh/@noble/[email protected]/hkdf": "111a33b0d87213d1b5a7ebf613b0ecd91fc16e3633855862e9a29cf1b87eaee6",
"https://esm.sh/@noble/[email protected]/hmac": "6ff87e80b0bc2bf0720932f0ffb73e780f744faa76b9d62004de8f9469ad1004",
"https://esm.sh/@noble/[email protected]/sha256": "79b93b1d9fc09ebc107b43f6ac5ff39afda60c12dffd673786cb75c756f712fc",
"https://esm.sh/@noble/[email protected]/utils": "cf42cac8548d0c87096c52c693dde2e1ed080e64989ede7ec527b50538236a53",
"https://esm.sh/@scure/[email protected]": "916e253b1ed0201505202a27209f22d7500f114a303aecd1b76ebcc757df06e6",
"https://esm.sh/[email protected]/language/ast#=": "3370c36acfd7dc994d7f2242361dbc538b7b239f0cb41603f97a5d67273f5255",
"https://esm.sh/[email protected]/language/parser#=": "38b1158134aed40573b9885cc5f3b020fe8b60c75aa8b32420388c577615b97a",
"https://esm.sh/[email protected]": "50c951dc0b67f3f01e70d1511ca68ebb067ef99d3590d6a7afb36819c84595f9",
"https://esm.sh/[email protected]": "2b81a6a787946ad5442971a73209f544aef253b325aa39645dce0cffb24638ba",
"https://esm.sh/[email protected]": "502d356922296aa8b105dbbf7de0e43d41146966e7af4c485053d64627029c98",
"https://esm.sh/[email protected]/jsx-runtime": "f4c9e5f72ef18435eab846ae02e315a63da724f64fb08d806d2ddeaf08d99bd8",
"https://esm.sh/stable/[email protected]/denonext/jsx-runtime.js": "97e9eeb40443de53a8cb3b70f264d04db2bbfc5c2298fdb15d1c471283ccd6aa",
"https://esm.sh/stable/[email protected]/denonext/preact.mjs": "68491395d287895f4d697e403ded5b0ebb8fed0494f9e870c422bc017e5e52f5",
"https://esm.sh/stable/[email protected]/denonext/preact.mjs": "323ac0dab4ede066d3ef67ae2f51029ed1bd5f81f5a07982924a00aee3c54ada",
"https://esm.sh/stable/[email protected]/denonext/preact.mjs": "f418bc70c24b785703afb9d4dea8cdc1e315e43c8df620a0c52fd27ad9bd70eb",
"https://esm.sh/v135/@noble/[email protected]/denonext/_poly1305.js": "74fe8431e8dcf918852eb4e6e04a4471bb5ed078669a2400257fdac4393daee3",
"https://esm.sh/v135/@noble/[email protected]/denonext/chacha.js": "764a5855210c5043eaa349b0a6c31ad510a0fecc6bc60cfe13f25898d7ebf12d",
"https://esm.sh/v135/@noble/[email protected]/denonext/utils.js": "46b2c364654930a968e5800cb86d1d467288a2af90d65b251a2d864ff88c66c1",
"https://esm.sh/v135/@noble/[email protected]/denonext/_shortw_utils.js": "8d690a8fbb0100093f6ab96457c634465eb4bd79f07adb30bbda5234d189c5e8",
"https://esm.sh/v135/@noble/[email protected]/denonext/abstract/curve.js": "280130b0d3e1f15037b449b5870e1f39f5db99f8c310f85a9d4ab129d6dfa583",
"https://esm.sh/v135/@noble/[email protected]/denonext/abstract/hash-to-curve.js": "591fb0f81529b2dc9f7ea61a0b988ab659564688ce33bd6c95b0e55c698cb338",
"https://esm.sh/v135/@noble/[email protected]/denonext/abstract/modular.js": "f6a63a4725fe208141f87a773ba9485813ffd5291129656fd073f832fbcd4437",
"https://esm.sh/v135/@noble/[email protected]/denonext/abstract/utils.js": "0ff50d14245befb0ee4b0eae5f0292acc5fd0f6e5f385195654d7825f0a75669",
"https://esm.sh/v135/@noble/[email protected]/denonext/abstract/weierstrass.js": "f97e7a6ecf9f23a864538f7089645c17103f3809134c0bb99c29d56ce824e7b4",
"https://esm.sh/v135/@noble/[email protected]/denonext/secp256k1.js": "641ad16ddf79c7f4b69cba4d266078ef21f446cfc3fec83120f6de4f6dee84aa",
"https://esm.sh/v135/@noble/[email protected]/denonext/_assert.js": "f8882bd96e2a6d1834a445c5af97f927b1ba028f34963c8570568e33385c4419",
"https://esm.sh/v135/@noble/[email protected]/denonext/_sha2.js": "7b27807ccd3cf7c3b90ce23b17bc9c5d791a72e41dd2e01a4debd9727990bca9",
"https://esm.sh/v135/@noble/[email protected]/denonext/crypto.js": "cf6efbafcbb35e03bcb3a36cccd3d6d1f9bc4ba23f44a79551929a28c83e7901",
"https://esm.sh/v135/@noble/[email protected]/denonext/hkdf.js": "8266c059351887f60542a555bd9441ccdabf0882256b99ce010b0bf55ca389dd",
"https://esm.sh/v135/@noble/[email protected]/denonext/hmac.js": "c7a0a4fa8e369846713459398dfa1dc373ae5e6fa0eb7280f33dfd3f55a5c8fc",
"https://esm.sh/v135/@noble/[email protected]/denonext/sha256.js": "762e0b0cbde1990fc905eb816d30cdc0cf7dd4c23d123408c6963294f124f97d",
"https://esm.sh/v135/@noble/[email protected]/denonext/utils.js": "701831e12a7e656df467b62f929ac9536ababef1b9b7445c7f87512366ae3933",
"https://esm.sh/v135/@scure/[email protected]/denonext/base.mjs": "442a66c701330f27adff8b2fa6067308ff9a82b8e178c8482882ff4aa7dfee82",
"https://esm.sh/v135/[email protected]/denonext/call-bind.mjs": "3521ab44d0845bfebad755a9faf05909465e15e7464635a396e100888579d0f9",
"https://esm.sh/v135/[email protected]/denonext/callBound.js": "3e0575cd491d34731ef9108055f24799268c33bbdf1a9d1d26587bc2a6c147e8",
"https://esm.sh/v135/[email protected]/denonext/define-data-property.mjs": "20699e70d1f67cb011abe61dbae74a5875b9218b89e284331c2baf42d5a61469",
"https://esm.sh/v135/[email protected]/denonext/es-define-property.mjs": "cb45651eabe72733c38c2a1d95027a9a46c595d632e6dabaa58ece776a89e254",
"https://esm.sh/v135/[email protected]/denonext/es-errors.mjs": "bfce674e18d7942b768827eabfbb92c410e3e3e95f4f2d369e05af3da73283fd",
"https://esm.sh/v135/[email protected]/denonext/eval.js": "fe7214a04ef6aa4fef2a0edbc741ba6b5d2c49b280bbf0307cb6c6d92799b5e4",
"https://esm.sh/v135/[email protected]/denonext/range.js": "56b14e69ab1369337ff55eff40185def87201081df0c31795a724a14cbb311e9",
"https://esm.sh/v135/[email protected]/denonext/ref.js": "8de37456e795149497269b5bb68c468d87112abf2ec6aa73bfc4898173140ffb",
"https://esm.sh/v135/[email protected]/denonext/syntax.js": "543c4645954c0b1ee8eb956d503590785d068434d0cd6015e6dc67770e72ddd3",
"https://esm.sh/v135/[email protected]/denonext/type.js": "f829c56f7c8c9c25f8d3abb9a8b6f7c841e937ba4b90a0c5fc08799f3cdb003e",
"https://esm.sh/v135/[email protected]/denonext/uri.js": "be84c4fafe42b18e3cf3b508af9511593679f5d0eddddbfd3a83062832f772cb",
"https://esm.sh/v135/[email protected]/denonext/function-bind.mjs": "ba026f8203d5631c23f48de9829c300fea74e2c9b333d06e4f220ae774557ad1",
"https://esm.sh/v135/[email protected]/denonext/get-intrinsic.mjs": "f9ed58df1bb1201efc1ab14f7da5ebe5a000b220c6de9430a594d088909742d2",
"https://esm.sh/v135/[email protected]/denonext/get-intrinsic.mjs": "19ac2d9462c84374f15dabd54b3842bbde9b9bb6c33397460a519e5935da755b",
"https://esm.sh/v135/[email protected]/denonext/gopd.mjs": "9f8a99c477f272b7e75f0c1f55e43ebb57b121245f403769eb853589a8e31b49",
"https://esm.sh/v135/[email protected]/denonext/language/ast.js": "1c8cc697db4ec96d354496fa69a2d6552ec5801a6c3bdbe5505f369d872d594c",
"https://esm.sh/v135/[email protected]/denonext/language/parser.js": "82063e5ee234089909652e04ccd9f0e1c0670c04ac6db896099a638ae759b182",
"https://esm.sh/v135/[email protected]/denonext/graphql.mjs": "585b84022623b931e27a7a8134cd24ec50b33ea12fd18b43254527628a0fddac",
"https://esm.sh/v135/[email protected]/denonext/has-property-descriptors.mjs": "444f1d102c69ba56fd9494eda0c6a0c2c0812620e93690f790c04f1b941f7571",
"https://esm.sh/v135/[email protected]/denonext/has-proto.mjs": "443f9773e464b39534dbecaee040e5de8384e8efaeea7a6d3e333df4069d1f85",
"https://esm.sh/v135/[email protected]/denonext/has-symbols.mjs": "452727b5dbec94d538c5e8e062ed82bee701c3b752eb21e6189978e92292b7c6",
"https://esm.sh/v135/[email protected]/denonext/hasown.mjs": "ba954305c23d6c4059f02f6b244bdbf45349e1228e3570ea3dc096d418b9f2f8",
"https://esm.sh/v135/[email protected]/denonext/hasown.mjs": "927e98b45074be199842a8ae0c13a9fd44ae7ba7f410bf08787ef8ed2ffe9d73",
"https://esm.sh/v135/[email protected]/denonext/isarray.mjs": "ba878a16b13d040253b0755d16580a99bd1b73b2cbbdc41b4ecf5744fd18b670",
"https://esm.sh/v135/[email protected]/denonext/json-stable-stringify.mjs": "bb8182354b6a80c3dfd171d3d8bee1063612d66ef94acf44c9a5395a3c90471f",
"https://esm.sh/v135/[email protected]/denonext/jsonify.mjs": "958f96e48d994f565ec0c3942f90f11fdc2679c7c013689a71914c04481704c6",
"https://esm.sh/v135/[email protected]/denonext/object-keys.mjs": "9b1c41ea017ff80bc11f70885530199fbca620a7ac9b5b2bef20c8fb9829a4de",
"https://esm.sh/v135/[email protected]/denonext/preact-render-to-string.mjs": "0226110b9ae616d3143c7ea00b822faa1cdd96588188fc3f28e2bf8ead94ba4f",
"https://esm.sh/v135/[email protected]/denonext/set-function-length.mjs": "1af2f38f3851e0d1a0d48bfaa96659e405dfe9229bc44ea3b39a147924fd0e5f",
"https://raw.githubusercontent.com/BlowaterNostr/csp/master/csp.ts": "4469313196bb1385ad38d13b72db0dbaf09a512c78d821144bc72b96c807417b",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/_helper.ts": "461fae1c0ffb7bd35ff254d93dabfe29beae2fdd4b68ce43b3ebc1679de52fa8",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/event.ts": "e3d7a41c6d9677b299421a8cf395f4f4814cee443ae467a0d5a398033ef7c1ae",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/key.ts": "b9e8a1e5a446168ad93372adc299101d2be2760bd4a18c2853a8a267aa5f3f54",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nip19.ts": "0573742557a0dca1cd4be801e2dcbe13f624ea01d8c6d55ba44e88ec4cbdb151",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nip4.ts": "8681f8180b285a37c6d1c0eba34fd02e2347cd82f84267924ac1abf9e31bca1d",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nip44.ts": "80b06b2612e40482815e322007c650568e20e2b66f548379b4ff3af63b00235f",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nostr.ts": "9ab0224f6415d6ebcbfc64ef7fcfd1466db8df28f905ed54d4d55b0e5d13df89",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/relay-single-test.ts": "5ee4fa9fdb6c9899e9c323f2033fffd7691f9321d2d03051ccff5887ac8bb06a",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/relay-single.ts": "52070614931642522f6b4b51a7fc581da0d3aba0eb130aa17553bb06666eb4c5",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/relay.interface.ts": "9c5f7ba5f3d8a262fb512503127bf787eb7a50bcf4615fadb4b1550dd7c16195",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/scure.js": "fbc4be16918272bd167fff1184a7f5bbd1a676bad2a73130bb530d78df893a99",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/vendor/secp256k1.js": "69e32f6c686cc651ff2e6d4d22ed6e9b6f86b38311b405b47b2abdf3cb98eb4d",
"https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/websocket.ts": "f13d15d1ac3b932007a95731e41e960dbf686955df984df8a449308d74a785a4"
},
"workspace": {
"dependencies": [
"npm:[email protected]"
]
}
}
2 changes: 1 addition & 1 deletion main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export async function run(args: {
return key;
}
// admin is always a member
if (key.hex == args.default_information?.pubkey) {
if (key.hex == admin_pubkey.hex) {
return true;
}
const policy = await policyStore.resolvePolicyByKind(NostrKind.TEXT_NOTE);
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ fmt:
deno fmt

test: fmt
deno test --trace-leaks --unstable-kv \
deno test --lock deno.test.lock \
--trace-leaks --unstable-kv \
--allow-read=queries,test.sqlite,relayed.db,relayed.db-journal \
--allow-net --allow-write --allow-ffi \
--allow-env=DENO_DEPLOYMENT_ID,DENO_DIR,HOME \
Expand Down
3 changes: 3 additions & 0 deletions ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from "./_libs.ts";
import { func_GetEventsByFilter } from "./resolvers/event.ts";
import { func_DeleteEvent } from "./resolvers/event_deletion.ts";
import { sleep } from "https://raw.githubusercontent.com/BlowaterNostr/csp/master/csp.ts";

export type func_IsMember = (pubkey: string) => Promise<boolean | Error>;

Expand Down Expand Up @@ -54,11 +55,13 @@ async (req: Request, info: Deno.ServeHandlerInfo) => {
if (auth == null || auth == "") {
// https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4
// https://www.iana.org/assignments/websocket/websocket.xml#close-code-number
console.error("no auth event found");
socket.close(3000, "no auth event found");
return;
}
const rawEvent = atobSafe(auth);
if (rawEvent instanceof Error) {
console.error(rawEvent);
socket.close(3000, rawEvent.message);
return;
}
Expand Down

0 comments on commit 5fa78a8

Please sign in to comment.