@synopackageland/cli 0.4.0 → 0.5.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/LICENSE +21 -0
- package/README.md +42 -1
- package/dist/build-spk/delete-app-data.d.ts +27 -7
- package/dist/build-spk/delete-app-data.js +35 -34
- package/dist/build-spk/dsm-arch.d.ts +6 -1
- package/dist/build-spk/dsm-arch.js +25 -1
- package/dist/build-spk/dsm-version.d.ts +14 -0
- package/dist/build-spk/dsm-version.js +47 -0
- package/dist/build-spk/gateway.d.ts +31 -0
- package/dist/build-spk/gateway.js +55 -0
- package/dist/build-spk/generator.d.ts +5 -0
- package/dist/build-spk/generator.js +106 -107
- package/dist/build-spk/install-wizard.d.ts +20 -0
- package/dist/build-spk/install-wizard.js +76 -0
- package/dist/build-spk/native-lifecycle.d.ts +5 -0
- package/dist/build-spk/native-lifecycle.js +12 -2
- package/dist/build-spk/notices.d.ts +5 -0
- package/dist/build-spk/notices.js +60 -0
- package/dist/build-spk/resource-worker.d.ts +9 -4
- package/dist/build-spk/resource-worker.js +15 -6
- package/dist/build-spk/share-combobox.d.ts +3 -0
- package/dist/build-spk/share-combobox.js +27 -0
- package/dist/build-spk/uninstall-wizard.d.ts +14 -0
- package/dist/build-spk/uninstall-wizard.js +33 -0
- package/dist/build-spk/wizard-i18n.d.ts +18 -0
- package/dist/build-spk/wizard-i18n.js +38 -0
- package/dist/build-spk/wizard-messages.d.ts +388 -0
- package/dist/build-spk/wizard-messages.js +387 -0
- package/dist/cli.js +136 -29
- package/dist/compose/analyze.d.ts +20 -0
- package/dist/compose/analyze.js +75 -11
- package/dist/contract/validate.js +33 -1
- package/dist/contract/web-launch.d.ts +22 -0
- package/dist/contract/web-launch.js +37 -0
- package/dist/deploy/deploy.d.ts +3 -0
- package/dist/deploy/deploy.js +11 -2
- package/dist/error-registry.js +80 -1
- package/dist/host/open-url.d.ts +2 -0
- package/dist/host/open-url.js +4 -1
- package/dist/images/pin.d.ts +52 -0
- package/dist/images/pin.js +249 -0
- package/dist/init.d.ts +29 -1
- package/dist/init.js +122 -25
- package/dist/inspect.d.ts +3 -0
- package/dist/inspect.js +15 -3
- package/dist/standalone/background.d.ts +21 -0
- package/dist/standalone/background.js +52 -0
- package/dist/standalone/binary.d.ts +1 -0
- package/dist/standalone/binary.js +1 -1
- package/dist/standalone/build.d.ts +2 -0
- package/dist/standalone/build.js +40 -6
- package/dist/standalone/daemon.d.ts +23 -0
- package/dist/standalone/daemon.js +114 -0
- package/dist/standalone/dsm-window.d.ts +1 -1
- package/dist/standalone/dsm-window.js +52 -12
- package/dist/standalone/helper-inventory.d.ts +31 -0
- package/dist/standalone/helper-inventory.js +11 -0
- package/dist/standalone/helper.d.ts +3 -12
- package/dist/standalone/helper.js +31 -12
- package/dist/standalone/host-adapter.d.ts +5 -0
- package/dist/standalone/host-adapter.js +166 -0
- package/dist/standalone/host-file-navigation.d.ts +7 -0
- package/dist/standalone/host-file-navigation.js +172 -0
- package/dist/standalone/host-platform.d.ts +13 -0
- package/dist/standalone/host-platform.js +42 -0
- package/dist/standalone/host-types.d.ts +49 -0
- package/dist/standalone/host-types.js +1 -0
- package/dist/standalone/inspect-helper.d.ts +6 -0
- package/dist/standalone/inspect-helper.js +93 -0
- package/dist/standalone/inspect-spk.d.ts +3 -1
- package/dist/standalone/inspect-spk.js +247 -5
- package/dist/standalone/job-diagnostics.d.ts +1 -0
- package/dist/standalone/job-diagnostics.js +49 -0
- package/dist/standalone/lifecycle-helper.d.ts +2 -0
- package/dist/standalone/lifecycle-helper.js +12 -0
- package/dist/standalone/lifecycle.d.ts +3 -0
- package/dist/standalone/lifecycle.js +63 -0
- package/dist/standalone/manifest.d.ts +17 -2
- package/dist/standalone/manifest.js +40 -6
- package/dist/standalone/native-layout.d.ts +74 -0
- package/dist/standalone/native-layout.js +318 -0
- package/dist/standalone/reopen-events.d.ts +2 -0
- package/dist/standalone/reopen-events.js +28 -0
- package/dist/standalone/resource.d.ts +11 -0
- package/dist/standalone/resource.js +13 -0
- package/dist/standalone/root-messages.js +9 -0
- package/dist/standalone/root-window.d.ts +6 -3
- package/dist/standalone/root-window.js +160 -30
- package/dist/standalone/shared-folder.d.ts +39 -0
- package/dist/standalone/shared-folder.js +141 -0
- package/dist/standalone/spk.d.ts +6 -3
- package/dist/standalone/spk.js +52 -35
- package/dist/standalone/worker-contract-json.d.ts +8 -0
- package/dist/standalone/worker-contract-json.js +141 -0
- package/dist/standalone/worker-contract.d.ts +189 -0
- package/dist/standalone/worker-contract.js +175 -0
- package/dist/standalone/worker-registry.d.ts +40 -0
- package/dist/standalone/worker-registry.js +167 -0
- package/dist/template-paths.d.ts +2 -0
- package/dist/template-paths.js +9 -0
- package/dist/templates/_daemon/fixture_linux_test.go +15 -0
- package/dist/templates/_daemon/fixture_other_test.go +7 -0
- package/dist/templates/_daemon/go.mod +5 -0
- package/dist/templates/_daemon/main.go +608 -0
- package/dist/templates/_daemon/main_test.go +242 -0
- package/dist/templates/_daemon/process_linux.go +55 -0
- package/dist/templates/_daemon/process_linux_test.go +161 -0
- package/dist/templates/_daemon/process_other.go +14 -0
- package/dist/templates/_daemon/testdata/child.go +41 -0
- package/dist/templates/_gateway/auth.go +101 -0
- package/dist/templates/_gateway/auth_test.go +216 -0
- package/dist/templates/_gateway/cgi.go +133 -0
- package/dist/templates/_gateway/cgi_test.go +156 -0
- package/dist/templates/_gateway/csrf.go +73 -0
- package/dist/templates/_gateway/csrf_test.go +155 -0
- package/dist/templates/_gateway/directory.go +108 -0
- package/dist/templates/_gateway/directory_test.go +202 -0
- package/dist/templates/_gateway/gateway.go +412 -0
- package/dist/templates/_gateway/gateway_test.go +676 -0
- package/dist/templates/_gateway/go.mod +3 -0
- package/dist/templates/_gateway/groups.go +66 -0
- package/dist/templates/_gateway/main.go +45 -0
- package/dist/templates/_shared/GO-LICENSE +27 -0
- package/dist/templates/_shared/GO-PATENTS +22 -0
- package/dist/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/dist/templates/_shared/notice-overrides/index.json +14 -0
- package/dist/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/dist/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/dist/templates/_shared/third-party-notices.mjs +51 -0
- package/dist/templates/binary/synology-app.yaml +1 -1
- package/dist/templates/compose-import/compose.yaml +1 -1
- package/dist/templates/compose-import/synology-app.yaml +1 -1
- package/dist/templates/hello-files/compose.yaml +1 -1
- package/dist/templates/hello-files/synology-app.yaml +1 -1
- package/dist/templates/hello-web/compose.yaml +5 -2
- package/dist/templates/hello-web/synology-app.yaml +4 -1
- package/dist/templates/hello-web-page/compose.yaml +5 -2
- package/dist/templates/hello-web-page/synology-app.yaml +4 -1
- package/dist/templates/native-go/README.md +149 -4
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +61 -0
- package/dist/templates/native-go/backend/cmd/app/main.go +17 -0
- package/dist/templates/native-go/backend/cmd/app/sdk_main.go +60 -0
- package/dist/templates/native-go/backend/cmd/background-worker/main.go +38 -0
- package/dist/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/dist/templates/native-go/backend/cmd/helper/main.go +10 -1
- package/dist/templates/native-go/backend/cmd/helper/sdk_registry.go +19 -0
- package/dist/templates/native-go/backend/go.mod +7 -1
- package/dist/templates/native-go/backend/go.sum +4 -0
- package/dist/templates/native-go/backend/internal/api/binary.go +154 -0
- package/dist/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/dist/templates/native-go/backend/internal/api/registry.go +28 -7
- package/dist/templates/native-go/backend/internal/api/server.go +11 -1
- package/dist/templates/native-go/backend/internal/app/background.go +270 -0
- package/dist/templates/native-go/backend/internal/app/background_none.go +8 -0
- package/dist/templates/native-go/backend/internal/app/background_owner.go +59 -0
- package/dist/templates/native-go/backend/internal/app/background_owner_test.go +145 -0
- package/dist/templates/native-go/backend/internal/app/background_schedule.go +74 -0
- package/dist/templates/native-go/backend/internal/app/background_schedule_test.go +62 -0
- package/dist/templates/native-go/backend/internal/app/background_test.go +346 -0
- package/dist/templates/native-go/backend/internal/app/integration_state.go +16 -0
- package/dist/templates/native-go/backend/internal/app/migrations.go +41 -0
- package/dist/templates/native-go/backend/internal/app/migrations_test.go +41 -0
- package/dist/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +129 -0
- package/dist/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/dist/templates/native-go/backend/internal/app/routes.go +28 -3
- package/dist/templates/native-go/backend/internal/app/routes_test.go +27 -5
- package/dist/templates/native-go/backend/internal/app/sdk_jobs.go +70 -0
- package/dist/templates/native-go/backend/internal/app/sdk_jobs_test.go +116 -0
- package/dist/templates/native-go/backend/internal/app/sdk_routes.go +174 -0
- package/dist/templates/native-go/backend/internal/app/session_files.go +15 -0
- package/dist/templates/native-go/backend/internal/app/session_files_test.go +26 -0
- package/dist/templates/native-go/backend/internal/app/shared_folder.go +144 -0
- package/dist/templates/native-go/backend/internal/app/shared_folder_test.go +158 -0
- package/dist/templates/native-go/backend/internal/background/access.go +57 -0
- package/dist/templates/native-go/backend/internal/background/owner_test.go +126 -0
- package/dist/templates/native-go/backend/internal/background/runner.go +185 -0
- package/dist/templates/native-go/backend/internal/background/runner_test.go +209 -0
- package/dist/templates/native-go/backend/internal/background/schedule.go +300 -0
- package/dist/templates/native-go/backend/internal/background/schedule_test.go +335 -0
- package/dist/templates/native-go/backend/internal/background/store.go +807 -0
- package/dist/templates/native-go/backend/internal/background/store_test.go +407 -0
- package/dist/templates/native-go/backend/internal/datamigrate/migrate.go +191 -0
- package/dist/templates/native-go/backend/internal/datamigrate/migrate_test.go +177 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/dist/templates/native-go/backend/internal/filestation/browse_test.go +67 -0
- package/dist/templates/native-go/backend/internal/filestation/client.go +251 -0
- package/dist/templates/native-go/backend/internal/filestation/client_test.go +155 -0
- package/dist/templates/native-go/backend/internal/filestation/doc.go +4 -0
- package/dist/templates/native-go/backend/internal/filestation/read_file_test.go +90 -0
- package/dist/templates/native-go/backend/internal/filestation/repository.go +207 -0
- package/dist/templates/native-go/backend/internal/filestation/repository_test.go +104 -0
- package/dist/templates/native-go/backend/internal/filestation/sdk_session.go +241 -0
- package/dist/templates/native-go/backend/internal/filestation/sdk_session_test.go +183 -0
- package/dist/templates/native-go/backend/internal/filestation/service.go +254 -0
- package/dist/templates/native-go/backend/internal/filestation/service_test.go +94 -0
- package/dist/templates/native-go/backend/internal/filestation/session_semantics_test.go +383 -0
- package/dist/templates/native-go/backend/internal/filestation/write.go +72 -0
- package/dist/templates/native-go/backend/internal/filestation/write_test.go +123 -0
- package/dist/templates/native-go/backend/internal/helper/background_proof.go +163 -0
- package/dist/templates/native-go/backend/internal/helper/background_proof_contract.go +46 -0
- package/dist/templates/native-go/backend/internal/helper/background_proof_test.go +161 -0
- package/dist/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/control.go +226 -21
- package/dist/templates/native-go/backend/internal/helper/control_test.go +10 -2
- package/dist/templates/native-go/backend/internal/helper/data_contract.go +245 -0
- package/dist/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol.go +419 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority.go +519 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/dist/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/dist/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux.go +416 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +469 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/grant_snapshot.go +78 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/bindings.go +48 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/contract_test.go +436 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/decode.go +185 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/digest.go +55 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/registry.go +85 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/registry_test.go +73 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/result.go +53 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/stub.go +8 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/testdata/input-digests.json +127 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/types.go +234 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/types_test.go +29 -0
- package/dist/templates/native-go/backend/internal/helper/jobcontract/validate.go +462 -0
- package/dist/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/dist/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/dist/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/dist/templates/native-go/backend/internal/helper/legacy_authority_schema_linux_test.go +34 -0
- package/dist/templates/native-go/backend/internal/helper/legacy_authority_schema_test.go +6 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/dist/templates/native-go/backend/internal/helper/management.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/dist/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/dist/templates/native-go/backend/internal/helper/observation.go +244 -0
- package/dist/templates/native-go/backend/internal/helper/observation_health_test.go +127 -0
- package/dist/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/dist/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic.go +155 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +130 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_writer.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/dist/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/dist/templates/native-go/backend/internal/helper/process_linux.go +14 -1
- package/dist/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/query_deadline_linux_test.go +115 -0
- package/dist/templates/native-go/backend/internal/helper/query_pending_diagnostic_test.go +254 -0
- package/dist/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/dist/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_invalidation.go +203 -0
- package/dist/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/dist/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +250 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_assembly_linux.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_attach.go +83 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_attach_contract.go +32 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_attach_test.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_authority_schema_test.go +6 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_authority.go +832 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_authority_test.go +714 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_invalidation.go +218 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_lease.go +218 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_snapshot.go +110 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_store_linux_test.go +261 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_background_store_test.go +58 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_bindings.go +60 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_data_contract.go +251 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_data_protocol.go +424 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_dispatch_absence_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_display.go +488 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_display_contract.go +121 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_display_test.go +459 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_grant_authority.go +559 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_grant_repository_linux.go +417 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_grant_snapshot.go +94 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_history.go +80 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_history_test.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job.go +697 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_child_linux.go +309 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_contract.go +122 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_linux_test.go +159 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_process_linux.go +327 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_test.go +501 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_job_vm_linux_test.go +343 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_journal.go +77 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_journal_linux.go +244 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_journal_linux_test.go +295 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_journal_test.go +71 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_picker_test.go +50 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_process_linux.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_public_vm_linux_test.go +129 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_relaxed_invalidation.go +242 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_rpc.go +299 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_rpc_contract.go +70 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_rpc_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_server_linux.go +152 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_session.go +677 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_session_contract.go +72 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_session_fence_test.go +215 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_session_test.go +475 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_supervisor_frame.go +78 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_supervisor_linux.go +414 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_transport.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_transport_linux.go +82 -0
- package/dist/templates/native-go/backend/internal/helper/sdk_transport_test.go +64 -0
- package/dist/templates/native-go/backend/internal/helper/server_linux.go +47 -3
- package/dist/templates/native-go/backend/internal/helper/stale_management_linux_test.go +126 -0
- package/dist/templates/native-go/backend/internal/helper/stale_management_test.go +122 -0
- package/dist/templates/native-go/backend/internal/helper/startup_diagnostic.go +68 -0
- package/dist/templates/native-go/backend/internal/helper/startup_diagnostic_linux_test.go +126 -0
- package/dist/templates/native-go/backend/internal/helper/startup_diagnostic_test.go +117 -0
- package/dist/templates/native-go/backend/internal/helper/status.go +83 -11
- package/dist/templates/native-go/backend/internal/helper/status_test.go +128 -0
- package/dist/templates/native-go/backend/internal/helper/supervision.go +28 -5
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux.go +191 -16
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux_test.go +618 -7
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_test.go +151 -0
- package/dist/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux.go +368 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/dist/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/dist/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/unit_query_linux.go +115 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/dist/templates/native-go/backend/internal/helper/write.go +77 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux.go +205 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux_test.go +225 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/dist/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/dist/templates/native-go/dsm-package.yaml +1 -1
- package/dist/templates/native-go/ui/app.js +8 -1
- package/dist/templates/native-go-background/BACKGROUND.md +111 -0
- package/dist/templates/native-go-background/backend/internal/app/background_on.go +7 -0
- package/dist/templates/native-go-background/backend/internal/app/background_routes_test.go +32 -0
- package/dist/templates/native-go-background/frontend/src/background/BackgroundPanel.vue +178 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/de.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/en.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/es.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/fr.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/it.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/ja.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/ko.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/zh-CN.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n/zh-TW.json +83 -0
- package/dist/templates/native-go-background/frontend/src/background/i18n.ts +19 -0
- package/dist/templates/native-go-background/frontend/src/background/picker-provider.ts +13 -0
- package/dist/templates/native-go-background/frontend/test/background.test.ts +179 -0
- package/dist/templates/native-go-better-auth/node/build.mjs +2 -0
- package/dist/templates/native-go-integration/backend/internal/app/personal.go +2 -2
- package/dist/templates/native-go-integration/backend/internal/app/personal_test.go +37 -0
- package/dist/templates/native-go-vue/README.md +151 -6
- package/dist/templates/native-go-vue/frontend/DESIGN.md +16 -4
- package/dist/templates/native-go-vue/frontend/README-JOBS.md +75 -0
- package/dist/templates/native-go-vue/frontend/README-M2.md +64 -0
- package/dist/templates/native-go-vue/frontend/package-lock.json +137 -233
- package/dist/templates/native-go-vue/frontend/package.json +2 -2
- package/dist/templates/native-go-vue/frontend/src/App.vue +71 -16
- package/dist/templates/native-go-vue/frontend/src/M2App.vue +57 -0
- package/dist/templates/native-go-vue/frontend/src/SDKApp.vue +203 -0
- package/dist/templates/native-go-vue/frontend/src/context.ts +41 -2
- package/dist/templates/native-go-vue/frontend/src/jobs/InteractiveJobForm.vue +70 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/JobsAdminPanel.vue +33 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/JobsPanel.vue +135 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/connected-provider.ts +179 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/de.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/en.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/es.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/fr.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/it.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/ja.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/ko.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/zh-CN.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n/zh-TW.json +62 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/i18n.ts +15 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/mock-provider.ts +67 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/provider.ts +60 -0
- package/dist/templates/native-go-vue/frontend/src/jobs/validate.ts +44 -0
- package/dist/templates/native-go-vue/frontend/src/m2-main.ts +21 -0
- package/dist/templates/native-go-vue/frontend/src/m2-style.css +7 -0
- package/dist/templates/native-go-vue/frontend/src/main.ts +4 -1
- package/dist/templates/native-go-vue/frontend/src/nas/M2Files.vue +94 -0
- package/dist/templates/native-go-vue/frontend/src/nas/M2PathPicker.vue +70 -0
- package/dist/templates/native-go-vue/frontend/src/nas/M2Settings.vue +69 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/de.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/en.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/es.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/fr.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/it.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/ja.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/ko.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/zh-CN.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/m2/zh-TW.json +56 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/dist/templates/native-go-vue/frontend/src/nas/m2-contract.ts +33 -0
- package/dist/templates/native-go-vue/frontend/src/nas/m2-i18n.ts +24 -0
- package/dist/templates/native-go-vue/frontend/src/nas/m2-provider.ts +104 -0
- package/dist/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/dist/templates/native-go-vue/frontend/src/nas/use-m2-request.ts +18 -0
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/dist/templates/native-go-vue/frontend/src/sdk-main.ts +39 -0
- package/dist/templates/native-go-vue/frontend/src/shell/AppShell.vue +48 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/de.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/en.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/es.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/fr.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/it.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ja.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ko.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +10 -0
- package/dist/templates/native-go-vue/frontend/src/shell/i18n.ts +17 -0
- package/dist/templates/native-go-vue/frontend/src/shell/pages.ts +34 -0
- package/dist/templates/native-go-vue/frontend/src/style.css +19 -6
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +65 -2
- package/dist/templates/native-go-vue/frontend/test/jobs-connected.test.ts +163 -0
- package/dist/templates/native-go-vue/frontend/test/jobs-preview.html +22 -0
- package/dist/templates/native-go-vue/frontend/test/jobs.test.ts +176 -0
- package/dist/templates/native-go-vue/frontend/test/m2-preview.html +27 -0
- package/dist/templates/native-go-vue/frontend/test/m2-provider.test.ts +87 -0
- package/dist/templates/native-go-vue/frontend/test/m2-ui.test.ts +209 -0
- package/dist/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/dist/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/dist/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/dist/templates/native-go-vue/frontend/test/native-controls.test.ts +27 -0
- package/dist/templates/native-go-vue/frontend/test/picker-wire.test.ts +110 -0
- package/dist/templates/native-go-vue/frontend/test/shell-preview.html +19 -0
- package/dist/templates/native-go-vue/frontend/test/shell-sdk.test.ts +73 -0
- package/dist/templates/native-go-vue/frontend/test/shell-ui.test.ts +114 -0
- package/dist/templates/native-go-vue/frontend/test/shell.test.ts +45 -0
- package/dist/templates/native-go-vue/frontend/tsconfig.json +1 -1
- package/dist/templates/native-go-vue/frontend/vite.config.ts +8 -6
- package/dist/validate.js +6 -3
- package/package.json +3 -2
- package/schema/synology-app.schema.json +19 -0
- package/skills/reference/create.md +4 -0
- package/templates/_daemon/fixture_linux_test.go +15 -0
- package/templates/_daemon/fixture_other_test.go +7 -0
- package/templates/_daemon/go.mod +5 -0
- package/templates/_daemon/main.go +608 -0
- package/templates/_daemon/main_test.go +242 -0
- package/templates/_daemon/process_linux.go +55 -0
- package/templates/_daemon/process_linux_test.go +161 -0
- package/templates/_daemon/process_other.go +14 -0
- package/templates/_daemon/testdata/child.go +41 -0
- package/templates/_gateway/auth.go +101 -0
- package/templates/_gateway/auth_test.go +216 -0
- package/templates/_gateway/cgi.go +133 -0
- package/templates/_gateway/cgi_test.go +156 -0
- package/templates/_gateway/csrf.go +73 -0
- package/templates/_gateway/csrf_test.go +155 -0
- package/templates/_gateway/directory.go +108 -0
- package/templates/_gateway/directory_test.go +202 -0
- package/templates/_gateway/gateway.go +412 -0
- package/templates/_gateway/gateway_test.go +676 -0
- package/templates/_gateway/go.mod +3 -0
- package/templates/_gateway/groups.go +66 -0
- package/templates/_gateway/main.go +45 -0
- package/templates/_shared/GO-LICENSE +27 -0
- package/templates/_shared/GO-PATENTS +22 -0
- package/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/templates/_shared/notice-overrides/index.json +14 -0
- package/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/templates/_shared/third-party-notices.mjs +51 -0
- package/templates/binary/synology-app.yaml +1 -1
- package/templates/compose-import/compose.yaml +1 -1
- package/templates/compose-import/synology-app.yaml +1 -1
- package/templates/hello-files/compose.yaml +1 -1
- package/templates/hello-files/synology-app.yaml +1 -1
- package/templates/hello-web/compose.yaml +5 -2
- package/templates/hello-web/synology-app.yaml +4 -1
- package/templates/hello-web-page/compose.yaml +5 -2
- package/templates/hello-web-page/synology-app.yaml +4 -1
- package/templates/native-go/README.md +149 -4
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +61 -0
- package/templates/native-go/backend/cmd/app/main.go +17 -0
- package/templates/native-go/backend/cmd/app/sdk_main.go +60 -0
- package/templates/native-go/backend/cmd/background-worker/main.go +38 -0
- package/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/templates/native-go/backend/cmd/helper/main.go +10 -1
- package/templates/native-go/backend/cmd/helper/sdk_registry.go +19 -0
- package/templates/native-go/backend/go.mod +7 -1
- package/templates/native-go/backend/go.sum +4 -0
- package/templates/native-go/backend/internal/api/binary.go +154 -0
- package/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/templates/native-go/backend/internal/api/registry.go +28 -7
- package/templates/native-go/backend/internal/api/server.go +11 -1
- package/templates/native-go/backend/internal/app/background.go +270 -0
- package/templates/native-go/backend/internal/app/background_none.go +8 -0
- package/templates/native-go/backend/internal/app/background_owner.go +59 -0
- package/templates/native-go/backend/internal/app/background_owner_test.go +145 -0
- package/templates/native-go/backend/internal/app/background_schedule.go +74 -0
- package/templates/native-go/backend/internal/app/background_schedule_test.go +62 -0
- package/templates/native-go/backend/internal/app/background_test.go +346 -0
- package/templates/native-go/backend/internal/app/integration_state.go +16 -0
- package/templates/native-go/backend/internal/app/migrations.go +41 -0
- package/templates/native-go/backend/internal/app/migrations_test.go +41 -0
- package/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +129 -0
- package/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/templates/native-go/backend/internal/app/routes.go +28 -3
- package/templates/native-go/backend/internal/app/routes_test.go +27 -5
- package/templates/native-go/backend/internal/app/sdk_jobs.go +70 -0
- package/templates/native-go/backend/internal/app/sdk_jobs_test.go +116 -0
- package/templates/native-go/backend/internal/app/sdk_routes.go +174 -0
- package/templates/native-go/backend/internal/app/session_files.go +15 -0
- package/templates/native-go/backend/internal/app/session_files_test.go +26 -0
- package/templates/native-go/backend/internal/app/shared_folder.go +144 -0
- package/templates/native-go/backend/internal/app/shared_folder_test.go +158 -0
- package/templates/native-go/backend/internal/background/access.go +57 -0
- package/templates/native-go/backend/internal/background/owner_test.go +126 -0
- package/templates/native-go/backend/internal/background/runner.go +185 -0
- package/templates/native-go/backend/internal/background/runner_test.go +209 -0
- package/templates/native-go/backend/internal/background/schedule.go +300 -0
- package/templates/native-go/backend/internal/background/schedule_test.go +335 -0
- package/templates/native-go/backend/internal/background/store.go +807 -0
- package/templates/native-go/backend/internal/background/store_test.go +407 -0
- package/templates/native-go/backend/internal/datamigrate/migrate.go +191 -0
- package/templates/native-go/backend/internal/datamigrate/migrate_test.go +177 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/templates/native-go/backend/internal/filestation/browse_test.go +67 -0
- package/templates/native-go/backend/internal/filestation/client.go +251 -0
- package/templates/native-go/backend/internal/filestation/client_test.go +155 -0
- package/templates/native-go/backend/internal/filestation/doc.go +4 -0
- package/templates/native-go/backend/internal/filestation/read_file_test.go +90 -0
- package/templates/native-go/backend/internal/filestation/repository.go +207 -0
- package/templates/native-go/backend/internal/filestation/repository_test.go +104 -0
- package/templates/native-go/backend/internal/filestation/sdk_session.go +241 -0
- package/templates/native-go/backend/internal/filestation/sdk_session_test.go +183 -0
- package/templates/native-go/backend/internal/filestation/service.go +254 -0
- package/templates/native-go/backend/internal/filestation/service_test.go +94 -0
- package/templates/native-go/backend/internal/filestation/session_semantics_test.go +383 -0
- package/templates/native-go/backend/internal/filestation/write.go +72 -0
- package/templates/native-go/backend/internal/filestation/write_test.go +123 -0
- package/templates/native-go/backend/internal/helper/background_proof.go +163 -0
- package/templates/native-go/backend/internal/helper/background_proof_contract.go +46 -0
- package/templates/native-go/backend/internal/helper/background_proof_test.go +161 -0
- package/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/templates/native-go/backend/internal/helper/control.go +226 -21
- package/templates/native-go/backend/internal/helper/control_test.go +10 -2
- package/templates/native-go/backend/internal/helper/data_contract.go +245 -0
- package/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/templates/native-go/backend/internal/helper/data_protocol.go +419 -0
- package/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/templates/native-go/backend/internal/helper/grant_authority.go +519 -0
- package/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux.go +416 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +469 -0
- package/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/templates/native-go/backend/internal/helper/grant_snapshot.go +78 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/templates/native-go/backend/internal/helper/jobcontract/bindings.go +48 -0
- package/templates/native-go/backend/internal/helper/jobcontract/contract_test.go +436 -0
- package/templates/native-go/backend/internal/helper/jobcontract/decode.go +185 -0
- package/templates/native-go/backend/internal/helper/jobcontract/digest.go +55 -0
- package/templates/native-go/backend/internal/helper/jobcontract/registry.go +85 -0
- package/templates/native-go/backend/internal/helper/jobcontract/registry_test.go +73 -0
- package/templates/native-go/backend/internal/helper/jobcontract/result.go +53 -0
- package/templates/native-go/backend/internal/helper/jobcontract/stub.go +8 -0
- package/templates/native-go/backend/internal/helper/jobcontract/testdata/input-digests.json +127 -0
- package/templates/native-go/backend/internal/helper/jobcontract/types.go +234 -0
- package/templates/native-go/backend/internal/helper/jobcontract/types_test.go +29 -0
- package/templates/native-go/backend/internal/helper/jobcontract/validate.go +462 -0
- package/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/templates/native-go/backend/internal/helper/legacy_authority_schema_linux_test.go +34 -0
- package/templates/native-go/backend/internal/helper/legacy_authority_schema_test.go +6 -0
- package/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/templates/native-go/backend/internal/helper/management.go +79 -0
- package/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/templates/native-go/backend/internal/helper/observation.go +244 -0
- package/templates/native-go/backend/internal/helper/observation_health_test.go +127 -0
- package/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic.go +155 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +130 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_writer.go +40 -0
- package/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/templates/native-go/backend/internal/helper/process_linux.go +14 -1
- package/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/templates/native-go/backend/internal/helper/query_deadline_linux_test.go +115 -0
- package/templates/native-go/backend/internal/helper/query_pending_diagnostic_test.go +254 -0
- package/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/templates/native-go/backend/internal/helper/relaxed_invalidation.go +203 -0
- package/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +250 -0
- package/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/templates/native-go/backend/internal/helper/sdk_assembly_linux.go +51 -0
- package/templates/native-go/backend/internal/helper/sdk_attach.go +83 -0
- package/templates/native-go/backend/internal/helper/sdk_attach_contract.go +32 -0
- package/templates/native-go/backend/internal/helper/sdk_attach_test.go +184 -0
- package/templates/native-go/backend/internal/helper/sdk_authority_schema_test.go +6 -0
- package/templates/native-go/backend/internal/helper/sdk_background_authority.go +832 -0
- package/templates/native-go/backend/internal/helper/sdk_background_authority_test.go +714 -0
- package/templates/native-go/backend/internal/helper/sdk_background_invalidation.go +218 -0
- package/templates/native-go/backend/internal/helper/sdk_background_lease.go +218 -0
- package/templates/native-go/backend/internal/helper/sdk_background_snapshot.go +110 -0
- package/templates/native-go/backend/internal/helper/sdk_background_store_linux_test.go +261 -0
- package/templates/native-go/backend/internal/helper/sdk_background_store_test.go +58 -0
- package/templates/native-go/backend/internal/helper/sdk_bindings.go +60 -0
- package/templates/native-go/backend/internal/helper/sdk_data_contract.go +251 -0
- package/templates/native-go/backend/internal/helper/sdk_data_protocol.go +424 -0
- package/templates/native-go/backend/internal/helper/sdk_dispatch_absence_test.go +51 -0
- package/templates/native-go/backend/internal/helper/sdk_display.go +488 -0
- package/templates/native-go/backend/internal/helper/sdk_display_contract.go +121 -0
- package/templates/native-go/backend/internal/helper/sdk_display_test.go +459 -0
- package/templates/native-go/backend/internal/helper/sdk_grant_authority.go +559 -0
- package/templates/native-go/backend/internal/helper/sdk_grant_repository_linux.go +417 -0
- package/templates/native-go/backend/internal/helper/sdk_grant_snapshot.go +94 -0
- package/templates/native-go/backend/internal/helper/sdk_history.go +80 -0
- package/templates/native-go/backend/internal/helper/sdk_history_test.go +76 -0
- package/templates/native-go/backend/internal/helper/sdk_job.go +697 -0
- package/templates/native-go/backend/internal/helper/sdk_job_child_linux.go +309 -0
- package/templates/native-go/backend/internal/helper/sdk_job_contract.go +122 -0
- package/templates/native-go/backend/internal/helper/sdk_job_linux_test.go +159 -0
- package/templates/native-go/backend/internal/helper/sdk_job_process_linux.go +327 -0
- package/templates/native-go/backend/internal/helper/sdk_job_test.go +501 -0
- package/templates/native-go/backend/internal/helper/sdk_job_vm_linux_test.go +343 -0
- package/templates/native-go/backend/internal/helper/sdk_journal.go +77 -0
- package/templates/native-go/backend/internal/helper/sdk_journal_linux.go +244 -0
- package/templates/native-go/backend/internal/helper/sdk_journal_linux_test.go +295 -0
- package/templates/native-go/backend/internal/helper/sdk_journal_test.go +71 -0
- package/templates/native-go/backend/internal/helper/sdk_picker_test.go +50 -0
- package/templates/native-go/backend/internal/helper/sdk_process_linux.go +184 -0
- package/templates/native-go/backend/internal/helper/sdk_public_vm_linux_test.go +129 -0
- package/templates/native-go/backend/internal/helper/sdk_relaxed_invalidation.go +242 -0
- package/templates/native-go/backend/internal/helper/sdk_rpc.go +299 -0
- package/templates/native-go/backend/internal/helper/sdk_rpc_contract.go +70 -0
- package/templates/native-go/backend/internal/helper/sdk_rpc_test.go +135 -0
- package/templates/native-go/backend/internal/helper/sdk_server_linux.go +152 -0
- package/templates/native-go/backend/internal/helper/sdk_session.go +677 -0
- package/templates/native-go/backend/internal/helper/sdk_session_contract.go +72 -0
- package/templates/native-go/backend/internal/helper/sdk_session_fence_test.go +215 -0
- package/templates/native-go/backend/internal/helper/sdk_session_test.go +475 -0
- package/templates/native-go/backend/internal/helper/sdk_supervisor_frame.go +78 -0
- package/templates/native-go/backend/internal/helper/sdk_supervisor_linux.go +414 -0
- package/templates/native-go/backend/internal/helper/sdk_transport.go +79 -0
- package/templates/native-go/backend/internal/helper/sdk_transport_linux.go +82 -0
- package/templates/native-go/backend/internal/helper/sdk_transport_test.go +64 -0
- package/templates/native-go/backend/internal/helper/server_linux.go +47 -3
- package/templates/native-go/backend/internal/helper/stale_management_linux_test.go +126 -0
- package/templates/native-go/backend/internal/helper/stale_management_test.go +122 -0
- package/templates/native-go/backend/internal/helper/startup_diagnostic.go +68 -0
- package/templates/native-go/backend/internal/helper/startup_diagnostic_linux_test.go +126 -0
- package/templates/native-go/backend/internal/helper/startup_diagnostic_test.go +117 -0
- package/templates/native-go/backend/internal/helper/status.go +83 -11
- package/templates/native-go/backend/internal/helper/status_test.go +128 -0
- package/templates/native-go/backend/internal/helper/supervision.go +28 -5
- package/templates/native-go/backend/internal/helper/supervisor_frame.go +79 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/templates/native-go/backend/internal/helper/supervisor_linux.go +191 -16
- package/templates/native-go/backend/internal/helper/supervisor_linux_test.go +618 -7
- package/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/templates/native-go/backend/internal/helper/unit_connection_test.go +151 -0
- package/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/templates/native-go/backend/internal/helper/unit_linux.go +368 -0
- package/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/templates/native-go/backend/internal/helper/unit_query_linux.go +115 -0
- package/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/templates/native-go/backend/internal/helper/write.go +77 -0
- package/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/templates/native-go/backend/internal/helper/write_files_linux.go +205 -0
- package/templates/native-go/backend/internal/helper/write_files_linux_test.go +225 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/templates/native-go/dsm-package.yaml +1 -1
- package/templates/native-go/ui/app.js +8 -1
- package/templates/native-go-background/BACKGROUND.md +111 -0
- package/templates/native-go-background/backend/internal/app/background_on.go +7 -0
- package/templates/native-go-background/backend/internal/app/background_routes_test.go +32 -0
- package/templates/native-go-background/frontend/src/background/BackgroundPanel.vue +178 -0
- package/templates/native-go-background/frontend/src/background/i18n/de.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/en.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/es.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/fr.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/it.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/ja.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/ko.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/zh-CN.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n/zh-TW.json +83 -0
- package/templates/native-go-background/frontend/src/background/i18n.ts +19 -0
- package/templates/native-go-background/frontend/src/background/picker-provider.ts +13 -0
- package/templates/native-go-background/frontend/test/background.test.ts +179 -0
- package/templates/native-go-better-auth/node/build.mjs +2 -0
- package/templates/native-go-integration/backend/internal/app/personal.go +2 -2
- package/templates/native-go-integration/backend/internal/app/personal_test.go +37 -0
- package/templates/native-go-vue/README.md +151 -6
- package/templates/native-go-vue/frontend/DESIGN.md +16 -4
- package/templates/native-go-vue/frontend/README-JOBS.md +75 -0
- package/templates/native-go-vue/frontend/README-M2.md +64 -0
- package/templates/native-go-vue/frontend/package-lock.json +137 -233
- package/templates/native-go-vue/frontend/package.json +2 -2
- package/templates/native-go-vue/frontend/src/App.vue +71 -16
- package/templates/native-go-vue/frontend/src/M2App.vue +57 -0
- package/templates/native-go-vue/frontend/src/SDKApp.vue +203 -0
- package/templates/native-go-vue/frontend/src/context.ts +41 -2
- package/templates/native-go-vue/frontend/src/jobs/InteractiveJobForm.vue +70 -0
- package/templates/native-go-vue/frontend/src/jobs/JobsAdminPanel.vue +33 -0
- package/templates/native-go-vue/frontend/src/jobs/JobsPanel.vue +135 -0
- package/templates/native-go-vue/frontend/src/jobs/connected-provider.ts +179 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/de.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/en.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/es.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/fr.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/it.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/ja.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/ko.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/zh-CN.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n/zh-TW.json +62 -0
- package/templates/native-go-vue/frontend/src/jobs/i18n.ts +15 -0
- package/templates/native-go-vue/frontend/src/jobs/mock-provider.ts +67 -0
- package/templates/native-go-vue/frontend/src/jobs/provider.ts +60 -0
- package/templates/native-go-vue/frontend/src/jobs/validate.ts +44 -0
- package/templates/native-go-vue/frontend/src/m2-main.ts +21 -0
- package/templates/native-go-vue/frontend/src/m2-style.css +7 -0
- package/templates/native-go-vue/frontend/src/main.ts +4 -1
- package/templates/native-go-vue/frontend/src/nas/M2Files.vue +94 -0
- package/templates/native-go-vue/frontend/src/nas/M2PathPicker.vue +70 -0
- package/templates/native-go-vue/frontend/src/nas/M2Settings.vue +69 -0
- package/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/de.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/en.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/es.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/fr.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/it.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/ja.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/ko.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/zh-CN.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/m2/zh-TW.json +56 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/templates/native-go-vue/frontend/src/nas/m2-contract.ts +33 -0
- package/templates/native-go-vue/frontend/src/nas/m2-i18n.ts +24 -0
- package/templates/native-go-vue/frontend/src/nas/m2-provider.ts +104 -0
- package/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/templates/native-go-vue/frontend/src/nas/use-m2-request.ts +18 -0
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/templates/native-go-vue/frontend/src/sdk-main.ts +39 -0
- package/templates/native-go-vue/frontend/src/shell/AppShell.vue +48 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/de.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/en.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/es.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/fr.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/it.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/ja.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/ko.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +10 -0
- package/templates/native-go-vue/frontend/src/shell/i18n.ts +17 -0
- package/templates/native-go-vue/frontend/src/shell/pages.ts +34 -0
- package/templates/native-go-vue/frontend/src/style.css +19 -6
- package/templates/native-go-vue/frontend/test/apps.test.ts +65 -2
- package/templates/native-go-vue/frontend/test/jobs-connected.test.ts +163 -0
- package/templates/native-go-vue/frontend/test/jobs-preview.html +22 -0
- package/templates/native-go-vue/frontend/test/jobs.test.ts +176 -0
- package/templates/native-go-vue/frontend/test/m2-preview.html +27 -0
- package/templates/native-go-vue/frontend/test/m2-provider.test.ts +87 -0
- package/templates/native-go-vue/frontend/test/m2-ui.test.ts +209 -0
- package/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/templates/native-go-vue/frontend/test/native-controls.test.ts +27 -0
- package/templates/native-go-vue/frontend/test/picker-wire.test.ts +110 -0
- package/templates/native-go-vue/frontend/test/shell-preview.html +19 -0
- package/templates/native-go-vue/frontend/test/shell-sdk.test.ts +73 -0
- package/templates/native-go-vue/frontend/test/shell-ui.test.ts +114 -0
- package/templates/native-go-vue/frontend/test/shell.test.ts +45 -0
- package/templates/native-go-vue/frontend/tsconfig.json +1 -1
- package/templates/native-go-vue/frontend/vite.config.ts +8 -6
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
package helper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"errors"
|
|
6
|
+
"golang.org/x/sys/unix"
|
|
7
|
+
"os"
|
|
8
|
+
"strconv"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
// Anonymous staging is created by the actor in the destination directory, so
|
|
12
|
+
// filesystem default ACL inheritance applies. No attacker-controlled stage name
|
|
13
|
+
// is ever linked, renamed or unlinked. Missing O_TMPFILE / fixed-FD link support
|
|
14
|
+
// refuses publish rather than falling back to check-then-rename.
|
|
15
|
+
type actorFileWriter struct {
|
|
16
|
+
parent *readOnlyObject
|
|
17
|
+
file *os.File
|
|
18
|
+
before unix.Stat_t
|
|
19
|
+
work writeWork
|
|
20
|
+
acl readOnlyACL
|
|
21
|
+
receipt MutationReceipt
|
|
22
|
+
failed, attempted, closed bool
|
|
23
|
+
syncParent func() error // fixed parent.Sync; fault injection only in tests
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
func openActorWriteTransfer(ctx context.Context, pin *pinnedReadOnlyRoot, w writeWork, acl readOnlyACL) (*actorFileWriter, Code) {
|
|
27
|
+
if c := w.validate(); c != "" {
|
|
28
|
+
return nil, c
|
|
29
|
+
}
|
|
30
|
+
if acl == nil {
|
|
31
|
+
return nil, ErrUnsupported
|
|
32
|
+
}
|
|
33
|
+
parentWork := readOnlyWork{RootPath: w.RootPath, Action: ActionStat, Segments: w.Segments[:len(w.Segments)-1]}
|
|
34
|
+
p, c := resolveReadOnly(ctx, pin, parentWork)
|
|
35
|
+
if c != "" {
|
|
36
|
+
return nil, c
|
|
37
|
+
}
|
|
38
|
+
ok := false
|
|
39
|
+
defer func() {
|
|
40
|
+
if !ok {
|
|
41
|
+
p.Close()
|
|
42
|
+
}
|
|
43
|
+
}()
|
|
44
|
+
if p.before.Mode&unix.S_IFMT != unix.S_IFDIR {
|
|
45
|
+
return nil, ErrDenied
|
|
46
|
+
}
|
|
47
|
+
for _, fd := range []int{int(p.nodes[p.root].file.Fd()), int(p.data.Fd())} {
|
|
48
|
+
if c := nativeObservationCode(ctx, acl.Authorize(ctx, w.Action, fd)); c != "" {
|
|
49
|
+
return nil, c
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if c := p.check(); c != "" {
|
|
53
|
+
return nil, c
|
|
54
|
+
}
|
|
55
|
+
flags := unix.O_WRONLY | unix.O_CLOEXEC | unix.O_NOFOLLOW | unix.O_NONBLOCK
|
|
56
|
+
name := w.Segments[len(w.Segments)-1]
|
|
57
|
+
if w.Staged {
|
|
58
|
+
flags |= unix.O_TMPFILE
|
|
59
|
+
name = "."
|
|
60
|
+
} else {
|
|
61
|
+
flags |= unix.O_CREAT | unix.O_EXCL
|
|
62
|
+
}
|
|
63
|
+
fd, e := unix.Openat(int(p.data.Fd()), name, flags, 0666)
|
|
64
|
+
if e != nil {
|
|
65
|
+
if w.Staged && (errors.Is(e, unix.EOPNOTSUPP) || errors.Is(e, unix.EINVAL) || errors.Is(e, unix.EISDIR)) {
|
|
66
|
+
return nil, ErrUnsupported
|
|
67
|
+
}
|
|
68
|
+
if errors.Is(e, unix.EEXIST) {
|
|
69
|
+
return nil, ErrDenied
|
|
70
|
+
}
|
|
71
|
+
return nil, readOnlyError(e)
|
|
72
|
+
}
|
|
73
|
+
x := &actorFileWriter{parent: p, file: os.NewFile(uintptr(fd), "actor-write"), work: w, acl: acl, receipt: MutationReceipt{Created: true}, syncParent: p.data.Sync}
|
|
74
|
+
// A successful exclusive open is already a visible effect, even if following
|
|
75
|
+
// checks fail. Return the owned FD and partial receipt; never unlink its name.
|
|
76
|
+
ok = true
|
|
77
|
+
if unix.Fstat(fd, &x.before) != nil || x.before.Mode&unix.S_IFMT != unix.S_IFREG || x.before.Dev != p.before.Dev {
|
|
78
|
+
x.failed = true
|
|
79
|
+
return x, ErrPartial
|
|
80
|
+
}
|
|
81
|
+
if c := x.check(ctx); c != "" {
|
|
82
|
+
x.failed = true
|
|
83
|
+
return x, ErrPartial
|
|
84
|
+
}
|
|
85
|
+
return x, ""
|
|
86
|
+
}
|
|
87
|
+
func (x *actorFileWriter) Receipt() MutationReceipt { return x.receipt }
|
|
88
|
+
func (x *actorFileWriter) check(ctx context.Context) Code { return x.checkAction(ctx, x.work.Action) }
|
|
89
|
+
func (x *actorFileWriter) checkAction(ctx context.Context, action Action) Code {
|
|
90
|
+
if x.closed {
|
|
91
|
+
return ErrCanceled
|
|
92
|
+
}
|
|
93
|
+
if c := nativeContextCode(ctx); c != "" {
|
|
94
|
+
return c
|
|
95
|
+
}
|
|
96
|
+
if c := x.parent.check(); c != "" {
|
|
97
|
+
return c
|
|
98
|
+
}
|
|
99
|
+
var st unix.Stat_t
|
|
100
|
+
if unix.Fstat(int(x.file.Fd()), &st) != nil || !sameReadOnlyObject(st, x.before) || st.Size != int64(x.receipt.BytesWritten) {
|
|
101
|
+
return ErrStale
|
|
102
|
+
}
|
|
103
|
+
links := uint64(1)
|
|
104
|
+
if x.work.Staged && !x.receipt.Published {
|
|
105
|
+
links = 0
|
|
106
|
+
}
|
|
107
|
+
if uint64(st.Nlink) != links {
|
|
108
|
+
return ErrDenied
|
|
109
|
+
}
|
|
110
|
+
if !x.work.Staged || x.receipt.Published {
|
|
111
|
+
var named unix.Stat_t
|
|
112
|
+
if unix.Fstatat(int(x.parent.data.Fd()), x.work.Segments[len(x.work.Segments)-1], &named, unix.AT_SYMLINK_NOFOLLOW) != nil || !sameReadOnlyObject(st, named) {
|
|
113
|
+
return ErrStale
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for _, fd := range []int{int(x.parent.nodes[x.parent.root].file.Fd()), int(x.parent.data.Fd()), int(x.file.Fd())} {
|
|
117
|
+
if c := nativeObservationCode(ctx, x.acl.Authorize(ctx, action, fd)); c != "" {
|
|
118
|
+
return c
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return nativeContextCode(ctx)
|
|
122
|
+
}
|
|
123
|
+
func (x *actorFileWriter) WriteChunk(ctx context.Context, b []byte) (MutationReceipt, Code) {
|
|
124
|
+
if x.failed || x.attempted || x.closed {
|
|
125
|
+
return x.receipt, ErrPartial
|
|
126
|
+
}
|
|
127
|
+
if len(b) == 0 || len(b) > MaxChunkBytes || uint64(len(b)) > x.work.MaxBytes-x.receipt.BytesWritten {
|
|
128
|
+
return x.receipt, ErrLimit
|
|
129
|
+
}
|
|
130
|
+
if c := x.check(ctx); c != "" {
|
|
131
|
+
x.failed = true
|
|
132
|
+
return x.receipt, ErrPartial
|
|
133
|
+
}
|
|
134
|
+
n, e := x.file.Write(b)
|
|
135
|
+
x.receipt.BytesWritten += uint64(n)
|
|
136
|
+
if e != nil || n != len(b) {
|
|
137
|
+
x.failed = true
|
|
138
|
+
return x.receipt, ErrPartial
|
|
139
|
+
}
|
|
140
|
+
if c := x.check(ctx); c != "" {
|
|
141
|
+
x.failed = true
|
|
142
|
+
return x.receipt, ErrPartial
|
|
143
|
+
}
|
|
144
|
+
return x.receipt, ""
|
|
145
|
+
}
|
|
146
|
+
func (x *actorFileWriter) Commit(ctx context.Context) (MutationReceipt, Code) {
|
|
147
|
+
if x.attempted {
|
|
148
|
+
return x.receipt, ErrReplay
|
|
149
|
+
}
|
|
150
|
+
x.attempted = true
|
|
151
|
+
if x.failed || x.closed {
|
|
152
|
+
return x.receipt, ErrPartial
|
|
153
|
+
}
|
|
154
|
+
action := x.work.Action
|
|
155
|
+
if x.work.Staged {
|
|
156
|
+
action = ActionPublish
|
|
157
|
+
}
|
|
158
|
+
if c := x.checkAction(ctx, action); c != "" {
|
|
159
|
+
return x.receipt, c
|
|
160
|
+
}
|
|
161
|
+
if !x.work.Staged && x.receipt.BytesWritten != x.work.MaxBytes {
|
|
162
|
+
return x.receipt, ErrPartial
|
|
163
|
+
}
|
|
164
|
+
if e := x.file.Sync(); e != nil {
|
|
165
|
+
return x.receipt, ErrPartial
|
|
166
|
+
}
|
|
167
|
+
if c := x.checkAction(ctx, action); c != "" {
|
|
168
|
+
return x.receipt, c
|
|
169
|
+
}
|
|
170
|
+
if x.work.Staged {
|
|
171
|
+
// Atomic no-replace on kernels without renameat2. O_TMPFILE has no source
|
|
172
|
+
// name; linkat follows only this actor's live descriptor alias. No unlink of
|
|
173
|
+
// the destination is ever performed, including failure/foreign replacement.
|
|
174
|
+
e := unix.Linkat(unix.AT_FDCWD, "/proc/self/fd/"+strconv.Itoa(int(x.file.Fd())), int(x.parent.data.Fd()), x.work.Segments[len(x.work.Segments)-1], unix.AT_SYMLINK_FOLLOW)
|
|
175
|
+
if e != nil {
|
|
176
|
+
return x.receipt, publishLinkError(e)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
x.receipt.Published = true
|
|
180
|
+
if c := x.checkAction(ctx, action); c != "" {
|
|
181
|
+
return x.receipt, ErrCommitUncertain
|
|
182
|
+
}
|
|
183
|
+
if e := x.syncParent(); e != nil {
|
|
184
|
+
return x.receipt, ErrCommitUncertain
|
|
185
|
+
}
|
|
186
|
+
if c := x.checkAction(ctx, action); c != "" {
|
|
187
|
+
return x.receipt, ErrCommitUncertain
|
|
188
|
+
}
|
|
189
|
+
x.receipt.Committed = true
|
|
190
|
+
return x.receipt, ""
|
|
191
|
+
}
|
|
192
|
+
func publishLinkError(err error) Code {
|
|
193
|
+
if errors.Is(err, unix.EEXIST) || errors.Is(err, unix.EACCES) {
|
|
194
|
+
return ErrDenied
|
|
195
|
+
}
|
|
196
|
+
return ErrUnsupported
|
|
197
|
+
}
|
|
198
|
+
func (x *actorFileWriter) Close() {
|
|
199
|
+
if x.closed {
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
x.closed = true
|
|
203
|
+
x.file.Close()
|
|
204
|
+
x.parent.Close()
|
|
205
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
package helper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"bytes"
|
|
5
|
+
"context"
|
|
6
|
+
"golang.org/x/sys/unix"
|
|
7
|
+
"os"
|
|
8
|
+
"testing"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
func TestPublishLinkError(t *testing.T) {
|
|
12
|
+
for _, tc := range []struct {
|
|
13
|
+
err error
|
|
14
|
+
want Code
|
|
15
|
+
}{
|
|
16
|
+
{unix.EACCES, ErrDenied},
|
|
17
|
+
{unix.EEXIST, ErrDenied},
|
|
18
|
+
{unix.EPERM, ErrUnsupported},
|
|
19
|
+
{unix.ENOSYS, ErrUnsupported},
|
|
20
|
+
{unix.EOPNOTSUPP, ErrUnsupported},
|
|
21
|
+
{unix.EINVAL, ErrUnsupported},
|
|
22
|
+
{unix.ENOENT, ErrUnsupported},
|
|
23
|
+
{unix.EXDEV, ErrUnsupported},
|
|
24
|
+
{unix.EROFS, ErrUnsupported},
|
|
25
|
+
{unix.EIO, ErrUnsupported},
|
|
26
|
+
} {
|
|
27
|
+
t.Run(tc.err.Error(), func(t *testing.T) {
|
|
28
|
+
for _, err := range []error{tc.err, &os.LinkError{Op: "linkat", Old: "fixed-fd", New: "destination", Err: tc.err}} {
|
|
29
|
+
if got := publishLinkError(err); got != tc.want {
|
|
30
|
+
t.Errorf("publishLinkError(%v) = %s, want %s", err, got, tc.want)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
func TestWriteExclusivePartialAndNoForeignUnlink(t *testing.T) {
|
|
38
|
+
pin, root := readOnlyFixture(t)
|
|
39
|
+
w := writeWork{RootPath: root, Action: ActionCreate, Segments: []string{"new"}, MaxBytes: 10}
|
|
40
|
+
x, c := openActorWriteTransfer(context.Background(), pin, w, fixtureReadOnlyACL{})
|
|
41
|
+
if c != "" {
|
|
42
|
+
t.Fatal(c)
|
|
43
|
+
}
|
|
44
|
+
defer x.Close()
|
|
45
|
+
r, c := x.WriteChunk(context.Background(), []byte("abc"))
|
|
46
|
+
if c != "" || r.BytesWritten != 3 || r.Committed {
|
|
47
|
+
t.Fatal(r, c)
|
|
48
|
+
}
|
|
49
|
+
if _, c := openActorWriteTransfer(context.Background(), pin, w, fixtureReadOnlyACL{}); c == "" {
|
|
50
|
+
t.Fatal("duplicate create")
|
|
51
|
+
}
|
|
52
|
+
if e := os.Rename(root+"/new", root+"/moved"); e != nil {
|
|
53
|
+
t.Fatal(e)
|
|
54
|
+
}
|
|
55
|
+
os.WriteFile(root+"/new", []byte("foreign"), 0644)
|
|
56
|
+
r, c = x.WriteChunk(context.Background(), []byte("def"))
|
|
57
|
+
if c != ErrPartial || r.BytesWritten != 3 {
|
|
58
|
+
t.Fatal(r, c)
|
|
59
|
+
}
|
|
60
|
+
x.Close()
|
|
61
|
+
b, _ := os.ReadFile(root + "/new")
|
|
62
|
+
if string(b) != "foreign" {
|
|
63
|
+
t.Fatal("foreign path damaged")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
func TestWriteStageFixedFDNoOverwriteAndCommitGap(t *testing.T) {
|
|
67
|
+
for _, kind := range []string{"success", "exists", "fsync-gap", "acl", "cancel"} {
|
|
68
|
+
t.Run(kind, func(t *testing.T) {
|
|
69
|
+
pin, root := readOnlyFixture(t)
|
|
70
|
+
w := writeWork{RootPath: root, Action: ActionWriteStream, Segments: []string{"published"}, MaxBytes: MaxTransferBytes, Staged: true}
|
|
71
|
+
acl := &writeTestACL{}
|
|
72
|
+
x, c := openActorWriteTransfer(context.Background(), pin, w, acl)
|
|
73
|
+
if c != "" {
|
|
74
|
+
t.Fatal(c)
|
|
75
|
+
}
|
|
76
|
+
defer x.Close()
|
|
77
|
+
if _, e := os.Stat(root + "/published"); !os.IsNotExist(e) {
|
|
78
|
+
t.Fatal("stage visible at destination")
|
|
79
|
+
}
|
|
80
|
+
for n := 0; n < 32; n++ {
|
|
81
|
+
r, c := x.WriteChunk(context.Background(), bytes.Repeat([]byte("x"), MaxChunkBytes))
|
|
82
|
+
if c != "" || r.BytesWritten != uint64((n+1)*MaxChunkBytes) {
|
|
83
|
+
t.Fatal(r, c)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
switch kind {
|
|
87
|
+
case "exists":
|
|
88
|
+
os.WriteFile(root+"/published", []byte("foreign"), 0644)
|
|
89
|
+
case "fsync-gap":
|
|
90
|
+
x.syncParent = func() error { return unix.EIO }
|
|
91
|
+
case "acl":
|
|
92
|
+
acl.deny = true
|
|
93
|
+
}
|
|
94
|
+
ctx := context.Background()
|
|
95
|
+
if kind == "cancel" {
|
|
96
|
+
cancelCtx, cancel := context.WithCancel(ctx)
|
|
97
|
+
cancel()
|
|
98
|
+
ctx = cancelCtx
|
|
99
|
+
}
|
|
100
|
+
r, c := x.Commit(ctx)
|
|
101
|
+
switch kind {
|
|
102
|
+
case "success":
|
|
103
|
+
if c != "" || !r.Committed || !r.Published {
|
|
104
|
+
t.Fatal(r, c)
|
|
105
|
+
}
|
|
106
|
+
case "fsync-gap":
|
|
107
|
+
if c != ErrCommitUncertain || r.Committed || !r.Published {
|
|
108
|
+
t.Fatal(r, c)
|
|
109
|
+
}
|
|
110
|
+
default:
|
|
111
|
+
if c == "" || r.Committed || r.Published {
|
|
112
|
+
t.Fatal(r, c)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if kind == "exists" {
|
|
116
|
+
b, _ := os.ReadFile(root + "/published")
|
|
117
|
+
if string(b) != "foreign" {
|
|
118
|
+
t.Fatal("overwritten")
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if _, c = x.Commit(context.Background()); c != ErrReplay {
|
|
122
|
+
t.Fatal("duplicate commit", c)
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type writeTestACL struct{ deny bool }
|
|
129
|
+
|
|
130
|
+
func (a *writeTestACL) Authorize(context.Context, Action, int) Code {
|
|
131
|
+
if a.deny {
|
|
132
|
+
return ErrDenied
|
|
133
|
+
}
|
|
134
|
+
return ""
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
type writeActionACL struct{ deny Action }
|
|
138
|
+
|
|
139
|
+
func (a writeActionACL) Authorize(_ context.Context, action Action, _ int) Code {
|
|
140
|
+
if action == a.deny {
|
|
141
|
+
return ErrDenied
|
|
142
|
+
}
|
|
143
|
+
return ""
|
|
144
|
+
}
|
|
145
|
+
func TestWritePublishRechecksPublishACLInActor(t *testing.T) {
|
|
146
|
+
pin, root := readOnlyFixture(t)
|
|
147
|
+
w := writeWork{RootPath: root, Action: ActionWriteStream, Segments: []string{"final"}, MaxBytes: 10, Staged: true}
|
|
148
|
+
x, c := openActorWriteTransfer(context.Background(), pin, w, writeActionACL{deny: ActionPublish})
|
|
149
|
+
if c != "" {
|
|
150
|
+
t.Fatal(c)
|
|
151
|
+
}
|
|
152
|
+
defer x.Close()
|
|
153
|
+
if _, c = x.WriteChunk(context.Background(), []byte("abc")); c != "" {
|
|
154
|
+
t.Fatal(c)
|
|
155
|
+
}
|
|
156
|
+
if r, c := x.Commit(context.Background()); c != ErrDenied || r.Published {
|
|
157
|
+
t.Fatal("published without publish ACL", r, c)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
func TestWriteDiskFullHasExactPartialReceipt(t *testing.T) {
|
|
162
|
+
if os.Geteuid() != 0 {
|
|
163
|
+
t.Skip("disposable root VM")
|
|
164
|
+
}
|
|
165
|
+
root := t.TempDir()
|
|
166
|
+
if e := unix.Mount("tmpfs", root, "tmpfs", 0, "size=64k,mode=0755"); e != nil {
|
|
167
|
+
t.Fatal(e)
|
|
168
|
+
}
|
|
169
|
+
defer unix.Unmount(root, 0)
|
|
170
|
+
pin, c := pinReadOnlyRoot(root)
|
|
171
|
+
if c != "" {
|
|
172
|
+
t.Fatal(c)
|
|
173
|
+
}
|
|
174
|
+
defer pin.Close()
|
|
175
|
+
x, c := openActorWriteTransfer(context.Background(), pin, writeWork{RootPath: root, Action: ActionCreate, Segments: []string{"full"}, MaxBytes: MaxBoundedBytes}, fixtureReadOnlyACL{})
|
|
176
|
+
if c != "" {
|
|
177
|
+
t.Fatal(c)
|
|
178
|
+
}
|
|
179
|
+
defer x.Close()
|
|
180
|
+
var r MutationReceipt
|
|
181
|
+
for n := 0; n < 16; n++ {
|
|
182
|
+
r, c = x.WriteChunk(context.Background(), bytes.Repeat([]byte("x"), MaxChunkBytes))
|
|
183
|
+
if c != "" {
|
|
184
|
+
break
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if c != ErrPartial || r.BytesWritten != MaxChunkBytes || r.Committed {
|
|
188
|
+
t.Fatal(r, c)
|
|
189
|
+
}
|
|
190
|
+
info, e := os.Stat(root + "/full")
|
|
191
|
+
if e != nil || info.Size() != int64(r.BytesWritten) {
|
|
192
|
+
t.Fatal(info, e)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
func TestWriteConcurrentPublishHasOneWinnerAndNoOverwrite(t *testing.T) {
|
|
197
|
+
pin, root := readOnlyFixture(t)
|
|
198
|
+
w := writeWork{RootPath: root, Action: ActionWriteStream, Segments: []string{"winner"}, MaxBytes: 10, Staged: true}
|
|
199
|
+
first, c := openActorWriteTransfer(context.Background(), pin, w, fixtureReadOnlyACL{})
|
|
200
|
+
if c != "" {
|
|
201
|
+
t.Fatal(c)
|
|
202
|
+
}
|
|
203
|
+
defer first.Close()
|
|
204
|
+
second, c := openActorWriteTransfer(context.Background(), pin, w, fixtureReadOnlyACL{})
|
|
205
|
+
if c != "" {
|
|
206
|
+
t.Fatal(c)
|
|
207
|
+
}
|
|
208
|
+
defer second.Close()
|
|
209
|
+
first.WriteChunk(context.Background(), []byte("first"))
|
|
210
|
+
second.WriteChunk(context.Background(), []byte("second"))
|
|
211
|
+
start := make(chan struct{})
|
|
212
|
+
result := make(chan Code, 2)
|
|
213
|
+
for _, x := range []*actorFileWriter{first, second} {
|
|
214
|
+
go func(x *actorFileWriter) { <-start; _, c := x.Commit(context.Background()); result <- c }(x)
|
|
215
|
+
}
|
|
216
|
+
close(start)
|
|
217
|
+
a, b := <-result, <-result
|
|
218
|
+
if !(a == "" && b == ErrDenied || b == "" && a == ErrDenied) {
|
|
219
|
+
t.Fatal(a, b)
|
|
220
|
+
}
|
|
221
|
+
data, e := os.ReadFile(root + "/winner")
|
|
222
|
+
if e != nil || string(data) != "first" && string(data) != "second" {
|
|
223
|
+
t.Fatal(string(data), e)
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
package helper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"encoding/json"
|
|
5
|
+
"errors"
|
|
6
|
+
"golang.org/x/sys/unix"
|
|
7
|
+
"os"
|
|
8
|
+
"strings"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
type fileWriteIntents struct{ repository *FileGrantRepository }
|
|
12
|
+
|
|
13
|
+
func (j fileWriteIntents) Reserve(b operationBinding, actor Principal, w writeWork) Code {
|
|
14
|
+
r := j.repository
|
|
15
|
+
if r == nil {
|
|
16
|
+
return ErrUnavailable
|
|
17
|
+
}
|
|
18
|
+
r.mu.Lock()
|
|
19
|
+
defer r.mu.Unlock()
|
|
20
|
+
if r.closed || r.poisoned || b.Inventory != r.expected || !allReferences(b.Epoch, b.OperationID, b.Nonce, b.GrantID) || b.GrantRevision == 0 || w.validate() != "" || actor.Kind != "local" || !allReferences(actor.SubjectRef, actor.InstanceRef) {
|
|
21
|
+
return ErrDenied
|
|
22
|
+
}
|
|
23
|
+
fd, e := unix.Openat(int(r.dir.Fd()), ".", unix.O_RDONLY|unix.O_DIRECTORY|unix.O_CLOEXEC, 0)
|
|
24
|
+
if e != nil {
|
|
25
|
+
return ErrUnavailable
|
|
26
|
+
}
|
|
27
|
+
directory := os.NewFile(uintptr(fd), "write-intents")
|
|
28
|
+
limit := 4*MaxGrants + 2*MaxReplayEntries + 32
|
|
29
|
+
names, e := directory.Readdirnames(limit)
|
|
30
|
+
directory.Close()
|
|
31
|
+
if len(names) == limit {
|
|
32
|
+
return ErrBusy
|
|
33
|
+
}
|
|
34
|
+
if e != nil && len(names) == 0 {
|
|
35
|
+
return ErrUnavailable
|
|
36
|
+
}
|
|
37
|
+
count := 0
|
|
38
|
+
for _, name := range names {
|
|
39
|
+
if strings.HasPrefix(name, "write-intent-") {
|
|
40
|
+
count++
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Retained immutable records deliberately cap lifetime mutation attempts.
|
|
44
|
+
// No eviction, restart reset or cleanup of unknown filesystem effects.
|
|
45
|
+
if count >= MaxReplayEntries {
|
|
46
|
+
return ErrBusy
|
|
47
|
+
}
|
|
48
|
+
data, e := json.Marshal(struct {
|
|
49
|
+
Binding operationBinding `json:"binding"`
|
|
50
|
+
Actor Principal `json:"actor"`
|
|
51
|
+
Work writeWork `json:"work"`
|
|
52
|
+
}{b, actor, w})
|
|
53
|
+
if e != nil || len(data) > MaxControlBytes {
|
|
54
|
+
return ErrLimit
|
|
55
|
+
}
|
|
56
|
+
fd, e = unix.Openat(int(r.dir.Fd()), "write-intent-"+b.OperationID+".json", unix.O_WRONLY|unix.O_CREAT|unix.O_EXCL|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0600)
|
|
57
|
+
if errors.Is(e, unix.EEXIST) {
|
|
58
|
+
return ErrReplay
|
|
59
|
+
}
|
|
60
|
+
if e != nil {
|
|
61
|
+
return ErrUnavailable
|
|
62
|
+
}
|
|
63
|
+
f := os.NewFile(uintptr(fd), "write-intent")
|
|
64
|
+
defer f.Close()
|
|
65
|
+
if _, e := grantFileStat(f, 0600, 0); e != nil {
|
|
66
|
+
return ErrUnavailable
|
|
67
|
+
}
|
|
68
|
+
n, e := f.Write(data)
|
|
69
|
+
if e != nil || n != len(data) {
|
|
70
|
+
return ErrUnavailable
|
|
71
|
+
}
|
|
72
|
+
if f.Sync() != nil || f.Close() != nil || r.dir.Sync() != nil {
|
|
73
|
+
return ErrCommitUncertain
|
|
74
|
+
}
|
|
75
|
+
return ""
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Only final observed receipts are persisted. Missing/partial records remain
|
|
79
|
+
// uncertain; their immutable intent prevents replay across a supervisor restart.
|
|
80
|
+
func (j fileWriteIntents) Record(b operationBinding, m MutationReceipt, code Code) Code {
|
|
81
|
+
r := j.repository
|
|
82
|
+
if r == nil {
|
|
83
|
+
return ErrUnavailable
|
|
84
|
+
}
|
|
85
|
+
r.mu.Lock()
|
|
86
|
+
defer r.mu.Unlock()
|
|
87
|
+
if r.closed || r.poisoned || b.Inventory != r.expected || !allReferences(b.OperationID) || code != "" && !code.Valid() {
|
|
88
|
+
return ErrDenied
|
|
89
|
+
}
|
|
90
|
+
if _, e := r.read("write-intent-"+b.OperationID+".json", 0600, MaxControlBytes); e != nil {
|
|
91
|
+
return ErrCleanupRequired
|
|
92
|
+
}
|
|
93
|
+
data, e := json.Marshal(struct {
|
|
94
|
+
Binding operationBinding `json:"binding"`
|
|
95
|
+
Receipt MutationReceipt `json:"receipt"`
|
|
96
|
+
Code Code `json:"code"`
|
|
97
|
+
}{b, m, code})
|
|
98
|
+
if e != nil {
|
|
99
|
+
return ErrInvalid
|
|
100
|
+
}
|
|
101
|
+
name := "write-receipt-" + b.OperationID + ".json"
|
|
102
|
+
old, e := r.read(name, 0600, MaxControlBytes)
|
|
103
|
+
if e == nil {
|
|
104
|
+
if string(old) != string(data) {
|
|
105
|
+
return ErrReplay
|
|
106
|
+
}
|
|
107
|
+
if r.dir.Sync() != nil {
|
|
108
|
+
return ErrCommitUncertain
|
|
109
|
+
}
|
|
110
|
+
return ""
|
|
111
|
+
}
|
|
112
|
+
if !errors.Is(e, unix.ENOENT) {
|
|
113
|
+
return ErrCleanupRequired
|
|
114
|
+
}
|
|
115
|
+
return r.commit(name, data)
|
|
116
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
package helper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"golang.org/x/sys/unix"
|
|
5
|
+
"os"
|
|
6
|
+
"testing"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
func TestWriteIntentSurvivesRestartAndBoundsLifetimeRetries(t *testing.T) {
|
|
10
|
+
dir, i, record := rootGrantFixture(t)
|
|
11
|
+
r := openRootGrantRepository(t, dir, i)
|
|
12
|
+
j := fileWriteIntents{r}
|
|
13
|
+
b := operationBinding{i, record.Lifecycle.Epoch, grantRef('a'), grantRef('b'), grantRef('c'), 1}
|
|
14
|
+
actor := Principal{Kind: "local", SubjectRef: grantRef('1'), InstanceRef: grantRef('2')}
|
|
15
|
+
w := writeWork{RootPath: "/trusted/root", Action: ActionCreate, Segments: []string{"file"}, MaxBytes: 10}
|
|
16
|
+
if c := j.Reserve(b, actor, w); c != "" {
|
|
17
|
+
t.Fatal(c)
|
|
18
|
+
}
|
|
19
|
+
if c := j.Reserve(b, actor, w); c != ErrReplay {
|
|
20
|
+
t.Fatal(c)
|
|
21
|
+
}
|
|
22
|
+
name := dir + "/write-intent-" + b.OperationID + ".json"
|
|
23
|
+
var st unix.Stat_t
|
|
24
|
+
if e := unix.Stat(name, &st); e != nil || st.Uid != 0 || st.Gid != 0 || st.Mode&0777 != 0600 || st.Nlink != 1 {
|
|
25
|
+
t.Fatal(st, e)
|
|
26
|
+
}
|
|
27
|
+
r.Close()
|
|
28
|
+
r = openRootGrantRepository(t, dir, i)
|
|
29
|
+
j = fileWriteIntents{r}
|
|
30
|
+
if c := j.Reserve(b, actor, w); c != ErrReplay {
|
|
31
|
+
t.Fatal("restart replay", c)
|
|
32
|
+
}
|
|
33
|
+
// Partial/crashed immutable records remain denial evidence, never removed.
|
|
34
|
+
if e := os.WriteFile(dir+"/write-intent-"+grantRef('d')+".json", []byte("partial"), 0600); e != nil {
|
|
35
|
+
t.Fatal(e)
|
|
36
|
+
}
|
|
37
|
+
b.OperationID = grantRef('d')
|
|
38
|
+
if c := j.Reserve(b, actor, w); c != ErrReplay {
|
|
39
|
+
t.Fatal(c)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
func TestWriteFinalReceiptFsyncGapKeepsIntentAndRefusesChangedRetry(t *testing.T) {
|
|
44
|
+
dir, i, record := rootGrantFixture(t)
|
|
45
|
+
r := openRootGrantRepository(t, dir, i)
|
|
46
|
+
j := fileWriteIntents{r}
|
|
47
|
+
b := operationBinding{i, record.Lifecycle.Epoch, grantRef('a'), grantRef('b'), grantRef('c'), 1}
|
|
48
|
+
actor := Principal{Kind: "local", SubjectRef: grantRef('1'), InstanceRef: grantRef('2')}
|
|
49
|
+
w := writeWork{RootPath: "/trusted/root", Action: ActionCreate, Segments: []string{"file"}, MaxBytes: 10}
|
|
50
|
+
if c := j.Reserve(b, actor, w); c != "" {
|
|
51
|
+
t.Fatal(c)
|
|
52
|
+
}
|
|
53
|
+
m := MutationReceipt{Created: true, Published: true, BytesWritten: 10, Committed: true}
|
|
54
|
+
r.fault = func(stage string) error {
|
|
55
|
+
if stage == "after-rename" {
|
|
56
|
+
return unix.EIO
|
|
57
|
+
}
|
|
58
|
+
return nil
|
|
59
|
+
}
|
|
60
|
+
if c := j.Record(b, m, ""); c != ErrCommitUncertain {
|
|
61
|
+
t.Fatal(c)
|
|
62
|
+
}
|
|
63
|
+
r.fault = nil
|
|
64
|
+
if c := j.Record(b, m, ""); c != "" {
|
|
65
|
+
t.Fatal(c)
|
|
66
|
+
}
|
|
67
|
+
m.BytesWritten--
|
|
68
|
+
if c := j.Record(b, m, ""); c != ErrReplay {
|
|
69
|
+
t.Fatal("changed receipt", c)
|
|
70
|
+
}
|
|
71
|
+
if c := j.Reserve(b, actor, w); c != ErrReplay {
|
|
72
|
+
t.Fatal("uncertain mutation replay", c)
|
|
73
|
+
}
|
|
74
|
+
}
|