From 57b1a71c408cf664060804c4fc78dd5abaedeb58 Mon Sep 17 00:00:00 2001 From: 2pa-arch <2pa-arch@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:50:26 +0200 Subject: [PATCH 1/2] added metadata in request and change docs --- docs/package-lock.json | 175 +++++++++--------- .../schemas/RegistrationRequest.yaml | 11 ++ .../schemas/RegistrationRequestData.yaml | 16 ++ ...ions@registration-relayer@v1@register.yaml | 20 +- internal/service/handlers/registration.go | 10 +- internal/service/requests/registration.go | 13 +- resources/model_registration_request.go | 11 ++ resources/model_registration_request_data.go | 13 ++ 8 files changed, 152 insertions(+), 117 deletions(-) create mode 100644 docs/spec/components/schemas/RegistrationRequest.yaml create mode 100644 docs/spec/components/schemas/RegistrationRequestData.yaml create mode 100644 resources/model_registration_request.go create mode 100644 resources/model_registration_request_data.go diff --git a/docs/package-lock.json b/docs/package-lock.json index 045871b..cf7e748 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -734,6 +734,14 @@ "ajv": "4.11.8 - 6" } }, + "node_modules/better-ajv-errors/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true, + "license": "MIT" + }, "node_modules/binary-extensions": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", @@ -1316,10 +1324,15 @@ } }, "node_modules/core-js": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", - "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js." + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz", + "integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, "node_modules/core-util-is": { "version": "1.0.2", @@ -2294,14 +2307,14 @@ }, "node_modules/fsevents/node_modules/abbrev": { "version": "1.1.1", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/ansi-regex": { "version": "2.1.1", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2309,14 +2322,14 @@ }, "node_modules/fsevents/node_modules/aproba": { "version": "1.2.0", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/are-we-there-yet": { "version": "1.1.5", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -2325,14 +2338,14 @@ }, "node_modules/fsevents/node_modules/balanced-match": { "version": "1.0.0", - "integrity": "sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/brace-expansion": { "version": "1.1.11", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "balanced-match": "^1.0.0", @@ -2341,14 +2354,14 @@ }, "node_modules/fsevents/node_modules/chownr": { "version": "1.1.1", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/code-point-at": { "version": "1.1.0", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2356,26 +2369,26 @@ }, "node_modules/fsevents/node_modules/concat-map": { "version": "0.0.1", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/console-control-strings": { "version": "1.1.0", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/core-util-is": { "version": "1.0.2", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/debug": { "version": "2.6.9", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "ms": "2.0.0" @@ -2383,8 +2396,8 @@ }, "node_modules/fsevents/node_modules/deep-extend": { "version": "0.6.0", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=4.0.0" @@ -2392,14 +2405,14 @@ }, "node_modules/fsevents/node_modules/delegates": { "version": "1.0.0", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/detect-libc": { "version": "1.0.3", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", "inBundle": true, + "license": "Apache-2.0", "optional": true, "bin": { "detect-libc": "bin/detect-libc.js" @@ -2410,8 +2423,8 @@ }, "node_modules/fsevents/node_modules/fs-minipass": { "version": "1.2.5", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "minipass": "^2.2.1" @@ -2419,14 +2432,14 @@ }, "node_modules/fsevents/node_modules/fs.realpath": { "version": "1.0.0", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/gauge": { "version": "2.7.4", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "aproba": "^1.0.3", @@ -2441,8 +2454,8 @@ }, "node_modules/fsevents/node_modules/glob": { "version": "7.1.3", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -2458,14 +2471,14 @@ }, "node_modules/fsevents/node_modules/has-unicode": { "version": "2.0.1", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/iconv-lite": { "version": "0.4.24", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -2476,8 +2489,8 @@ }, "node_modules/fsevents/node_modules/ignore-walk": { "version": "3.0.1", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "minimatch": "^3.0.4" @@ -2485,8 +2498,8 @@ }, "node_modules/fsevents/node_modules/inflight": { "version": "1.0.6", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "once": "^1.3.0", @@ -2495,15 +2508,14 @@ }, "node_modules/fsevents/node_modules/inherits": { "version": "2.0.3", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/ini": { "version": "1.3.5", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue", "inBundle": true, + "license": "ISC", "optional": true, "engines": { "node": "*" @@ -2511,8 +2523,8 @@ }, "node_modules/fsevents/node_modules/is-fullwidth-code-point": { "version": "1.0.0", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "number-is-nan": "^1.0.0" @@ -2523,14 +2535,14 @@ }, "node_modules/fsevents/node_modules/isarray": { "version": "1.0.0", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/minimatch": { "version": "3.0.4", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -2541,14 +2553,14 @@ }, "node_modules/fsevents/node_modules/minimist": { "version": "0.0.8", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/minipass": { "version": "2.3.5", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "safe-buffer": "^5.1.2", @@ -2557,8 +2569,8 @@ }, "node_modules/fsevents/node_modules/minizlib": { "version": "1.2.1", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "minipass": "^2.2.1" @@ -2566,9 +2578,8 @@ }, "node_modules/fsevents/node_modules/mkdirp": { "version": "0.5.1", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "minimist": "0.0.8" @@ -2579,14 +2590,14 @@ }, "node_modules/fsevents/node_modules/ms": { "version": "2.0.0", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/needle": { "version": "2.2.4", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "debug": "^2.1.2", @@ -2602,9 +2613,8 @@ }, "node_modules/fsevents/node_modules/node-pre-gyp": { "version": "0.10.3", - "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", - "deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future", "inBundle": true, + "license": "BSD-3-Clause", "optional": true, "dependencies": { "detect-libc": "^1.0.2", @@ -2624,8 +2634,8 @@ }, "node_modules/fsevents/node_modules/nopt": { "version": "4.0.1", - "integrity": "sha512-+5XZFpQZEY0cg5JaxLwGxDlKNKYxuXwGt8/Oi3UXm5/4ymrJve9d2CURituxv3rSrVCGZj4m1U1JlHTdcKt2Ng==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "abbrev": "1", @@ -2637,14 +2647,14 @@ }, "node_modules/fsevents/node_modules/npm-bundled": { "version": "1.0.5", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/npm-packlist": { "version": "1.2.0", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "ignore-walk": "^3.0.1", @@ -2653,8 +2663,8 @@ }, "node_modules/fsevents/node_modules/npmlog": { "version": "4.1.2", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "are-we-there-yet": "~1.1.2", @@ -2665,8 +2675,8 @@ }, "node_modules/fsevents/node_modules/number-is-nan": { "version": "1.0.1", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2674,8 +2684,8 @@ }, "node_modules/fsevents/node_modules/object-assign": { "version": "4.1.1", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2683,8 +2693,8 @@ }, "node_modules/fsevents/node_modules/once": { "version": "1.4.0", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "wrappy": "1" @@ -2692,8 +2702,8 @@ }, "node_modules/fsevents/node_modules/os-homedir": { "version": "1.0.2", - "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2701,8 +2711,8 @@ }, "node_modules/fsevents/node_modules/os-tmpdir": { "version": "1.0.2", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2710,8 +2720,8 @@ }, "node_modules/fsevents/node_modules/osenv": { "version": "0.1.5", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "os-homedir": "^1.0.0", @@ -2720,8 +2730,8 @@ }, "node_modules/fsevents/node_modules/path-is-absolute": { "version": "1.0.1", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2729,14 +2739,14 @@ }, "node_modules/fsevents/node_modules/process-nextick-args": { "version": "2.0.0", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/rc": { "version": "1.2.8", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "inBundle": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "optional": true, "dependencies": { "deep-extend": "^0.6.0", @@ -2750,14 +2760,14 @@ }, "node_modules/fsevents/node_modules/rc/node_modules/minimist": { "version": "1.2.0", - "integrity": "sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/readable-stream": { "version": "2.3.6", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "core-util-is": "~1.0.0", @@ -2771,8 +2781,8 @@ }, "node_modules/fsevents/node_modules/rimraf": { "version": "2.6.3", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "glob": "^7.1.3" @@ -2783,26 +2793,26 @@ }, "node_modules/fsevents/node_modules/safe-buffer": { "version": "5.1.2", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/safer-buffer": { "version": "2.1.2", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/sax": { "version": "1.2.4", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/semver": { "version": "5.6.0", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "inBundle": true, + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver" @@ -2810,20 +2820,20 @@ }, "node_modules/fsevents/node_modules/set-blocking": { "version": "2.0.0", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/signal-exit": { "version": "3.0.2", - "integrity": "sha512-meQNNykwecVxdu1RlYMKpQx4+wefIYpmxi6gexo/KAbwquJrBUrBmKYJrE8KFkVQAAVWEnwNdu21PgrD77J3xA==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/string_decoder": { "version": "1.1.1", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "safe-buffer": "~5.1.0" @@ -2831,8 +2841,8 @@ }, "node_modules/fsevents/node_modules/string-width": { "version": "1.0.2", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "code-point-at": "^1.0.0", @@ -2845,8 +2855,8 @@ }, "node_modules/fsevents/node_modules/strip-ansi": { "version": "3.0.1", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "inBundle": true, + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^2.0.0" @@ -2857,8 +2867,8 @@ }, "node_modules/fsevents/node_modules/strip-json-comments": { "version": "2.0.1", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -2866,8 +2876,8 @@ }, "node_modules/fsevents/node_modules/tar": { "version": "4.4.8", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "chownr": "^1.1.1", @@ -2884,14 +2894,14 @@ }, "node_modules/fsevents/node_modules/util-deprecate": { "version": "1.0.2", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "inBundle": true, + "license": "MIT", "optional": true }, "node_modules/fsevents/node_modules/wide-align": { "version": "1.1.3", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "inBundle": true, + "license": "ISC", "optional": true, "dependencies": { "string-width": "^1.0.2 || 2" @@ -2899,14 +2909,14 @@ }, "node_modules/fsevents/node_modules/wrappy": { "version": "1.0.2", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/fsevents/node_modules/yallist": { "version": "3.0.3", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "inBundle": true, + "license": "ISC", "optional": true }, "node_modules/get-caller-file": { @@ -6245,17 +6255,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/swagger2openapi/node_modules/core-js": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.0.tgz", - "integrity": "sha512-PyFBJaLq93FlyYdsndE5VaueA9K5cNB7CGzeCj191YYLhkQM0gdZR2SKihM70oF0wdqKSKClv/tEBOpoRmdOVQ==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/swagger2openapi/node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -6958,6 +6957,14 @@ "optionalDependencies": { "commander": "^2.7.1" } + }, + "node_modules/z-schema/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true, + "license": "MIT" } } } diff --git a/docs/spec/components/schemas/RegistrationRequest.yaml b/docs/spec/components/schemas/RegistrationRequest.yaml new file mode 100644 index 0000000..1f12314 --- /dev/null +++ b/docs/spec/components/schemas/RegistrationRequest.yaml @@ -0,0 +1,11 @@ +type: object +x-go-is-request: true +required: + - data +properties: + meta: + type: object + description: "Metadata if it is required" + example: {"source": "web", "user_id": 123} + data: + $ref: '#/components/schemas/RegistrationRequestData' diff --git a/docs/spec/components/schemas/RegistrationRequestData.yaml b/docs/spec/components/schemas/RegistrationRequestData.yaml new file mode 100644 index 0000000..d52b389 --- /dev/null +++ b/docs/spec/components/schemas/RegistrationRequestData.yaml @@ -0,0 +1,16 @@ +type: object +required: + - tx_data + - no_send +properties: + tx_data: + type: string + no_send: + type: bool + description: Flag indicates whether transaction should be sent on-chain + example: true + destination: + type: string + example: "0xC0B09085Fa2ad3A8BbF96494B8d5cd10702FE20d" + description: Address of registration smart contract + diff --git a/docs/spec/paths/integrations@registration-relayer@v1@register.yaml b/docs/spec/paths/integrations@registration-relayer@v1@register.yaml index 05cdccd..4131a7f 100644 --- a/docs/spec/paths/integrations@registration-relayer@v1@register.yaml +++ b/docs/spec/paths/integrations@registration-relayer@v1@register.yaml @@ -7,25 +7,7 @@ post: content: application/json: schema: - type: object - required: - - data - properties: - data: - type: object - required: - - tx_data - properties: - tx_data: - type: string - no_send: - type: bool - description: Flag indicates whether transaction should be sent on-chain - example: true - destination: - type: string - example: "0xC0B09085Fa2ad3A8BbF96494B8d5cd10702FE20d" - description: Address of registration smart contract + $ref: '#/components/schemas/RegistrationRequest' responses: '200': description: Success diff --git a/internal/service/handlers/registration.go b/internal/service/handlers/registration.go index 5a79506..e0d6b74 100644 --- a/internal/service/handlers/registration.go +++ b/internal/service/handlers/registration.go @@ -34,11 +34,15 @@ func Registration(w http.ResponseWriter, r *http.Request) { ape.RenderErr(w, problems.BadRequest(err)...) return } - - log := Log(r).WithFields(logan.F{ + logF := logan.F{ "user-agent": r.Header.Get("User-Agent"), "calldata": req.Data.TxData, - }) + } + if req.Meta != nil { + logF = logF.Merge(*req.Meta) + } + + log := Log(r).WithFields(logF) log.Debug("registration request") // `RelayerConfig(r).RegistrationAddress` is default value for target contract diff --git a/internal/service/requests/registration.go b/internal/service/requests/registration.go index bb5c9f5..ba117a3 100644 --- a/internal/service/requests/registration.go +++ b/internal/service/requests/registration.go @@ -7,6 +7,7 @@ import ( "strings" validation "github.com/go-ozzo/ozzo-validation/v4" + "github.com/rarimo/registration-relayer/resources" "gitlab.com/distributed_lab/logan/v3/errors" ) @@ -15,17 +16,7 @@ var ( addressRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{40}") ) -type RegistrationRequestData struct { - TxData string `json:"tx_data"` - NoSend bool `json:"no_send"` - Destination *string `json:"destination,omitempty"` -} - -type RegistrationRequest struct { - Data RegistrationRequestData `json:"data"` -} - -func NewRegistrationRequest(r *http.Request) (req RegistrationRequest, err error) { +func NewRegistrationRequest(r *http.Request) (req resources.RegistrationRequest, err error) { err = json.NewDecoder(r.Body).Decode(&req) if err != nil { return req, errors.Wrap(err, "failed to unmarshal") diff --git a/resources/model_registration_request.go b/resources/model_registration_request.go new file mode 100644 index 0000000..be804bb --- /dev/null +++ b/resources/model_registration_request.go @@ -0,0 +1,11 @@ +/* + * GENERATED. Do not modify. Your changes might be overwritten! + */ + +package resources + +type RegistrationRequest struct { + Data RegistrationRequestData `json:"data"` + // Metadata if it is required + Meta *map[string]interface{} `json:"meta,omitempty"` +} diff --git a/resources/model_registration_request_data.go b/resources/model_registration_request_data.go new file mode 100644 index 0000000..d8d4887 --- /dev/null +++ b/resources/model_registration_request_data.go @@ -0,0 +1,13 @@ +/* + * GENERATED. Do not modify. Your changes might be overwritten! + */ + +package resources + +type RegistrationRequestData struct { + // Address of registration smart contract + Destination *string `json:"destination,omitempty"` + // Flag indicates whether transaction should be sent on-chain + NoSend bool `json:"no_send"` + TxData string `json:"tx_data"` +} From 68d4aa83fc1796e930b128dfce901063fa3cc1bc Mon Sep 17 00:00:00 2001 From: 2pa-arch <2pa-arch@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:15:19 +0200 Subject: [PATCH 2/2] moved meta to RegistrationRequestData --- docs/spec/components/schemas/RegistrationRequest.yaml | 4 ---- docs/spec/components/schemas/RegistrationRequestData.yaml | 4 ++++ internal/service/handlers/registration.go | 4 ++-- resources/model_registration_request.go | 2 -- resources/model_registration_request_data.go | 2 ++ 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/spec/components/schemas/RegistrationRequest.yaml b/docs/spec/components/schemas/RegistrationRequest.yaml index 1f12314..fbbcf15 100644 --- a/docs/spec/components/schemas/RegistrationRequest.yaml +++ b/docs/spec/components/schemas/RegistrationRequest.yaml @@ -3,9 +3,5 @@ x-go-is-request: true required: - data properties: - meta: - type: object - description: "Metadata if it is required" - example: {"source": "web", "user_id": 123} data: $ref: '#/components/schemas/RegistrationRequestData' diff --git a/docs/spec/components/schemas/RegistrationRequestData.yaml b/docs/spec/components/schemas/RegistrationRequestData.yaml index d52b389..01cad0a 100644 --- a/docs/spec/components/schemas/RegistrationRequestData.yaml +++ b/docs/spec/components/schemas/RegistrationRequestData.yaml @@ -3,6 +3,10 @@ required: - tx_data - no_send properties: + meta: + type: object + description: "Metadata if it is required" + example: {"source": "web", "user_id": 123} tx_data: type: string no_send: diff --git a/internal/service/handlers/registration.go b/internal/service/handlers/registration.go index e0d6b74..42de9da 100644 --- a/internal/service/handlers/registration.go +++ b/internal/service/handlers/registration.go @@ -38,8 +38,8 @@ func Registration(w http.ResponseWriter, r *http.Request) { "user-agent": r.Header.Get("User-Agent"), "calldata": req.Data.TxData, } - if req.Meta != nil { - logF = logF.Merge(*req.Meta) + if req.Data.Meta != nil { + logF = logF.Merge(*req.Data.Meta) } log := Log(r).WithFields(logF) diff --git a/resources/model_registration_request.go b/resources/model_registration_request.go index be804bb..b71c69c 100644 --- a/resources/model_registration_request.go +++ b/resources/model_registration_request.go @@ -6,6 +6,4 @@ package resources type RegistrationRequest struct { Data RegistrationRequestData `json:"data"` - // Metadata if it is required - Meta *map[string]interface{} `json:"meta,omitempty"` } diff --git a/resources/model_registration_request_data.go b/resources/model_registration_request_data.go index d8d4887..67a00da 100644 --- a/resources/model_registration_request_data.go +++ b/resources/model_registration_request_data.go @@ -7,6 +7,8 @@ package resources type RegistrationRequestData struct { // Address of registration smart contract Destination *string `json:"destination,omitempty"` + // Metadata if it is required + Meta *map[string]interface{} `json:"meta,omitempty"` // Flag indicates whether transaction should be sent on-chain NoSend bool `json:"no_send"` TxData string `json:"tx_data"`