@synopackageland/cli 0.8.0 → 0.9.0
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/CHANGELOG.md +124 -0
- package/README.md +26 -4
- package/dist/add.js +4 -17
- package/dist/authorization-sdk.d.ts +0 -1
- package/dist/authorization-sdk.js +0 -1
- package/dist/build-spk/gateway.js +2 -2
- package/dist/build-spk/notices.js +12 -8
- package/dist/capability-overlays.d.ts +15 -0
- package/dist/capability-overlays.js +18 -0
- package/dist/cli-version.d.ts +2 -0
- package/dist/cli-version.js +3 -0
- package/dist/cli.js +3 -1
- package/dist/error-registry.js +12 -4
- package/dist/info.js +2 -1
- package/dist/init.js +52 -58
- package/dist/reproducible.js +1 -1
- package/dist/runtime/delegate-contract.d.ts +15 -0
- package/dist/runtime/delegate-contract.js +2 -0
- package/dist/runtime/executor-build.d.ts +15 -1
- package/dist/runtime/executor-build.js +42 -11
- package/dist/runtime/executor-digests.json +13 -0
- package/dist/runtime/executor-inspect.d.ts +1 -0
- package/dist/runtime/executor-inspect.js +5 -2
- package/dist/runtime/executor-policy.d.ts +3 -1
- package/dist/runtime/executor-policy.js +7 -2
- package/dist/runtime/executor-source.d.ts +21 -0
- package/dist/runtime/executor-source.js +35 -0
- package/dist/runtime/executor-tasks.d.ts +5 -2
- package/dist/runtime/executor-tasks.js +6 -4
- package/dist/runtime/sdk-source.d.ts +31 -0
- package/dist/runtime/sdk-source.js +92 -0
- package/dist/standalone/api-permissions.d.ts +4 -1
- package/dist/standalone/api-permissions.js +10 -18
- package/dist/standalone/build.d.ts +1 -0
- package/dist/standalone/build.js +11 -4
- package/dist/standalone/daemon.js +2 -2
- package/dist/standalone/dsm-window.js +2 -2
- package/dist/standalone/manifest.d.ts +5 -2
- package/dist/standalone/manifest.js +9 -3
- package/dist/standalone/root-window.d.ts +1 -1
- package/dist/standalone/root-window.js +0 -1
- package/dist/standalone/sdk-check.d.ts +9 -0
- package/dist/standalone/sdk-check.js +43 -0
- package/dist/standalone/spk.js +1 -1
- package/dist/template-paths.d.ts +7 -2
- package/dist/template-paths.js +18 -6
- package/package.json +13 -3
- package/dist/templates/_executor/README.md +0 -318
- package/dist/templates/_executor/anchor.go +0 -156
- package/dist/templates/_executor/anchor_test.go +0 -161
- package/dist/templates/_executor/apppriv_review_test.go +0 -28
- package/dist/templates/_executor/auth_presence_review_test.go +0 -38
- package/dist/templates/_executor/cancel_contract_test.go +0 -236
- package/dist/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/dist/templates/_executor/cookie_review_test.go +0 -27
- package/dist/templates/_executor/copy.go +0 -64
- package/dist/templates/_executor/copy_test.go +0 -88
- package/dist/templates/_executor/digest_review_test.go +0 -120
- package/dist/templates/_executor/directories.go +0 -40
- package/dist/templates/_executor/dsm.go +0 -369
- package/dist/templates/_executor/dsm_test.go +0 -290
- package/dist/templates/_executor/executor.go +0 -735
- package/dist/templates/_executor/executor_test.go +0 -314
- package/dist/templates/_executor/go.mod +0 -5
- package/dist/templates/_executor/identity.go +0 -74
- package/dist/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/dist/templates/_executor/identity_linux.go +0 -82
- package/dist/templates/_executor/identity_security_test.go +0 -43
- package/dist/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/dist/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/dist/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/dist/templates/_executor/internal/taskscript/control.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/dist/templates/_executor/json_review_test.go +0 -40
- package/dist/templates/_executor/lifecycle_test.go +0 -97
- package/dist/templates/_executor/link_linux.go +0 -28
- package/dist/templates/_executor/long_running_test.go +0 -530
- package/dist/templates/_executor/main.go +0 -576
- package/dist/templates/_executor/managed.go +0 -117
- package/dist/templates/_executor/managed_test.go +0 -137
- package/dist/templates/_executor/move_linux.go +0 -490
- package/dist/templates/_executor/move_linux_test.go +0 -460
- package/dist/templates/_executor/move_validation.go +0 -46
- package/dist/templates/_executor/move_validation_test.go +0 -187
- package/dist/templates/_executor/operations.go +0 -926
- package/dist/templates/_executor/path_test.go +0 -35
- package/dist/templates/_executor/pid.go +0 -37
- package/dist/templates/_executor/pid_test.go +0 -113
- package/dist/templates/_executor/platform_linux.go +0 -187
- package/dist/templates/_executor/platform_linux_test.go +0 -191
- package/dist/templates/_executor/platform_other.go +0 -76
- package/dist/templates/_executor/process.go +0 -142
- package/dist/templates/_executor/purge_log.go +0 -18
- package/dist/templates/_executor/records.go +0 -242
- package/dist/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/dist/templates/_executor/scope_client.go +0 -37
- package/dist/templates/_executor/scope_contract.go +0 -12
- package/dist/templates/_executor/selected_scope.go +0 -146
- package/dist/templates/_executor/selected_scope_test.go +0 -186
- package/dist/templates/_executor/socket_linux_test.go +0 -46
- package/dist/templates/_executor/status_disabled_test.go +0 -33
- package/dist/templates/_executor/store.go +0 -91
- package/dist/templates/_executor/supervise.go +0 -109
- package/dist/templates/_executor/supervise_test.go +0 -130
- package/dist/templates/_executor/task_race_review_test.go +0 -47
- package/dist/templates/_executor/tasks.go +0 -320
- package/dist/templates/_executor/tasks_dsm71_test.go +0 -114
- package/dist/templates/_executor/tasks_review_test.go +0 -43
- package/dist/templates/_executor/tasks_test.go +0 -223
- package/dist/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/dist/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/dist/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/dist/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/dist/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/dist/templates/_executor/testdata/evidence/storage.json +0 -90
- package/dist/templates/_executor/testdata/evidence/validation.json +0 -55
- package/dist/templates/_executor/testdata/live_probe.py +0 -98
- package/dist/templates/_executor/upgrade_watch_test.go +0 -244
- package/dist/templates/_executor/watch.go +0 -164
- package/dist/templates/_executor/watch_test.go +0 -291
- package/dist/templates/_executor/write_review_linux_test.go +0 -87
- package/dist/templates/_shared/AGENTS.md +0 -146
- package/dist/templates/_shared/CLAUDE.md +0 -1
- package/dist/templates/_shared/third-party-notices.mjs +0 -51
- package/dist/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/dist/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/dist/templates/binary/dsm-package.yaml +0 -46
- package/dist/templates/binary/example/main.go +0 -16
- package/dist/templates/binary/gitignore +0 -2
- package/dist/templates/binary/i18n/messages/de.json +0 -4
- package/dist/templates/binary/i18n/messages/en.json +0 -4
- package/dist/templates/binary/i18n/messages/es.json +0 -4
- package/dist/templates/binary/i18n/messages/fr.json +0 -4
- package/dist/templates/binary/i18n/messages/it.json +0 -4
- package/dist/templates/binary/i18n/messages/ja.json +0 -4
- package/dist/templates/binary/i18n/messages/ko.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/dist/templates/binary/ui/app.css +0 -4
- package/dist/templates/binary/ui/app.js +0 -32
- package/dist/templates/compose/compose.yaml +0 -8
- package/dist/templates/compose/synology-app.yaml +0 -16
- package/dist/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/dist/templates/native-authorization/i18n/de.json +0 -37
- package/dist/templates/native-authorization/i18n/en.json +0 -37
- package/dist/templates/native-authorization/i18n/es.json +0 -37
- package/dist/templates/native-authorization/i18n/fr.json +0 -37
- package/dist/templates/native-authorization/i18n/index.ts +0 -15
- package/dist/templates/native-authorization/i18n/it.json +0 -37
- package/dist/templates/native-authorization/i18n/ja.json +0 -37
- package/dist/templates/native-authorization/i18n/ko.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/dist/templates/native-go/README.md +0 -459
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/dist/templates/native-go/backend/cmd/app/main.go +0 -95
- package/dist/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/dist/templates/native-go/backend/go.mod +0 -9
- package/dist/templates/native-go/backend/go.sum +0 -4
- package/dist/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/dist/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/dist/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/dist/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/dist/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/dist/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/dist/templates/native-go/backend/internal/api/errors.go +0 -47
- package/dist/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/dist/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/dist/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/dist/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/dist/templates/native-go/backend/internal/api/registry.go +0 -142
- package/dist/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/dist/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/dist/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/dist/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/dist/templates/native-go/backend/internal/api/server.go +0 -305
- package/dist/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/dist/templates/native-go/backend/internal/app/background.go +0 -249
- package/dist/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/dist/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/dist/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/dist/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/dist/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/dist/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/dist/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/dist/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/dist/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/dist/templates/native-go/backend/internal/app/identity.go +0 -20
- package/dist/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/dist/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/dist/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/dist/templates/native-go/backend/internal/app/portal.go +0 -30
- package/dist/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/dist/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/dist/templates/native-go/backend/internal/app/routes.go +0 -137
- package/dist/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/dist/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/dist/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/dist/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/dist/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/dist/templates/native-go/backend/internal/background/access.go +0 -57
- package/dist/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/dist/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/dist/templates/native-go/backend/internal/background/runner.go +0 -185
- package/dist/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/dist/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/dist/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/dist/templates/native-go/backend/internal/background/store.go +0 -825
- package/dist/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/dist/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/dist/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/dist/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/dist/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/dist/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/dist/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/dist/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/dist/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/dist/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/dist/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/dist/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/dist/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/dist/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/dist/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/dist/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/dist/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/dist/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/dist/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/dist/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/dist/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/dist/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/dist/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/dist/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/dist/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/dist/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/dist/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/dist/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/dist/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/dist/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/dist/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/dist/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/dist/templates/native-go/backend/internal/identity/README.md +0 -59
- package/dist/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/dist/templates/native-go/backend/internal/identity/http.go +0 -291
- package/dist/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/dist/templates/native-go/backend/internal/identity/service.go +0 -159
- package/dist/templates/native-go/backend/internal/identity/store.go +0 -109
- package/dist/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/dist/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/dist/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/dist/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/dist/templates/native-go/dsm-package.yaml +0 -71
- package/dist/templates/native-go/gitignore +0 -1
- package/dist/templates/native-go/i18n/glossary.json +0 -663
- package/dist/templates/native-go/i18n/messages/de.json +0 -29
- package/dist/templates/native-go/i18n/messages/en.json +0 -29
- package/dist/templates/native-go/i18n/messages/es.json +0 -29
- package/dist/templates/native-go/i18n/messages/fr.json +0 -29
- package/dist/templates/native-go/i18n/messages/it.json +0 -29
- package/dist/templates/native-go/i18n/messages/ja.json +0 -29
- package/dist/templates/native-go/i18n/messages/ko.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/dist/templates/native-go/ui/app.css +0 -45
- package/dist/templates/native-go/ui/app.js +0 -111
- package/dist/templates/native-go-delegate/DELEGATE.md +0 -263
- package/dist/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/dist/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/dist/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/dist/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/dist/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/dist/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/dist/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/dist/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/dist/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/dist/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/dist/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/dist/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/dist/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/dist/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/dist/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/dist/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/dist/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/dist/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/dist/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/dist/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/dist/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/dist/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/dist/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/dist/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/dist/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/dist/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/dist/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/dist/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/dist/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/dist/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/dist/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/dist/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/dist/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/dist/templates/native-go-delegate/test-frontend.sh +0 -12
- package/dist/templates/native-go-delegate/test.sh +0 -18
- package/dist/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/dist/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/dist/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/dist/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/dist/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/dist/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/dist/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/dist/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/dist/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/dist/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/dist/templates/native-go-vue/README.md +0 -47
- package/dist/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/dist/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/dist/templates/native-go-vue/frontend/package.json +0 -6
- package/dist/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/dist/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/dist/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/dist/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/dist/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/dist/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/dist/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/dist/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/dist/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/dist/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/dist/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/dist/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/dist/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/dist/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/dist/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/dist/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/dist/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/dist/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/dist/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/dist/templates/native-go-vue/frontend/src/style.css +0 -27
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/dist/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/dist/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/dist/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/dist/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/dist/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/dist/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/dist/templates/native-go-vue/gitignore +0 -2
- package/templates/_daemon/fixture_linux_test.go +0 -15
- package/templates/_daemon/fixture_other_test.go +0 -7
- package/templates/_daemon/go.mod +0 -5
- package/templates/_daemon/main.go +0 -611
- package/templates/_daemon/main_test.go +0 -315
- package/templates/_daemon/process_linux.go +0 -55
- package/templates/_daemon/process_linux_test.go +0 -161
- package/templates/_daemon/process_other.go +0 -14
- package/templates/_daemon/testdata/child.go +0 -44
- package/templates/_executor/README.md +0 -318
- package/templates/_executor/anchor.go +0 -156
- package/templates/_executor/anchor_test.go +0 -161
- package/templates/_executor/apppriv_review_test.go +0 -28
- package/templates/_executor/auth_presence_review_test.go +0 -38
- package/templates/_executor/cancel_contract_test.go +0 -236
- package/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/templates/_executor/cookie_review_test.go +0 -27
- package/templates/_executor/copy.go +0 -64
- package/templates/_executor/copy_test.go +0 -88
- package/templates/_executor/digest_review_test.go +0 -120
- package/templates/_executor/directories.go +0 -40
- package/templates/_executor/dsm.go +0 -369
- package/templates/_executor/dsm_test.go +0 -290
- package/templates/_executor/executor.go +0 -735
- package/templates/_executor/executor_test.go +0 -314
- package/templates/_executor/go.mod +0 -5
- package/templates/_executor/identity.go +0 -74
- package/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/templates/_executor/identity_linux.go +0 -82
- package/templates/_executor/identity_security_test.go +0 -43
- package/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/templates/_executor/internal/taskscript/control.sh +0 -31
- package/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/templates/_executor/json_review_test.go +0 -40
- package/templates/_executor/lifecycle_test.go +0 -97
- package/templates/_executor/link_linux.go +0 -28
- package/templates/_executor/long_running_test.go +0 -530
- package/templates/_executor/main.go +0 -576
- package/templates/_executor/managed.go +0 -117
- package/templates/_executor/managed_test.go +0 -137
- package/templates/_executor/move_linux.go +0 -490
- package/templates/_executor/move_linux_test.go +0 -460
- package/templates/_executor/move_validation.go +0 -46
- package/templates/_executor/move_validation_test.go +0 -187
- package/templates/_executor/operations.go +0 -926
- package/templates/_executor/path_test.go +0 -35
- package/templates/_executor/pid.go +0 -37
- package/templates/_executor/pid_test.go +0 -113
- package/templates/_executor/platform_linux.go +0 -187
- package/templates/_executor/platform_linux_test.go +0 -191
- package/templates/_executor/platform_other.go +0 -76
- package/templates/_executor/process.go +0 -142
- package/templates/_executor/purge_log.go +0 -18
- package/templates/_executor/records.go +0 -242
- package/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/templates/_executor/scope_client.go +0 -37
- package/templates/_executor/scope_contract.go +0 -12
- package/templates/_executor/selected_scope.go +0 -146
- package/templates/_executor/selected_scope_test.go +0 -186
- package/templates/_executor/socket_linux_test.go +0 -46
- package/templates/_executor/status_disabled_test.go +0 -33
- package/templates/_executor/store.go +0 -91
- package/templates/_executor/supervise.go +0 -109
- package/templates/_executor/supervise_test.go +0 -130
- package/templates/_executor/task_race_review_test.go +0 -47
- package/templates/_executor/tasks.go +0 -320
- package/templates/_executor/tasks_dsm71_test.go +0 -114
- package/templates/_executor/tasks_review_test.go +0 -43
- package/templates/_executor/tasks_test.go +0 -223
- package/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/templates/_executor/testdata/evidence/storage.json +0 -90
- package/templates/_executor/testdata/evidence/validation.json +0 -55
- package/templates/_executor/testdata/live_probe.py +0 -98
- package/templates/_executor/upgrade_watch_test.go +0 -244
- package/templates/_executor/watch.go +0 -164
- package/templates/_executor/watch_test.go +0 -291
- package/templates/_executor/write_review_linux_test.go +0 -87
- package/templates/_gateway/auth.go +0 -101
- package/templates/_gateway/auth_test.go +0 -216
- package/templates/_gateway/cgi.go +0 -133
- package/templates/_gateway/cgi_test.go +0 -156
- package/templates/_gateway/csrf.go +0 -73
- package/templates/_gateway/csrf_test.go +0 -155
- package/templates/_gateway/directory.go +0 -108
- package/templates/_gateway/directory_test.go +0 -202
- package/templates/_gateway/gateway.go +0 -412
- package/templates/_gateway/gateway_test.go +0 -676
- package/templates/_gateway/go.mod +0 -5
- package/templates/_gateway/groups.go +0 -66
- package/templates/_gateway/main.go +0 -45
- package/templates/_shared/AGENTS.md +0 -146
- package/templates/_shared/CLAUDE.md +0 -1
- package/templates/_shared/GO-LICENSE +0 -27
- package/templates/_shared/GO-PATENTS +0 -22
- package/templates/_shared/LICENSES/TEMPLATE.txt +0 -21
- package/templates/_shared/third-party-notices.mjs +0 -51
- package/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/templates/binary/dsm-package.yaml +0 -46
- package/templates/binary/example/main.go +0 -16
- package/templates/binary/gitignore +0 -2
- package/templates/binary/i18n/messages/de.json +0 -4
- package/templates/binary/i18n/messages/en.json +0 -4
- package/templates/binary/i18n/messages/es.json +0 -4
- package/templates/binary/i18n/messages/fr.json +0 -4
- package/templates/binary/i18n/messages/it.json +0 -4
- package/templates/binary/i18n/messages/ja.json +0 -4
- package/templates/binary/i18n/messages/ko.json +0 -4
- package/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/templates/binary/ui/app.css +0 -4
- package/templates/binary/ui/app.js +0 -32
- package/templates/compose/compose.yaml +0 -8
- package/templates/compose/synology-app.yaml +0 -16
- package/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/templates/native-authorization/i18n/de.json +0 -37
- package/templates/native-authorization/i18n/en.json +0 -37
- package/templates/native-authorization/i18n/es.json +0 -37
- package/templates/native-authorization/i18n/fr.json +0 -37
- package/templates/native-authorization/i18n/index.ts +0 -15
- package/templates/native-authorization/i18n/it.json +0 -37
- package/templates/native-authorization/i18n/ja.json +0 -37
- package/templates/native-authorization/i18n/ko.json +0 -37
- package/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/templates/native-go/README.md +0 -459
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/templates/native-go/backend/cmd/app/main.go +0 -95
- package/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/templates/native-go/backend/go.mod +0 -9
- package/templates/native-go/backend/go.sum +0 -4
- package/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/templates/native-go/backend/internal/api/errors.go +0 -47
- package/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/templates/native-go/backend/internal/api/registry.go +0 -142
- package/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/templates/native-go/backend/internal/api/server.go +0 -305
- package/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/templates/native-go/backend/internal/app/background.go +0 -249
- package/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/templates/native-go/backend/internal/app/identity.go +0 -20
- package/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/templates/native-go/backend/internal/app/portal.go +0 -30
- package/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/templates/native-go/backend/internal/app/routes.go +0 -137
- package/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/templates/native-go/backend/internal/background/access.go +0 -57
- package/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/templates/native-go/backend/internal/background/runner.go +0 -185
- package/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/templates/native-go/backend/internal/background/store.go +0 -825
- package/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/templates/native-go/backend/internal/identity/README.md +0 -59
- package/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/templates/native-go/backend/internal/identity/http.go +0 -291
- package/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/templates/native-go/backend/internal/identity/service.go +0 -159
- package/templates/native-go/backend/internal/identity/store.go +0 -109
- package/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/templates/native-go/dsm-package.yaml +0 -71
- package/templates/native-go/gitignore +0 -1
- package/templates/native-go/i18n/glossary.json +0 -663
- package/templates/native-go/i18n/messages/de.json +0 -29
- package/templates/native-go/i18n/messages/en.json +0 -29
- package/templates/native-go/i18n/messages/es.json +0 -29
- package/templates/native-go/i18n/messages/fr.json +0 -29
- package/templates/native-go/i18n/messages/it.json +0 -29
- package/templates/native-go/i18n/messages/ja.json +0 -29
- package/templates/native-go/i18n/messages/ko.json +0 -29
- package/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/templates/native-go/ui/app.css +0 -45
- package/templates/native-go/ui/app.js +0 -111
- package/templates/native-go-delegate/DELEGATE.md +0 -263
- package/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/templates/native-go-delegate/test-frontend.sh +0 -12
- package/templates/native-go-delegate/test.sh +0 -18
- package/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/templates/native-go-vue/README.md +0 -47
- package/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/templates/native-go-vue/frontend/package.json +0 -6
- package/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/templates/native-go-vue/frontend/src/style.css +0 -27
- package/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/templates/native-go-vue/gitignore +0 -2
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_other_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/go.mod +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_other.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/testdata/child.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/go.mod +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/groups.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/main.go +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-LICENSE +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-PATENTS +0 -0
- /package/{dist/templates/_shared/LICENSES → assets/licenses}/TEMPLATE.txt +0 -0
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
package delegate
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"dsmapp/internal/background"
|
|
6
|
-
"fmt"
|
|
7
|
-
"io/fs"
|
|
8
|
-
"os"
|
|
9
|
-
"path/filepath"
|
|
10
|
-
"syscall"
|
|
11
|
-
"testing"
|
|
12
|
-
"time"
|
|
13
|
-
|
|
14
|
-
"golang.org/x/sys/unix"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
// A producer must know from the code alone whether repeating the same params
|
|
18
|
-
// is safe: retryable codes never wrote anything a retry could duplicate, and
|
|
19
|
-
// terminal codes need the package or administrator to repair the spool first.
|
|
20
|
-
func TestJobErrorSeparatesRetryableFromTerminalSpoolFailures(t *testing.T) {
|
|
21
|
-
for _, tc := range []struct {
|
|
22
|
-
err error
|
|
23
|
-
want string
|
|
24
|
-
}{
|
|
25
|
-
{background.ErrBusy, "jobs_busy"},
|
|
26
|
-
{context.DeadlineExceeded, "canceled"},
|
|
27
|
-
{context.Canceled, "canceled"},
|
|
28
|
-
{fmt.Errorf("journal: %w", context.DeadlineExceeded), "canceled"},
|
|
29
|
-
{&fs.PathError{Op: "write", Path: "journal.json", Err: syscall.EIO}, "jobs_unavailable"},
|
|
30
|
-
{background.ErrUnsafeSpool, "spool_unsafe"},
|
|
31
|
-
{background.ErrJournalUnreadable, "journal_corrupt"},
|
|
32
|
-
{background.ErrJournalSchema, "journal_corrupt"},
|
|
33
|
-
} {
|
|
34
|
-
code(t, jobError(tc.err), tc.want)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// holdJournal keeps the spool lock as another process would, until release.
|
|
39
|
-
func holdJournal(t *testing.T, s *Service) (release func()) {
|
|
40
|
-
t.Helper()
|
|
41
|
-
lock, err := os.OpenFile(filepath.Join(filepath.Dir(s.StagingDir), "background", "lock"), os.O_RDWR, 0o600)
|
|
42
|
-
if err != nil {
|
|
43
|
-
t.Fatal(err)
|
|
44
|
-
}
|
|
45
|
-
if err = unix.Flock(int(lock.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil {
|
|
46
|
-
t.Fatal(err)
|
|
47
|
-
}
|
|
48
|
-
return func() { unix.Flock(int(lock.Fd()), unix.LOCK_UN); lock.Close() }
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
func commit(e *dedupExecutor, in MoveParams) {
|
|
52
|
-
e.mu.Lock()
|
|
53
|
-
defer e.mu.Unlock()
|
|
54
|
-
e.ops[in.JobID] = OperationResult{JobID: in.JobID, State: "committed", Receipt: &Receipt{Path: "/home/" + in.Name, Size: in.Size}}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// t-0183 C3: a caller deadline spent waiting for the journal is retryable, and
|
|
58
|
-
// the same params later converge on the original committed operation.
|
|
59
|
-
func TestJournalDeadlineIsRetryableAndConvergesOnTheOriginalOperation(t *testing.T) {
|
|
60
|
-
s, in, e, _ := recoveringService(t)
|
|
61
|
-
if out, err := s.MoveFromStaging(context.Background(), in); err != nil || out.State != "queued" {
|
|
62
|
-
t.Fatal(out, err)
|
|
63
|
-
}
|
|
64
|
-
release := holdJournal(t, s)
|
|
65
|
-
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
|
|
66
|
-
_, err := s.MoveFromStaging(ctx, in)
|
|
67
|
-
cancel()
|
|
68
|
-
release()
|
|
69
|
-
code(t, err, "canceled")
|
|
70
|
-
commit(e, in)
|
|
71
|
-
if out, err := s.MoveFromStaging(context.Background(), in); err != nil || out.State != "committed" {
|
|
72
|
-
t.Fatal(out, err)
|
|
73
|
-
}
|
|
74
|
-
if moves, created := e.counts(); moves != 1 || created != 1 {
|
|
75
|
-
t.Fatal("same tuple admitted again", moves, created)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
func TestFirstAdmissionUnderJournalDeadlineSendsNothingUntilRetried(t *testing.T) {
|
|
80
|
-
s, in, e, _ := recoveringService(t)
|
|
81
|
-
if _, err := s.Store.PendingMoves(context.Background()); err != nil {
|
|
82
|
-
t.Fatal(err)
|
|
83
|
-
}
|
|
84
|
-
release := holdJournal(t, s)
|
|
85
|
-
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
|
|
86
|
-
_, err := s.MoveFromStaging(ctx, in)
|
|
87
|
-
cancel()
|
|
88
|
-
release()
|
|
89
|
-
code(t, err, "canceled")
|
|
90
|
-
if moves, _ := e.counts(); moves != 0 {
|
|
91
|
-
t.Fatal("admitted without a durable reservation", moves)
|
|
92
|
-
}
|
|
93
|
-
if out, err := s.MoveFromStaging(context.Background(), in); err != nil || out.State != "queued" {
|
|
94
|
-
t.Fatal(out, err)
|
|
95
|
-
}
|
|
96
|
-
if moves, created := e.counts(); moves != 1 || created != 1 {
|
|
97
|
-
t.Fatal(moves, created)
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// A busy journal must not hide a committed receipt: the same ref answers from
|
|
102
|
-
// the executor's original operation, read-only, without a new admission.
|
|
103
|
-
func TestCommittedRefAnswersItsReceiptWhileTheJournalIsBusy(t *testing.T) {
|
|
104
|
-
s, in, e, _ := recoveringService(t)
|
|
105
|
-
if _, err := s.MoveFromStaging(context.Background(), in); err != nil {
|
|
106
|
-
t.Fatal(err)
|
|
107
|
-
}
|
|
108
|
-
commit(e, in)
|
|
109
|
-
s.Store = background.NewRequestStore(filepath.Join(filepath.Dir(s.StagingDir), "background"))
|
|
110
|
-
release := holdJournal(t, s)
|
|
111
|
-
defer release()
|
|
112
|
-
if out, err := s.MoveFromStaging(context.Background(), in); err != nil || out.State != "committed" {
|
|
113
|
-
t.Fatal(out, err)
|
|
114
|
-
}
|
|
115
|
-
ref := OperationRef{in.DelegationID, in.JobID}
|
|
116
|
-
if out, err := s.OperationStatus(context.Background(), nil, ref); err != nil || out.State != "committed" || out.Receipt == nil || out.Receipt.Size != in.Size {
|
|
117
|
-
t.Fatal(out, err)
|
|
118
|
-
}
|
|
119
|
-
if moves, created := e.counts(); moves != 1 || created != 1 {
|
|
120
|
-
t.Fatal(moves, created)
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
func TestUnknownRefStaysRetryableWhileTheJournalIsBusy(t *testing.T) {
|
|
125
|
-
s, in, e, _ := recoveringService(t)
|
|
126
|
-
if _, err := s.Store.PendingMoves(context.Background()); err != nil {
|
|
127
|
-
t.Fatal(err)
|
|
128
|
-
}
|
|
129
|
-
s.Store = background.NewRequestStore(filepath.Join(filepath.Dir(s.StagingDir), "background"))
|
|
130
|
-
release := holdJournal(t, s)
|
|
131
|
-
defer release()
|
|
132
|
-
_, err := s.MoveFromStaging(context.Background(), in)
|
|
133
|
-
code(t, err, "jobs_busy")
|
|
134
|
-
if moves, _ := e.counts(); moves != 0 {
|
|
135
|
-
t.Fatal(moves)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
package delegate
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"dsmapp/internal/background"
|
|
6
|
-
"errors"
|
|
7
|
-
"os"
|
|
8
|
-
"path/filepath"
|
|
9
|
-
"testing"
|
|
10
|
-
"time"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
func TestWaitingCancellationRevocationAndOtherOwnerAccess(t *testing.T) {
|
|
14
|
-
for _, action := range []string{"cancel", "revoke", "parent-stop"} {
|
|
15
|
-
t.Run(action, func(t *testing.T) {
|
|
16
|
-
s := service(t, absentExecutor(t))
|
|
17
|
-
id := retryJob(t, s, time.Now().Add(time.Hour))
|
|
18
|
-
bob := background.Submitter{User: "bob", UID: "1206"}
|
|
19
|
-
other, _, err := s.Store.Submit(context.Background(), background.SubmitRequest{Key: "other", Name: "other", Data: []byte("other"), Submitter: bob})
|
|
20
|
-
if err != nil {
|
|
21
|
-
t.Fatal(err)
|
|
22
|
-
}
|
|
23
|
-
cgi := &Service{Client: s.Client, Store: background.NewRequestStore(filepath.Join(filepath.Dir(s.StagingDir), "background")), LookupUID: func(user string) string {
|
|
24
|
-
if user == "bob" {
|
|
25
|
-
return "1206"
|
|
26
|
-
}
|
|
27
|
-
return "1205"
|
|
28
|
-
}}
|
|
29
|
-
waiting := make(chan struct{})
|
|
30
|
-
s.wait = func(ctx context.Context, _ time.Duration) error { close(waiting); <-ctx.Done(); return ctx.Err() }
|
|
31
|
-
ctx, stop := context.WithCancel(context.Background())
|
|
32
|
-
defer stop()
|
|
33
|
-
done := make(chan error, 1)
|
|
34
|
-
go func() { done <- s.RunOnce(ctx) }()
|
|
35
|
-
select {
|
|
36
|
-
case <-waiting:
|
|
37
|
-
case <-time.After(3 * time.Second):
|
|
38
|
-
t.Fatal("worker did not wait")
|
|
39
|
-
}
|
|
40
|
-
// A separate CGI store/process shares the same lock file with the worker.
|
|
41
|
-
accessDone := make(chan error, 1)
|
|
42
|
-
go func() {
|
|
43
|
-
list, e := cgi.Store.ListFor(context.Background(), background.Access{Owner: bob})
|
|
44
|
-
if e != nil {
|
|
45
|
-
accessDone <- e
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
if len(list) != 1 || list[0].ID != other.ID {
|
|
49
|
-
accessDone <- errors.New("owner list leaked waiting job")
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
_, e = cgi.Store.CancelFor(context.Background(), other.ID, background.Access{Owner: bob})
|
|
53
|
-
accessDone <- e
|
|
54
|
-
}()
|
|
55
|
-
select {
|
|
56
|
-
case e := <-accessDone:
|
|
57
|
-
if e != nil {
|
|
58
|
-
t.Fatal(e)
|
|
59
|
-
}
|
|
60
|
-
case <-time.After(time.Second):
|
|
61
|
-
t.Fatal("executor timer holds journal lock")
|
|
62
|
-
}
|
|
63
|
-
denied := rpc(t, cgi, "bob", "delegate.jobs.cancel", `{"id":"`+id+`"}`)
|
|
64
|
-
if denied["success"] != false {
|
|
65
|
-
t.Fatal("other owner canceled waiting job", denied)
|
|
66
|
-
}
|
|
67
|
-
switch action {
|
|
68
|
-
case "cancel":
|
|
69
|
-
out := rpc(t, cgi, "alice", "delegate.jobs.cancel", `{"id":"`+id+`"}`)
|
|
70
|
-
if out["success"] != true || out["data"].(map[string]any)["revocation_pending"] != true {
|
|
71
|
-
t.Fatal(out)
|
|
72
|
-
}
|
|
73
|
-
case "revoke":
|
|
74
|
-
out := rpc(t, cgi, "alice", "delegate.revoke", `{"delegation_id":"grant"}`)
|
|
75
|
-
if out["success"] != false {
|
|
76
|
-
t.Fatal("absent executor falsely acknowledged revocation", out)
|
|
77
|
-
}
|
|
78
|
-
case "parent-stop":
|
|
79
|
-
stop()
|
|
80
|
-
}
|
|
81
|
-
select {
|
|
82
|
-
case <-done:
|
|
83
|
-
case <-time.After(time.Second):
|
|
84
|
-
t.Fatal("waiting worker ignored cancellation")
|
|
85
|
-
}
|
|
86
|
-
if action == "parent-stop" {
|
|
87
|
-
assertJob(t, s, id, background.StateInterrupted, "worker-stopped")
|
|
88
|
-
} else {
|
|
89
|
-
assertJob(t, s, id, background.StateCanceled, "")
|
|
90
|
-
}
|
|
91
|
-
pending, e := s.Store.DelegationCleanup(context.Background())
|
|
92
|
-
if e != nil || len(pending) != 1 || pending[0].JobID != id {
|
|
93
|
-
t.Fatalf("cleanup not durable: %v %v", pending, e)
|
|
94
|
-
}
|
|
95
|
-
entries, e := os.ReadDir(s.StagingDir)
|
|
96
|
-
if e != nil || len(entries) != 0 {
|
|
97
|
-
t.Fatalf("cancellation leaked staging: %v %v", entries, e)
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
package delegate
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"bytes"
|
|
5
|
-
"context"
|
|
6
|
-
"dsmapp/internal/api"
|
|
7
|
-
"dsmapp/internal/background"
|
|
8
|
-
"encoding/json"
|
|
9
|
-
"errors"
|
|
10
|
-
"io"
|
|
11
|
-
"log"
|
|
12
|
-
"net"
|
|
13
|
-
"net/http"
|
|
14
|
-
"os"
|
|
15
|
-
"sync"
|
|
16
|
-
"time"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
const DownloadTimeout = 60 * time.Second
|
|
20
|
-
|
|
21
|
-
func downloadClient() *http.Client {
|
|
22
|
-
return &http.Client{Timeout: DownloadTimeout, Transport: &http.Transport{Proxy: nil, DisableKeepAlives: true, DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext, ResponseHeaderTimeout: 10 * time.Second, MaxResponseHeaderBytes: 32 << 10, DisableCompression: true}, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
|
|
23
|
-
}
|
|
24
|
-
func (s *Service) download(parent context.Context, in DownloadInput, job JobContext) error {
|
|
25
|
-
if !validDownload(in) {
|
|
26
|
-
return fail("invalid-request")
|
|
27
|
-
}
|
|
28
|
-
ctx, cancel := context.WithTimeout(parent, DownloadTimeout)
|
|
29
|
-
defer cancel()
|
|
30
|
-
request, e := http.NewRequestWithContext(ctx, "GET", in.URL, nil)
|
|
31
|
-
if e != nil {
|
|
32
|
-
return fail("invalid-request")
|
|
33
|
-
}
|
|
34
|
-
client := s.HTTP
|
|
35
|
-
if client == nil {
|
|
36
|
-
client = downloadClient()
|
|
37
|
-
}
|
|
38
|
-
response, e := client.Do(request)
|
|
39
|
-
if e != nil {
|
|
40
|
-
if ctx.Err() != nil {
|
|
41
|
-
return fail("timeout")
|
|
42
|
-
}
|
|
43
|
-
return fail("download_failed")
|
|
44
|
-
}
|
|
45
|
-
defer response.Body.Close()
|
|
46
|
-
if response.StatusCode != http.StatusOK {
|
|
47
|
-
return fail("download_failed")
|
|
48
|
-
}
|
|
49
|
-
if response.ContentLength > MaxDownloadBytes {
|
|
50
|
-
return fail("limit-exceeded")
|
|
51
|
-
}
|
|
52
|
-
if e = os.MkdirAll(job.StagingDir, 0700); e != nil {
|
|
53
|
-
return fail("STAGING_UNAVAILABLE")
|
|
54
|
-
}
|
|
55
|
-
info, e := os.Lstat(job.StagingDir)
|
|
56
|
-
if e != nil || !info.IsDir() || info.Mode().Perm()&0077 != 0 {
|
|
57
|
-
return fail("STAGING_UNAVAILABLE")
|
|
58
|
-
}
|
|
59
|
-
tmp, e := os.CreateTemp(job.StagingDir, "download-")
|
|
60
|
-
if e != nil {
|
|
61
|
-
return fail("STAGING_UNAVAILABLE")
|
|
62
|
-
}
|
|
63
|
-
defer os.Remove(tmp.Name())
|
|
64
|
-
defer tmp.Close()
|
|
65
|
-
n, e := io.Copy(tmp, io.LimitReader(contextReader{ctx, response.Body}, MaxDownloadBytes+1))
|
|
66
|
-
if e != nil {
|
|
67
|
-
return fail("download_failed")
|
|
68
|
-
}
|
|
69
|
-
if n > MaxDownloadBytes {
|
|
70
|
-
return fail("limit-exceeded")
|
|
71
|
-
}
|
|
72
|
-
if _, e = tmp.Seek(0, io.SeekStart); e != nil {
|
|
73
|
-
return fail("STAGING_UNAVAILABLE")
|
|
74
|
-
}
|
|
75
|
-
return job.Files().Write(parent, in.Dest, in.Name, tmp, n)
|
|
76
|
-
}
|
|
77
|
-
func (s *Service) Recover(ctx context.Context) error {
|
|
78
|
-
if e := s.Store.Recover(ctx); e != nil {
|
|
79
|
-
return e
|
|
80
|
-
}
|
|
81
|
-
return s.Sweep(ctx)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// RunOnce processes either the original SHA256 worker or the fixed delegated
|
|
85
|
-
// download worker. No registry or operation ID comes from HTTP input.
|
|
86
|
-
func (s *Service) RunOnce(parent context.Context) error {
|
|
87
|
-
job, e := s.Store.Claim(parent)
|
|
88
|
-
if e != nil || job == nil {
|
|
89
|
-
return e
|
|
90
|
-
}
|
|
91
|
-
ctx, cancel := context.WithCancel(parent)
|
|
92
|
-
if job.Worker != background.WorkerDownloadV1 {
|
|
93
|
-
cancel()
|
|
94
|
-
ctx, cancel = context.WithTimeout(parent, background.JobTimeout)
|
|
95
|
-
}
|
|
96
|
-
defer cancel()
|
|
97
|
-
watched := make(chan struct{})
|
|
98
|
-
go func() {
|
|
99
|
-
defer close(watched)
|
|
100
|
-
ticker := time.NewTicker(100 * time.Millisecond)
|
|
101
|
-
defer ticker.Stop()
|
|
102
|
-
for {
|
|
103
|
-
select {
|
|
104
|
-
case <-ctx.Done():
|
|
105
|
-
return
|
|
106
|
-
case <-ticker.C:
|
|
107
|
-
state, e := s.Store.Get(ctx, job.ID)
|
|
108
|
-
if e == nil && (state.CancelRequested || state.State != background.StateRunning) {
|
|
109
|
-
cancel()
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}()
|
|
115
|
-
outcome := background.Outcome{State: background.StateSucceeded}
|
|
116
|
-
input, e := s.Store.OpenInput(job.ID)
|
|
117
|
-
if e == nil {
|
|
118
|
-
switch job.Worker {
|
|
119
|
-
case background.WorkerDownloadV1:
|
|
120
|
-
var in DownloadInput
|
|
121
|
-
data, readErr := io.ReadAll(io.LimitReader(input, background.MaxInputBytes+1))
|
|
122
|
-
if readErr != nil || json.Unmarshal(data, &in) != nil {
|
|
123
|
-
e = fail("invalid-request")
|
|
124
|
-
} else {
|
|
125
|
-
// Verify immutable input before contacting any remote host or executor.
|
|
126
|
-
hash, e2 := background.SHA256V1(ctx, bytes.NewReader(data))
|
|
127
|
-
if e2 != nil || hash.SHA256 != job.InputDigest || hash.Bytes != job.InputBytes {
|
|
128
|
-
e = fail("input-changed")
|
|
129
|
-
} else {
|
|
130
|
-
binding, e2 := s.Store.Delegation(ctx, job.ID)
|
|
131
|
-
e = e2
|
|
132
|
-
if e == nil {
|
|
133
|
-
e = s.download(ctx, in, JobContext{Client: s.Client, JobID: job.ID, DelegationID: binding.DelegationID, StagingDir: s.StagingDir, callExecutor: func(ctx context.Context, op string, params map[string]any, out any) error {
|
|
134
|
-
return s.callWaitingExecutor(ctx, job.ID, binding.ExpiresAt, op, params, out)
|
|
135
|
-
}})
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
case background.WorkerSHA256V1:
|
|
140
|
-
result, e2 := background.SHA256V1(ctx, io.LimitReader(input, background.MaxInputBytes+1))
|
|
141
|
-
e = e2
|
|
142
|
-
if e == nil && (result.SHA256 != job.InputDigest || result.Bytes != job.InputBytes) {
|
|
143
|
-
e = fail("input-changed")
|
|
144
|
-
}
|
|
145
|
-
outcome.Result = &result
|
|
146
|
-
default:
|
|
147
|
-
e = fail("unsupported")
|
|
148
|
-
}
|
|
149
|
-
input.Close()
|
|
150
|
-
}
|
|
151
|
-
if e != nil {
|
|
152
|
-
outcome = background.Outcome{State: background.StateFailed, ErrorCode: "worker-error"}
|
|
153
|
-
outcome.ErrorCode = errorCode(e)
|
|
154
|
-
}
|
|
155
|
-
if parent.Err() != nil {
|
|
156
|
-
outcome = background.Outcome{State: background.StateInterrupted, ErrorCode: "worker-stopped"}
|
|
157
|
-
} else if ctx.Err() == context.DeadlineExceeded {
|
|
158
|
-
outcome = background.Outcome{State: background.StateFailed, ErrorCode: "timeout"}
|
|
159
|
-
}
|
|
160
|
-
cancel()
|
|
161
|
-
<-watched
|
|
162
|
-
finish, done := context.WithTimeout(context.Background(), 20*time.Second)
|
|
163
|
-
defer done()
|
|
164
|
-
if e = s.Store.Finish(finish, job.ID, outcome); e != nil {
|
|
165
|
-
return e
|
|
166
|
-
}
|
|
167
|
-
return s.Sweep(finish)
|
|
168
|
-
}
|
|
169
|
-
func (s *Service) Run(ctx context.Context, info background.WorkerInfo) error {
|
|
170
|
-
if e := background.RefuseRoot(info.UID); e != nil {
|
|
171
|
-
return e
|
|
172
|
-
}
|
|
173
|
-
if e := s.Store.Recover(ctx); e != nil {
|
|
174
|
-
return e
|
|
175
|
-
}
|
|
176
|
-
ctx, stop := context.WithCancel(ctx)
|
|
177
|
-
var heartbeat sync.WaitGroup
|
|
178
|
-
heartbeat.Add(1)
|
|
179
|
-
go func() {
|
|
180
|
-
defer heartbeat.Done()
|
|
181
|
-
beat := time.NewTicker(5 * time.Second)
|
|
182
|
-
defer beat.Stop()
|
|
183
|
-
for {
|
|
184
|
-
select {
|
|
185
|
-
case <-ctx.Done():
|
|
186
|
-
return
|
|
187
|
-
case <-beat.C:
|
|
188
|
-
if e := s.Store.Heartbeat(ctx, info); e != nil && ctx.Err() == nil {
|
|
189
|
-
log.Print("worker heartbeat unavailable")
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}()
|
|
194
|
-
defer func() { stop(); heartbeat.Wait() }()
|
|
195
|
-
ticker := time.NewTicker(500 * time.Millisecond)
|
|
196
|
-
defer ticker.Stop()
|
|
197
|
-
for ctx.Err() == nil {
|
|
198
|
-
if e := s.Store.Heartbeat(ctx, info); e != nil {
|
|
199
|
-
return e
|
|
200
|
-
}
|
|
201
|
-
if e := s.Sweep(ctx); e != nil {
|
|
202
|
-
log.Printf("delegation cleanup pending: %s", errorCode(e))
|
|
203
|
-
}
|
|
204
|
-
if e := s.Store.Tick(ctx); e != nil {
|
|
205
|
-
log.Print("schedule tick unavailable")
|
|
206
|
-
}
|
|
207
|
-
if e := s.RunOnce(ctx); e != nil && ctx.Err() == nil {
|
|
208
|
-
log.Printf("worker operation: %s", errorCode(e))
|
|
209
|
-
}
|
|
210
|
-
select {
|
|
211
|
-
case <-ctx.Done():
|
|
212
|
-
return nil
|
|
213
|
-
case <-ticker.C:
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return nil
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
func errorCode(e error) string {
|
|
220
|
-
var a *api.Error
|
|
221
|
-
if errors.As(e, &a) {
|
|
222
|
-
return a.Code
|
|
223
|
-
}
|
|
224
|
-
return "unavailable"
|
|
225
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
package filestation
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"dsmapp/internal/api"
|
|
6
|
-
"io"
|
|
7
|
-
"net/http"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
// Files is the operation set shared by live requests and delegated jobs.
|
|
11
|
-
// Construct a RequestContext at the authenticated CGI boundary; never persist it.
|
|
12
|
-
type Files interface {
|
|
13
|
-
List(context.Context, string, ListOptions) (Page, error)
|
|
14
|
-
Info(context.Context, string) (Entry, error)
|
|
15
|
-
CreateFolder(context.Context, string, string) error
|
|
16
|
-
CheckPermission(context.Context, string) error
|
|
17
|
-
Write(context.Context, string, string, io.Reader, int64) error
|
|
18
|
-
}
|
|
19
|
-
type RequestContext struct {
|
|
20
|
-
Caller api.Caller
|
|
21
|
-
Request *http.Request
|
|
22
|
-
Service *Service
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
func (r RequestContext) Files() Files { return sessionFiles{r} }
|
|
26
|
-
|
|
27
|
-
type sessionFiles struct{ RequestContext }
|
|
28
|
-
|
|
29
|
-
func (s sessionFiles) List(ctx context.Context, p string, o ListOptions) (Page, error) {
|
|
30
|
-
return s.Service.List(ctx, s.Caller, s.Request, p, o)
|
|
31
|
-
}
|
|
32
|
-
func (s sessionFiles) Info(ctx context.Context, p string) (Entry, error) {
|
|
33
|
-
return s.Service.Info(ctx, s.Caller, s.Request, p)
|
|
34
|
-
}
|
|
35
|
-
func (s sessionFiles) CreateFolder(ctx context.Context, p, n string) error {
|
|
36
|
-
return s.Service.CreateFolder(ctx, s.Caller, s.Request, p, n)
|
|
37
|
-
}
|
|
38
|
-
func (s sessionFiles) Write(ctx context.Context, p, n string, r io.Reader, size int64) error {
|
|
39
|
-
return s.Service.Upload(ctx, s.Caller, s.Request, p, n, r, size)
|
|
40
|
-
}
|
|
41
|
-
func (s sessionFiles) CheckPermission(ctx context.Context, p string) error {
|
|
42
|
-
return s.Service.CheckPermission(ctx, s.Caller, s.Request, p)
|
|
43
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
package filestation
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"dsmapp/internal/api"
|
|
6
|
-
"fmt"
|
|
7
|
-
"net/http"
|
|
8
|
-
"testing"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
func TestRequestFilesCheckUsesCurrentSessionAndRefusesMismatchedSubject(t *testing.T) {
|
|
12
|
-
checks := 0
|
|
13
|
-
client := fakeClient(t, func(w http.ResponseWriter, r *http.Request) {
|
|
14
|
-
r.ParseForm()
|
|
15
|
-
if r.Header.Get("Cookie") != "id=test-session" {
|
|
16
|
-
t.Error("cookie changed")
|
|
17
|
-
}
|
|
18
|
-
if r.Form.Get("api") == "SYNO.Core.NormalUser" {
|
|
19
|
-
fmt.Fprint(w, `{"success":true,"data":{"username":"alice"}}`)
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
checks++
|
|
23
|
-
if r.Form.Get("api") != "SYNO.FileStation.CheckPermission" || r.Form.Get("method") != "write" || r.Form.Get("path") != "/home" {
|
|
24
|
-
t.Error(r.Form)
|
|
25
|
-
}
|
|
26
|
-
fmt.Fprint(w, `{"success":false,"error":{"code":407}}`)
|
|
27
|
-
})
|
|
28
|
-
files := RequestContext{Service: NewService(client), Request: sessionRequest(), Caller: callerFor(t, "alice")}.Files()
|
|
29
|
-
if e := files.CheckPermission(context.Background(), "/home"); e == nil {
|
|
30
|
-
t.Fatal("DSM refusal lost")
|
|
31
|
-
}
|
|
32
|
-
files = RequestContext{Service: NewService(client), Request: sessionRequest(), Caller: callerFor(t, "bob")}.Files()
|
|
33
|
-
if e := files.CheckPermission(context.Background(), "/home"); e == nil {
|
|
34
|
-
t.Fatal("mismatched subject accepted")
|
|
35
|
-
}
|
|
36
|
-
if checks != 1 {
|
|
37
|
-
t.Fatal("mismatched request reached DSM file operation")
|
|
38
|
-
}
|
|
39
|
-
var _ Files = RequestContext{Caller: api.Caller{}}.Files()
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
func TestCheckPermissionRequiresExplicitNonSkipResult(t *testing.T) {
|
|
43
|
-
for _, data := range []string{`{}`, `{"blSkip":true}`} {
|
|
44
|
-
client := fakeClient(t, func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, `{"success":true,"data":%s}`, data) })
|
|
45
|
-
if e := client.CheckPermission(context.Background(), sessionRequest(), "/home"); e == nil {
|
|
46
|
-
t.Fatal("permission inferred from success:true")
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
client := fakeClient(t, func(w http.ResponseWriter, r *http.Request) {
|
|
50
|
-
r.ParseForm()
|
|
51
|
-
if r.Form.Get("filename") != ".synopkgland-permission-probe" || r.Form.Get("overwrite") != "false" || r.Form.Get("size") != "0" {
|
|
52
|
-
t.Error("missing fixed permission probe fields")
|
|
53
|
-
}
|
|
54
|
-
fmt.Fprint(w, `{"success":true,"data":{"blSkip":false}}`)
|
|
55
|
-
})
|
|
56
|
-
if e := client.CheckPermission(context.Background(), sessionRequest(), "/home"); e != nil {
|
|
57
|
-
t.Fatal(e)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {computed,onBeforeUnmount,onMounted,ref} from 'vue'
|
|
3
|
-
import {Button,Callout} from '@synopackageland/ui'
|
|
4
|
-
import type {Context} from './context'
|
|
5
|
-
import ExecutorSettings from './delegate/ExecutorSettings.vue'
|
|
6
|
-
import DelegatePanel from './delegate/DelegatePanel.vue'
|
|
7
|
-
import BackgroundSavePanel from './delegate/BackgroundSavePanel.vue'
|
|
8
|
-
import {createBackgroundSaveFacade} from './delegate/facade'
|
|
9
|
-
import {createBackgroundPickerProvider} from './background/picker-provider'
|
|
10
|
-
import {saveCopy} from './delegate/save-copy'
|
|
11
|
-
const props=defineProps<{ctx:Context;admin:boolean}>()
|
|
12
|
-
const mode=ref<'loading'|'long'|'legacy'|'unavailable'>(props.ctx.delegate?'long':'loading')
|
|
13
|
-
const keys=ref<string[]>([]),copy=computed(()=>saveCopy(props.ctx.locale))
|
|
14
|
-
const revision=ref(0)
|
|
15
|
-
const sdk=props.ctx.delegate??createBackgroundSaveFacade(props.ctx),provider=createBackgroundPickerProvider(props.ctx)
|
|
16
|
-
let disposed=false
|
|
17
|
-
async function detect(){
|
|
18
|
-
mode.value='loading'
|
|
19
|
-
try{
|
|
20
|
-
const out=await props.ctx.call<{lifetime?:string;destinations?:string[]}>('delegate.status')
|
|
21
|
-
if(disposed)return
|
|
22
|
-
if(out.lifetime==='until-revoked'){
|
|
23
|
-
if(!Array.isArray(out.destinations)||!out.destinations.length||out.destinations.some(key=>typeof key!=='string'||!key))throw {code:'EXECUTOR_PROTOCOL'}
|
|
24
|
-
keys.value=out.destinations;mode.value='long'
|
|
25
|
-
}else mode.value='legacy'
|
|
26
|
-
}catch{if(!disposed)mode.value='unavailable'}
|
|
27
|
-
}
|
|
28
|
-
onMounted(()=>{if(!props.ctx.delegate)void detect()})
|
|
29
|
-
onBeforeUnmount(()=>{disposed=true;provider.dispose()})
|
|
30
|
-
</script>
|
|
31
|
-
<template>
|
|
32
|
-
<ExecutorSettings :admin="admin" :locale="ctx.locale" :ctx="ctx" @confirmed="revision++;detect()" />
|
|
33
|
-
<BackgroundSavePanel v-if="mode==='long'" :key="revision" :sdk="sdk" :admin="admin" :locale="ctx.locale" :picker="{provider,keys}" />
|
|
34
|
-
<DelegatePanel v-else-if="mode==='legacy'" :ctx="ctx" />
|
|
35
|
-
<p v-else-if="mode==='loading'" role="status">{{ copy.loading }}</p>
|
|
36
|
-
<Callout v-else tone="danger" role="alert">{{ copy.error }} <Button variant="secondary" @click="detect">{{ copy.refresh }}</Button></Callout>
|
|
37
|
-
</template>
|