spec-3nweb-server 1.8.5 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci-linux.yml +50 -0
- package/.gitlab-ci-mac.yml +29 -0
- package/.gitlab-ci-windows.yml +29 -0
- package/.gitlab-ci.yml +63 -0
- package/build/mock/tls-options.js +46 -44
- package/build/tests/admin-proto/signup.d.ts +1 -0
- package/build/tests/admin-proto/signup.js +235 -0
- package/build/tests/jasmine.d.ts +1 -0
- package/build/tests/jasmine.js +32 -0
- package/build/tests/libs-for-tests/3nstorage.d.ts +22 -0
- package/build/tests/libs-for-tests/3nstorage.js +123 -0
- package/build/tests/libs-for-tests/asmail.d.ts +22 -0
- package/build/tests/libs-for-tests/asmail.js +179 -0
- package/build/tests/libs-for-tests/assert.d.ts +1 -0
- package/build/tests/libs-for-tests/assert.js +26 -0
- package/build/tests/libs-for-tests/async-jasmine.d.ts +7 -0
- package/build/tests/libs-for-tests/async-jasmine.js +77 -0
- package/build/tests/libs-for-tests/bytes-equal.d.ts +1 -0
- package/build/tests/libs-for-tests/bytes-equal.js +34 -0
- package/build/tests/libs-for-tests/json-copy.d.ts +1 -0
- package/build/tests/libs-for-tests/json-copy.js +45 -0
- package/build/tests/libs-for-tests/json-equal.d.ts +4 -0
- package/build/tests/libs-for-tests/json-equal.js +67 -0
- package/build/tests/libs-for-tests/mailerid.d.ts +13 -0
- package/build/tests/libs-for-tests/mailerid.js +114 -0
- package/build/tests/libs-for-tests/pkl.d.ts +28 -0
- package/build/tests/libs-for-tests/pkl.js +89 -0
- package/build/tests/libs-for-tests/server-components/3nstorage.d.ts +20 -0
- package/build/tests/libs-for-tests/server-components/3nstorage.js +200 -0
- package/build/tests/libs-for-tests/server-components/admin.d.ts +6 -0
- package/build/tests/libs-for-tests/server-components/admin.js +43 -0
- package/build/tests/libs-for-tests/server-components/asmail.d.ts +16 -0
- package/build/tests/libs-for-tests/server-components/asmail.js +143 -0
- package/build/tests/libs-for-tests/server-components/component.d.ts +13 -0
- package/build/tests/libs-for-tests/server-components/component.js +77 -0
- package/build/tests/libs-for-tests/server-components/mailerid.d.ts +10 -0
- package/build/tests/libs-for-tests/server-components/mailerid.js +103 -0
- package/build/tests/libs-for-tests/server-runner.d.ts +15 -0
- package/build/tests/libs-for-tests/server-runner.js +69 -0
- package/build/tests/libs-for-tests/spec-assembly.d.ts +6 -0
- package/build/tests/libs-for-tests/spec-assembly.js +55 -0
- package/build/tests/libs-for-tests/ws-utils.d.ts +3 -0
- package/build/tests/libs-for-tests/ws-utils.js +59 -0
- package/build/tests/libs-for-tests/xhr-utils.d.ts +61 -0
- package/build/tests/libs-for-tests/xhr-utils.js +154 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-obj-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-obj-ver.js +84 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-root-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-root-ver.js +78 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.js +83 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.js +77 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-obj.js +75 -0
- package/build/tests/protocols/3nstorage/owner/specs/events.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/events.js +91 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-obj.js +269 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-root.js +262 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-obj-status.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-obj-status.js +79 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-root-status.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-root-status.js +72 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-obj.js +287 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-root.js +274 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel-root.js +73 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel.js +72 -0
- package/build/tests/protocols/3nstorage/owner/test-utils.d.ts +14 -0
- package/build/tests/protocols/3nstorage/owner/test-utils.js +54 -0
- package/build/tests/protocols/3nstorage/owner.d.ts +1 -0
- package/build/tests/protocols/3nstorage/owner.js +138 -0
- package/build/tests/protocols/asmail/config.d.ts +1 -0
- package/build/tests/protocols/asmail/config.js +117 -0
- package/build/tests/protocols/asmail/delivery/specs/finalize-delivery.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/finalize-delivery.js +60 -0
- package/build/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.js +68 -0
- package/build/tests/protocols/asmail/delivery/specs/put-metadata.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/put-metadata.js +83 -0
- package/build/tests/protocols/asmail/delivery/specs/put-obj.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/put-obj.js +123 -0
- package/build/tests/protocols/asmail/delivery/specs/restart-session.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/restart-session.js +79 -0
- package/build/tests/protocols/asmail/delivery/specs/start-session.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/start-session.js +64 -0
- package/build/tests/protocols/asmail/delivery/test-utils.d.ts +16 -0
- package/build/tests/protocols/asmail/delivery/test-utils.js +46 -0
- package/build/tests/protocols/asmail/delivery.d.ts +1 -0
- package/build/tests/protocols/asmail/delivery.js +46 -0
- package/build/tests/protocols/asmail/retrieval/specs/events.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/events.js +62 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-meta.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-meta.js +70 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-obj.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-obj.js +166 -0
- package/build/tests/protocols/asmail/retrieval/specs/list-messages.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/list-messages.js +96 -0
- package/build/tests/protocols/asmail/retrieval/specs/remove-message.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/remove-message.js +66 -0
- package/build/tests/protocols/asmail/retrieval/test-utils.d.ts +17 -0
- package/build/tests/protocols/asmail/retrieval/test-utils.js +46 -0
- package/build/tests/protocols/asmail/retrieval.d.ts +1 -0
- package/build/tests/protocols/asmail/retrieval.js +92 -0
- package/build/tests/protocols/mailerid.d.ts +1 -0
- package/build/tests/protocols/mailerid.js +210 -0
- package/build/tests/shared-checks/check-mid-login.d.ts +2 -0
- package/build/tests/shared-checks/check-mid-login.js +131 -0
- package/build/tests/shared-checks/requests.d.ts +20 -0
- package/build/tests/shared-checks/requests.js +123 -0
- package/package.json +1 -1
- package/packing/create-deb.sh +57 -0
- package/packing/deb/lib/systemd/system/3nweb.service +11 -0
- package/packing/deb/postinst +44 -0
- package/packing/deb/usr/share/doc/3nweb-server/conf-for-postinstall.yaml +19 -0
- package/packing/deb/usr/share/doc/3nweb-server/copyright +22 -0
- package/publish-task.sh +10 -0
- package/push-to-github.sh +105 -0
- package/ts-code/3nstorage/3nstorage-app.ts +99 -0
- package/ts-code/3nstorage/owner.ts +178 -0
- package/ts-code/3nstorage/resources/sessions.ts +37 -0
- package/ts-code/3nstorage/resources/store.ts +896 -0
- package/ts-code/3nstorage/resources/users.ts +258 -0
- package/ts-code/3nstorage/routes/owner/archive-obj-version.ts +73 -0
- package/ts-code/3nstorage/routes/owner/cancel-trans.ts +58 -0
- package/ts-code/3nstorage/routes/owner/delete-obj.ts +103 -0
- package/ts-code/3nstorage/routes/owner/get-archived-obj-ver.ts +111 -0
- package/ts-code/3nstorage/routes/owner/get-current-obj.ts +122 -0
- package/ts-code/3nstorage/routes/owner/get-obj-status.ts +55 -0
- package/ts-code/3nstorage/routes/owner/param-getter.ts +51 -0
- package/ts-code/3nstorage/routes/owner/param-setter.ts +50 -0
- package/ts-code/3nstorage/routes/owner/put-current-obj.ts +284 -0
- package/ts-code/3nstorage/routes/owner/session-params.ts +49 -0
- package/ts-code/3nstorage/shared.ts +43 -0
- package/ts-code/asmail/asmail-app.ts +91 -0
- package/ts-code/asmail/config.ts +96 -0
- package/ts-code/asmail/delivery.ts +94 -0
- package/ts-code/asmail/resources/delivery-sessions.ts +118 -0
- package/ts-code/asmail/resources/inbox.ts +696 -0
- package/ts-code/asmail/resources/recipients.ts +495 -0
- package/ts-code/asmail/resources/sessions.ts +37 -0
- package/ts-code/asmail/retrieval.ts +96 -0
- package/ts-code/asmail/routes/config/param-getter.ts +49 -0
- package/ts-code/asmail/routes/config/param-setter.ts +49 -0
- package/ts-code/asmail/routes/delivery/finalize-delivery.ts +50 -0
- package/ts-code/asmail/routes/delivery/pre-flight.ts +132 -0
- package/ts-code/asmail/routes/delivery/provide-recipient-pubkey.ts +58 -0
- package/ts-code/asmail/routes/delivery/put-metadata.ts +94 -0
- package/ts-code/asmail/routes/delivery/put-obj.ts +166 -0
- package/ts-code/asmail/routes/delivery/restart-session.ts +130 -0
- package/ts-code/asmail/routes/delivery/sender-authorization.ts +81 -0
- package/ts-code/asmail/routes/delivery/start-session.ts +151 -0
- package/ts-code/asmail/routes/retrieval/get-message-meta.ts +53 -0
- package/ts-code/asmail/routes/retrieval/get-message-obj.ts +109 -0
- package/ts-code/asmail/routes/retrieval/list-messages.ts +70 -0
- package/ts-code/asmail/routes/retrieval/remove-message.ts +47 -0
- package/ts-code/cli/index.ts +82 -0
- package/ts-code/cli/run-cmd.ts +81 -0
- package/ts-code/cli/show-sample-config.ts +78 -0
- package/ts-code/cli/signup-cmd.ts +229 -0
- package/ts-code/cli/user-cmd.ts +68 -0
- package/ts-code/cli/utils.ts +105 -0
- package/ts-code/config/default-confs.ts +22 -0
- package/ts-code/config/from-yaml.ts +35 -0
- package/ts-code/config/letsencrypt.ts +77 -0
- package/ts-code/config/signup.ts +137 -0
- package/ts-code/lib-common/admin-api/signup.ts +120 -0
- package/ts-code/lib-common/assert.ts +22 -0
- package/ts-code/lib-common/async-fs-node.ts +656 -0
- package/ts-code/lib-common/buffer-utils.ts +124 -0
- package/ts-code/lib-common/byte-streaming/common.ts +166 -0
- package/ts-code/lib-common/bytes-equal.ts +25 -0
- package/ts-code/lib-common/canonical-address.ts +92 -0
- package/ts-code/lib-common/exceptions/error.ts +44 -0
- package/ts-code/lib-common/exceptions/file.ts +84 -0
- package/ts-code/lib-common/exceptions/http.ts +69 -0
- package/ts-code/lib-common/ipc/generic-ipc.ts +750 -0
- package/ts-code/lib-common/ipc/ws-ipc.ts +117 -0
- package/ts-code/lib-common/json-equal.ts +55 -0
- package/ts-code/lib-common/json-utils.ts +130 -0
- package/ts-code/lib-common/jwkeys.ts +246 -0
- package/ts-code/lib-common/map-of-sets.ts +60 -0
- package/ts-code/lib-common/mid-sigs-NaCl-Ed.ts +677 -0
- package/ts-code/lib-common/objs-on-disk/file-layout.ts +480 -0
- package/ts-code/lib-common/objs-on-disk/obj-file.ts +325 -0
- package/ts-code/lib-common/objs-on-disk/utils.ts +201 -0
- package/ts-code/lib-common/objs-on-disk/v1-obj-file-format.ts +329 -0
- package/ts-code/lib-common/processes.ts +501 -0
- package/ts-code/lib-common/random-node.ts +79 -0
- package/ts-code/lib-common/service-api/3nstorage/owner.ts +559 -0
- package/ts-code/lib-common/service-api/3nstorage/root-route.ts +22 -0
- package/ts-code/lib-common/service-api/asmail/config.ts +144 -0
- package/ts-code/lib-common/service-api/asmail/delivery.ts +250 -0
- package/ts-code/lib-common/service-api/asmail/retrieval.ts +238 -0
- package/ts-code/lib-common/service-api/asmail/root-route.ts +22 -0
- package/ts-code/lib-common/service-api/ipc-api.ts +44 -0
- package/ts-code/lib-common/service-api/locker.ts +44 -0
- package/ts-code/lib-common/service-api/mailer-id/login.ts +80 -0
- package/ts-code/lib-common/service-api/mailer-id/provisioning.ts +64 -0
- package/ts-code/lib-common/service-api/mailer-id/root-route.ts +25 -0
- package/ts-code/lib-common/service-api/pub-key-login.ts +75 -0
- package/ts-code/lib-common/service-api/web-socket-base.ts +87 -0
- package/ts-code/lib-common/session-encryptor.ts +54 -0
- package/ts-code/lib-common/time-window-cache.ts +74 -0
- package/ts-code/lib-common/transferable.d.ts +30 -0
- package/ts-code/lib-server/conf-util.ts +35 -0
- package/ts-code/lib-server/mid-access.ts +45 -0
- package/ts-code/lib-server/middleware/body-parsers.ts +248 -0
- package/ts-code/lib-server/middleware/error-handler.ts +79 -0
- package/ts-code/lib-server/pkl-access.ts +46 -0
- package/ts-code/lib-server/resources/dns.ts +151 -0
- package/ts-code/lib-server/resources/mailerid-authorizer.ts +115 -0
- package/ts-code/lib-server/resources/mem-backed-sessions-factory.ts +132 -0
- package/ts-code/lib-server/resources/server-data-folders.ts +160 -0
- package/ts-code/lib-server/resources/server-key-for-pkl-challenge.ts +41 -0
- package/ts-code/lib-server/resources/sessions.ts +232 -0
- package/ts-code/lib-server/resources/user-files.ts +147 -0
- package/ts-code/lib-server/routes/pub-key-login/complete-exchange.ts +63 -0
- package/ts-code/lib-server/routes/pub-key-login/start-exchange.ts +189 -0
- package/ts-code/lib-server/routes/sessions/close.ts +27 -0
- package/ts-code/lib-server/routes/sessions/mid-auth.ts +77 -0
- package/ts-code/lib-server/routes/sessions/start.ts +116 -0
- package/ts-code/lib-server/web-sockets/app.ts +339 -0
- package/ts-code/lib-server/web-sockets/server-events.ts +63 -0
- package/ts-code/lib.ts +29 -0
- package/ts-code/locker/locker-app.ts +60 -0
- package/ts-code/locker/resources/lockers.ts +17 -0
- package/ts-code/locker/resources/sessions.ts +37 -0
- package/ts-code/locker/routes/create-locker.ts +47 -0
- package/ts-code/mailerId/mailerId-app.ts +107 -0
- package/ts-code/mailerId/resources/certifier.ts +181 -0
- package/ts-code/mailerId/resources/sessions.ts +44 -0
- package/ts-code/mailerId/resources/users.ts +88 -0
- package/ts-code/mailerId/routes/certify.ts +68 -0
- package/ts-code/main.ts +304 -0
- package/ts-code/mock/dns.ts +106 -0
- package/ts-code/mock/mock-as-child-proc.ts +130 -0
- package/ts-code/mock/node-child-ipc.ts +69 -0
- package/ts-code/mock/run-in-proc.ts +111 -0
- package/ts-code/mock/tls-options.ts +73 -0
- package/ts-code/services.ts +138 -0
- package/ts-code/signup/resources/users.ts +429 -0
- package/ts-code/signup/routes/add.ts +65 -0
- package/ts-code/signup/routes/get-available-addresses.ts +49 -0
- package/ts-code/signup/routes/get-available-domains.ts +45 -0
- package/ts-code/signup/signup-app.ts +54 -0
- package/ts-code/signup/signup-tokens.ts +148 -0
- package/ts-code/tests/admin-proto/signup.ts +277 -0
- package/ts-code/tests/jasmine.ts +37 -0
- package/ts-code/tests/libs-for-tests/3nstorage.ts +144 -0
- package/ts-code/tests/libs-for-tests/asmail.ts +220 -0
- package/ts-code/tests/libs-for-tests/assert.ts +22 -0
- package/ts-code/tests/libs-for-tests/async-jasmine.ts +89 -0
- package/ts-code/tests/libs-for-tests/bytes-equal.ts +25 -0
- package/ts-code/tests/libs-for-tests/json-copy.ts +38 -0
- package/ts-code/tests/libs-for-tests/json-equal.ts +55 -0
- package/ts-code/tests/libs-for-tests/mailerid.ts +123 -0
- package/ts-code/tests/libs-for-tests/pkl.ts +127 -0
- package/ts-code/tests/libs-for-tests/server-components/3nstorage.ts +206 -0
- package/ts-code/tests/libs-for-tests/server-components/admin.ts +49 -0
- package/ts-code/tests/libs-for-tests/server-components/asmail.ts +152 -0
- package/ts-code/tests/libs-for-tests/server-components/component.ts +90 -0
- package/ts-code/tests/libs-for-tests/server-components/mailerid.ts +114 -0
- package/ts-code/tests/libs-for-tests/server-runner.ts +82 -0
- package/ts-code/tests/libs-for-tests/spec-assembly.ts +60 -0
- package/ts-code/tests/libs-for-tests/ws-utils.ts +61 -0
- package/ts-code/tests/libs-for-tests/xhr-utils.ts +179 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/archive-obj-ver.ts +100 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/archive-root-ver.ts +91 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.ts +99 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.ts +90 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-obj.ts +84 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/events.ts +125 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-current-obj.ts +298 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-current-root.ts +290 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-obj-status.ts +88 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-root-status.ts +80 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/put-current-obj.ts +366 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/put-current-root.ts +329 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/trans-cancel-root.ts +86 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/trans-cancel.ts +86 -0
- package/ts-code/tests/protocols/3nstorage/owner/test-utils.ts +72 -0
- package/ts-code/tests/protocols/3nstorage/owner.ts +198 -0
- package/ts-code/tests/protocols/asmail/config.ts +172 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/finalize-delivery.ts +69 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.ts +88 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/put-metadata.ts +102 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/put-obj.ts +156 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/restart-session.ts +97 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/start-session.ts +79 -0
- package/ts-code/tests/protocols/asmail/delivery/test-utils.ts +64 -0
- package/ts-code/tests/protocols/asmail/delivery.ts +56 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/events.ts +78 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/get-message-meta.ts +80 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/get-message-obj.ts +197 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/list-messages.ts +110 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/remove-message.ts +74 -0
- package/ts-code/tests/protocols/asmail/retrieval/test-utils.ts +60 -0
- package/ts-code/tests/protocols/asmail/retrieval.ts +115 -0
- package/ts-code/tests/protocols/mailerid.ts +271 -0
- package/ts-code/tests/shared-checks/check-mid-login.ts +164 -0
- package/ts-code/tests/shared-checks/requests.ts +135 -0
- package/ts-code/tsconfig.json +11 -0
- package/ts-code/web3n.d.ts +1068 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2015, 2017, 2019 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This defines interfaces for mail delivery requests.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import * as jwk from '../../jwkeys';
|
|
23
|
+
import * as config from './config';
|
|
24
|
+
import { stringify as stringifyOpts } from 'querystring';
|
|
25
|
+
|
|
26
|
+
export const HTTP_HEADER = {
|
|
27
|
+
contentType: 'Content-Type',
|
|
28
|
+
contentLength: 'Content-Length',
|
|
29
|
+
}
|
|
30
|
+
Object.freeze(HTTP_HEADER);
|
|
31
|
+
|
|
32
|
+
export const ERR_SC = {
|
|
33
|
+
duplicateReq: 475,
|
|
34
|
+
earlyReq: 476,
|
|
35
|
+
malformed: 400,
|
|
36
|
+
needSession: 401,
|
|
37
|
+
server: 500,
|
|
38
|
+
contentTooLong: 413,
|
|
39
|
+
contentLenMissing: 411,
|
|
40
|
+
wrongContentType: 415,
|
|
41
|
+
objIncomplete: 479
|
|
42
|
+
};
|
|
43
|
+
Object.freeze(ERR_SC);
|
|
44
|
+
|
|
45
|
+
export namespace preFlight {
|
|
46
|
+
|
|
47
|
+
export const URL_END = 'pre-flight';
|
|
48
|
+
|
|
49
|
+
export interface Request extends sessionStart.Request { }
|
|
50
|
+
|
|
51
|
+
export interface Reply {
|
|
52
|
+
maxMsgLength: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RedirectReply {
|
|
56
|
+
redirect: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const SC = {
|
|
60
|
+
ok: 200,
|
|
61
|
+
unknownRecipient: 474,
|
|
62
|
+
senderNotAllowed: 403,
|
|
63
|
+
inboxFull: 480,
|
|
64
|
+
redirect: 373
|
|
65
|
+
};
|
|
66
|
+
Object.freeze(SC);
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
Object.freeze(preFlight);
|
|
70
|
+
|
|
71
|
+
export namespace sessionStart {
|
|
72
|
+
|
|
73
|
+
export const URL_END = 'start-session';
|
|
74
|
+
|
|
75
|
+
export interface Request {
|
|
76
|
+
sender?: string;
|
|
77
|
+
recipient: string;
|
|
78
|
+
invitation?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface Reply extends preFlight.Reply {
|
|
82
|
+
sessionId: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface RedirectReply extends preFlight.RedirectReply {}
|
|
86
|
+
|
|
87
|
+
export const SC = preFlight.SC;
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
Object.freeze(sessionStart);
|
|
91
|
+
|
|
92
|
+
export namespace sessionRestart {
|
|
93
|
+
|
|
94
|
+
export const URL_END = 'restart-session';
|
|
95
|
+
|
|
96
|
+
export interface Request {
|
|
97
|
+
recipient: string;
|
|
98
|
+
msgId: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface Reply extends preFlight.Reply {
|
|
102
|
+
sessionId: string;
|
|
103
|
+
maxChunkSize? : number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface RedirectReply extends preFlight.RedirectReply {}
|
|
107
|
+
|
|
108
|
+
export const SC = {
|
|
109
|
+
ok: 200,
|
|
110
|
+
unknownRecipient: 474,
|
|
111
|
+
unknownMsg: 473,
|
|
112
|
+
redirect: 373
|
|
113
|
+
};
|
|
114
|
+
Object.freeze(SC);
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
Object.freeze(sessionRestart);
|
|
118
|
+
|
|
119
|
+
export namespace authSender {
|
|
120
|
+
|
|
121
|
+
export const URL_END = 'authorize-sender';
|
|
122
|
+
|
|
123
|
+
export interface Request {
|
|
124
|
+
assertion: jwk.SignedLoad;
|
|
125
|
+
userCert: jwk.SignedLoad;
|
|
126
|
+
provCert: jwk.SignedLoad;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const SC = {
|
|
130
|
+
ok: 200,
|
|
131
|
+
authFailed: 403
|
|
132
|
+
};
|
|
133
|
+
Object.freeze(SC);
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
Object.freeze(authSender);
|
|
137
|
+
|
|
138
|
+
export namespace initPubKey {
|
|
139
|
+
|
|
140
|
+
export const URL_END = 'init-pub-key';
|
|
141
|
+
|
|
142
|
+
export interface Reply extends config.p.initPubKey.Certs {}
|
|
143
|
+
|
|
144
|
+
export const SC = {
|
|
145
|
+
ok: 200,
|
|
146
|
+
pkeyNotRegistered: 474
|
|
147
|
+
};
|
|
148
|
+
Object.freeze(SC);
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
Object.freeze(initPubKey);
|
|
152
|
+
|
|
153
|
+
export namespace msgMeta {
|
|
154
|
+
|
|
155
|
+
export const URL_END = 'msg/meta';
|
|
156
|
+
|
|
157
|
+
export interface CryptoInfo {
|
|
158
|
+
pid?: string;
|
|
159
|
+
recipientKid?: string;
|
|
160
|
+
senderPKey?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface Request extends CryptoInfo {
|
|
164
|
+
objIds: string[];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface Reply {
|
|
168
|
+
msgId: string;
|
|
169
|
+
maxChunkSize? : number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export const SC = {
|
|
173
|
+
ok: 201
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
Object.freeze(msgMeta);
|
|
178
|
+
|
|
179
|
+
export interface PutObjFirstQueryOpts {
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* This is a length of header, when it is sent in a request.
|
|
183
|
+
* Header must be sent with the first request, located in http body start.
|
|
184
|
+
*/
|
|
185
|
+
header: number;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* This is a boolean flag, which true value indicates that this is the last
|
|
189
|
+
* request in sending the object.
|
|
190
|
+
*/
|
|
191
|
+
last?: boolean;
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface PutObjSecondQueryOpts {
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* This is an offset into segments.
|
|
199
|
+
*/
|
|
200
|
+
ofs: number;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* This is a boolean flag, which true value indicates that this is the last
|
|
204
|
+
* request in sending the object.
|
|
205
|
+
*/
|
|
206
|
+
last?: boolean;
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export namespace msgObj {
|
|
211
|
+
|
|
212
|
+
export const EXPRESS_URL_END = 'msg/obj/:objId';
|
|
213
|
+
|
|
214
|
+
export function firstPutReqUrlEnd(objId: string,
|
|
215
|
+
opts: PutObjFirstQueryOpts): string {
|
|
216
|
+
return `msg/obj/${objId}?${stringifyOpts(opts as any)}`;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function secondPutReqUrlEnd(objId: string,
|
|
220
|
+
opts: PutObjSecondQueryOpts): string {
|
|
221
|
+
return `msg/obj/${objId}?${stringifyOpts(opts as any)}`;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const SC = {
|
|
225
|
+
ok: 201,
|
|
226
|
+
objAlreadyExists: 473,
|
|
227
|
+
unknownObj: 474
|
|
228
|
+
};
|
|
229
|
+
Object.freeze(SC);
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
Object.freeze(msgObj);
|
|
233
|
+
|
|
234
|
+
export namespace completion {
|
|
235
|
+
|
|
236
|
+
export const URL_END = 'msg-complete';
|
|
237
|
+
|
|
238
|
+
export const SC = {
|
|
239
|
+
ok: 200,
|
|
240
|
+
};
|
|
241
|
+
Object.freeze(SC);
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
Object.freeze(completion);
|
|
245
|
+
|
|
246
|
+
export interface ErrorReply {
|
|
247
|
+
error: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
Object.freeze(exports);
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2015, 2017, 2019, 2025 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This defines interfaces for mail retrieval requests.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import * as midApi from '../mailer-id/login';
|
|
22
|
+
import * as deliveryApi from './delivery';
|
|
23
|
+
import { stringify as stringifyOpts } from 'querystring';
|
|
24
|
+
|
|
25
|
+
export const BIN_TYPE = 'application/octet-stream';
|
|
26
|
+
|
|
27
|
+
export const HTTP_HEADER = {
|
|
28
|
+
contentType: 'Content-Type',
|
|
29
|
+
contentLength: 'Content-Length',
|
|
30
|
+
objHeaderLength: 'X-Obj-Header-Length',
|
|
31
|
+
objSegmentsLength: 'X-Obj-Segments-Length',
|
|
32
|
+
}
|
|
33
|
+
Object.freeze(HTTP_HEADER);
|
|
34
|
+
export const ERR_SC = {
|
|
35
|
+
malformed: 400,
|
|
36
|
+
needAuth: midApi.ERR_SC.needAuth,
|
|
37
|
+
server: 500
|
|
38
|
+
};
|
|
39
|
+
Object.freeze(ERR_SC);
|
|
40
|
+
|
|
41
|
+
export namespace midLogin {
|
|
42
|
+
|
|
43
|
+
export const MID_URL_PART = 'login/mailerid/';
|
|
44
|
+
export const START_URL_END = MID_URL_PART + midApi.startSession.URL_END;
|
|
45
|
+
export const AUTH_URL_END = MID_URL_PART + midApi.authSession.URL_END;
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
Object.freeze(midLogin);
|
|
49
|
+
|
|
50
|
+
export namespace closeSession {
|
|
51
|
+
|
|
52
|
+
export const URL_END = 'close-session';
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
Object.freeze(closeSession);
|
|
56
|
+
|
|
57
|
+
export interface ListMsgsOpts {
|
|
58
|
+
from?: number;
|
|
59
|
+
to?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace listMsgs {
|
|
63
|
+
|
|
64
|
+
export const EXPRESS_URL_END = 'msg/ids';
|
|
65
|
+
|
|
66
|
+
export function genUrlEnd(opts?: ListMsgsOpts): string {
|
|
67
|
+
let optStr = (opts ? '?'+stringifyOpts(opts as any) : '');
|
|
68
|
+
return `msg/ids${optStr}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface Reply extends Array<string> {}
|
|
72
|
+
|
|
73
|
+
export const SC = {
|
|
74
|
+
ok: 200,
|
|
75
|
+
};
|
|
76
|
+
Object.freeze(SC);
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
Object.freeze(listMsgs);
|
|
80
|
+
|
|
81
|
+
export namespace rmMsg {
|
|
82
|
+
|
|
83
|
+
export const EXPRESS_URL_END = 'msg/:msgId';
|
|
84
|
+
|
|
85
|
+
export function genUrlEnd(msgId: string): string {
|
|
86
|
+
return 'msg/'+msgId;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const SC = {
|
|
90
|
+
ok: 200,
|
|
91
|
+
unknownMsg: 474
|
|
92
|
+
};
|
|
93
|
+
Object.freeze(SC);
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
Object.freeze(rmMsg);
|
|
97
|
+
|
|
98
|
+
export interface ObjSize {
|
|
99
|
+
header: number;
|
|
100
|
+
segments: number|undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface ObjStatus {
|
|
104
|
+
completed?: boolean;
|
|
105
|
+
size: ObjSize;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface MsgMeta {
|
|
109
|
+
recipient: string;
|
|
110
|
+
extMeta: deliveryApi.msgMeta.Request;
|
|
111
|
+
deliveryStart: number;
|
|
112
|
+
authSender: string|undefined;
|
|
113
|
+
invite: string|undefined;
|
|
114
|
+
maxMsgLength: number;
|
|
115
|
+
deliveryCompletion?: number;
|
|
116
|
+
objs: { [objId: string]: ObjStatus; };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export namespace msgMetadata {
|
|
120
|
+
|
|
121
|
+
export const EXPRESS_URL_END = 'msg/:msgId/meta';
|
|
122
|
+
|
|
123
|
+
export function genUrlEnd(msgId: string): string {
|
|
124
|
+
return 'msg/'+msgId+'/meta';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface Reply extends MsgMeta {}
|
|
128
|
+
|
|
129
|
+
export const SC = {
|
|
130
|
+
ok: 200,
|
|
131
|
+
unknownMsg: 474
|
|
132
|
+
};
|
|
133
|
+
Object.freeze(SC);
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
Object.freeze(msgMetadata);
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* This function returns either a checked version of given meta object, if it
|
|
140
|
+
* passes as message meta, or undefined, otherwise.
|
|
141
|
+
* @param meta is an object that is expected to be message meta
|
|
142
|
+
*/
|
|
143
|
+
export function sanitizedMeta(meta: MsgMeta): MsgMeta|undefined {
|
|
144
|
+
if (typeof meta !== 'object') { return; }
|
|
145
|
+
if (typeof meta.objs !== 'object') { return; }
|
|
146
|
+
for (const objId of Object.keys(meta.objs)) {
|
|
147
|
+
const st = meta.objs[objId];
|
|
148
|
+
if (typeof st.size.header !== 'number') { return; }
|
|
149
|
+
if (st.completed &&
|
|
150
|
+
(st.size.segments === undefined)) { return; }
|
|
151
|
+
}
|
|
152
|
+
// TODO add more checks and return new object instead of a given one
|
|
153
|
+
return meta;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface GetObjQueryOpts {
|
|
157
|
+
/**
|
|
158
|
+
* This is a boolean flag, which true value indicates that header should be
|
|
159
|
+
* present in a response. If it is false, or is not present, header is not
|
|
160
|
+
* included in a reply.
|
|
161
|
+
*/
|
|
162
|
+
header?: boolean;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* This is an offset into segments. If it is not present, zero is assumed.
|
|
166
|
+
* This field must be zero or missing, when header is true.
|
|
167
|
+
*/
|
|
168
|
+
ofs?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* This is a limit on number of segment bytes to be returned.
|
|
172
|
+
*/
|
|
173
|
+
limit?: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export namespace msgObj {
|
|
177
|
+
|
|
178
|
+
export const EXPRESS_URL_END = 'msg/:msgId/obj/:objId';
|
|
179
|
+
|
|
180
|
+
export function genUrlEnd(msgId: string, objId: string,
|
|
181
|
+
opts?: GetObjQueryOpts): string {
|
|
182
|
+
let optStr = (opts ? '?'+stringifyOpts(opts as any) : '');
|
|
183
|
+
return `msg/${msgId}/obj/${objId}${optStr}`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const SC = {
|
|
187
|
+
ok: 200,
|
|
188
|
+
unknownMsgOrObj: 474
|
|
189
|
+
};
|
|
190
|
+
Object.freeze(SC);
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
Object.freeze(msgObj);
|
|
194
|
+
|
|
195
|
+
export interface ErrorReply {
|
|
196
|
+
error: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export namespace wsEventChannel {
|
|
200
|
+
|
|
201
|
+
export const URL_END = 'events';
|
|
202
|
+
|
|
203
|
+
export const SC = {
|
|
204
|
+
ok: 200,
|
|
205
|
+
};
|
|
206
|
+
Object.freeze(SC);
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
Object.freeze(wsEventChannel);
|
|
210
|
+
|
|
211
|
+
export namespace msgRecievedCompletely {
|
|
212
|
+
|
|
213
|
+
export const EVENT_NAME = 'msg-received-completely';
|
|
214
|
+
|
|
215
|
+
export interface Event {
|
|
216
|
+
msgId: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
Object.freeze(msgRecievedCompletely);
|
|
221
|
+
|
|
222
|
+
// XXX this event should be triggered by big messages with more than one obj
|
|
223
|
+
export namespace msgMainObjRecieved {
|
|
224
|
+
|
|
225
|
+
export const EVENT_NAME = 'msg-main-obj-received';
|
|
226
|
+
|
|
227
|
+
export interface Event {
|
|
228
|
+
msgId: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
Object.freeze(msgMainObjRecieved);
|
|
233
|
+
|
|
234
|
+
// XXX add event about message removal
|
|
235
|
+
// it is useful in multi-device case, pass implicit implicit signal that will
|
|
236
|
+
// have context-specific meaning.
|
|
237
|
+
|
|
238
|
+
Object.freeze(exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2025 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface ASMailRootRoute {
|
|
19
|
+
delivery?: string;
|
|
20
|
+
retrieval?: string;
|
|
21
|
+
config?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2016 - 2017 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export type Envelope = web3n.ipc.Envelope;
|
|
19
|
+
export type EventEnvelope<T> = web3n.ipc.EventEnvelope<T>;
|
|
20
|
+
export type EventEndEnvelope = web3n.ipc.EventEndEnvelope;
|
|
21
|
+
export type EventException = web3n.ipc.EventException;
|
|
22
|
+
export type RequestEnvelope<T> = web3n.ipc.RequestEnvelope<T>;
|
|
23
|
+
export type ReplyEnvelope<T> = web3n.ipc.ReplyEnvelope<T>;
|
|
24
|
+
|
|
25
|
+
export namespace events {
|
|
26
|
+
|
|
27
|
+
export namespace subscribe {
|
|
28
|
+
|
|
29
|
+
export const REQ_NAME = 'subscribe';
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
Object.freeze(subscribe);
|
|
33
|
+
|
|
34
|
+
export namespace unsubscribe {
|
|
35
|
+
|
|
36
|
+
export const REQ_NAME = 'unsubscribe';
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
Object.freeze(unsubscribe);
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
Object.freeze(events);
|
|
43
|
+
|
|
44
|
+
Object.freeze(exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2024 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export namespace createLocker {
|
|
20
|
+
|
|
21
|
+
export const URL_END = 'create';
|
|
22
|
+
|
|
23
|
+
export const method = 'PUT';
|
|
24
|
+
|
|
25
|
+
export interface Request {
|
|
26
|
+
token?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Reply {
|
|
30
|
+
userId: string;
|
|
31
|
+
storageUri: string;
|
|
32
|
+
storageMBs: number;
|
|
33
|
+
willBeRemovedAt: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const SC = {
|
|
37
|
+
ok: 200,
|
|
38
|
+
invalidToken: 403
|
|
39
|
+
};
|
|
40
|
+
Object.freeze(SC);
|
|
41
|
+
|
|
42
|
+
};
|
|
43
|
+
Object.freeze(createLocker);
|
|
44
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2015 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This defines request interfaces for mailerId-based login.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import * as jwk from '../../jwkeys';
|
|
23
|
+
|
|
24
|
+
export const ERR_SC = {
|
|
25
|
+
duplicate: 475,
|
|
26
|
+
malformed: 400,
|
|
27
|
+
needAuth: 401
|
|
28
|
+
};
|
|
29
|
+
Object.freeze(ERR_SC);
|
|
30
|
+
|
|
31
|
+
export namespace startSession {
|
|
32
|
+
|
|
33
|
+
export const URL_END = 'start-session';
|
|
34
|
+
|
|
35
|
+
export interface Request {
|
|
36
|
+
userId: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Reply {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface RedirectReply {
|
|
44
|
+
redirect: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const SC = {
|
|
48
|
+
unknownUser: 474,
|
|
49
|
+
redirect: 373,
|
|
50
|
+
ok: 200
|
|
51
|
+
};
|
|
52
|
+
Object.freeze(SC);
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
Object.freeze(startSession);
|
|
56
|
+
|
|
57
|
+
export namespace authSession {
|
|
58
|
+
|
|
59
|
+
export const URL_END = 'authorize-session';
|
|
60
|
+
|
|
61
|
+
export interface Request {
|
|
62
|
+
assertion: jwk.SignedLoad;
|
|
63
|
+
userCert: jwk.SignedLoad;
|
|
64
|
+
provCert: jwk.SignedLoad;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const SC = {
|
|
68
|
+
authFailed: 403,
|
|
69
|
+
ok: 200
|
|
70
|
+
};
|
|
71
|
+
Object.freeze(SC);
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
Object.freeze(authSession);
|
|
75
|
+
|
|
76
|
+
export interface ErrorReply {
|
|
77
|
+
error: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Object.freeze(exports);
|