Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8167e0d576 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# QQQ Mobile Scanners
|
||||
|
||||
This is an application QBit and a separate local demo, using Java 21 and QQQ 4.1.0-RC.21. Optional `examples/echo` (scan-to-print) uses released Printing 1.0.0; its Generation, Record Files and Scripting owner inputs are not yet public. Contract versions: UI API 1.10, `mobile-scanners` 1.6 (1.5 on the maintained local server), `printing` 2.3, `mobile-record-files` 1.0.
|
||||
This is an application QBit and a separate local demo, using Java 21 and QQQ 4.1.0-RC.21. Optional `examples/echo` (scan-to-print) uses released Printing 1.0.0; its Generation, Record Files and Scripting owner inputs are not yet public. Contract versions: UI API 1.10, `mobile-scanners` 1.5, `printing` 2.3, `mobile-record-files` 1.0.
|
||||
The Android host is maintained in [QRun-IO/qqq-android on Gitea](https://git.kof22.com/QRun-IO/qqq-android) (reviews pulls/8 and pulls/10 are merged into `main`). Present status is in `docs/SESSION-STATE.md`; older logs are in `docs/history/`.
|
||||
|
||||
## Build and verify
|
||||
|
||||
@@ -52,8 +52,7 @@ Android host --(/qqq/v1 + mobile-scanners extension)--> QQQ server + this qbit -
|
||||
|
||||
## Project layout
|
||||
|
||||
- `pom.xml`: the `qbit-mobile-scanners-reactor` aggregator (packaging pom, single `<revision>` source) of the two published modules, `base` and `integrations/record-files`; `demo` and `examples/echo` are not part of it. One root `mvn deploy` publishes the reactor POM, `qbit-mobile-scanners` and `qbit-mobile-scanners-record-files` at the same version.
|
||||
- `base/src/main`, `base/src/test`: the reusable qbit (enrollment routes, approval/revocation, scan process, table metadata) and its H2 behavior and permission tests.
|
||||
- `src/main`, `src/test`: the reusable qbit (enrollment routes, approval/revocation, scan process, table metadata) and its H2 behavior and permission tests.
|
||||
- `demo`: basic local QQQ server with persistent H2 storage, native administration UI and password login. QQQ `4.0.0` lacks the password session exchange it needs.
|
||||
- `e2e`: browser acceptance tests against the packaged frontend and an isolated real demo server.
|
||||
- `examples/echo` and `examples/echo/demo`: the optional Echo library and its runnable composed server.
|
||||
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.kingsrook.qbits</groupId>
|
||||
<artifactId>qbit-mobile-scanners-reactor</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>com.kingsrook.qbits</groupId>
|
||||
<artifactId>qbit-mobile-scanners</artifactId>
|
||||
<version>${revision}</version>
|
||||
<name>QQQ Mobile Scanners</name>
|
||||
<description>Approved mobile devices and native QQQ barcode capture processes.</description>
|
||||
<url>https://git.kof22.com/QRun-IO/qbit-mobile-scanners</url>
|
||||
<scm>
|
||||
<connection>scm:git:https://git.kof22.com/QRun-IO/qbit-mobile-scanners.git</connection>
|
||||
<developerConnection>scm:git:ssh://git@git.kof22.com:22/QRun-IO/qbit-mobile-scanners.git</developerConnection>
|
||||
<url>https://git.kof22.com/QRun-IO/qbit-mobile-scanners</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>Gitea</system>
|
||||
<url>https://git.kof22.com/QRun-IO/qbit-mobile-scanners/issues</url>
|
||||
</issueManagement>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-bom-pom</artifactId>
|
||||
<version>${qqq.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-middleware-javalin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-module-rdbms</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.2.224</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-module-postgres</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>1.21.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.7.14</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.11.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>14.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<configLocation>${maven.multiModuleProjectDirectory}/checkstyle/checkstyle.xml</configLocation>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>checkstyle</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -7,7 +7,7 @@
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<qqq.version>4.1.0-RC.26</qqq.version>
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
@@ -34,7 +34,7 @@
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-frontend-next</artifactId>
|
||||
<version>1.0.0-RC.38</version>
|
||||
<version>1.0.0-RC.35</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
@@ -78,7 +78,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.2</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<qqq.logger.logSessionId.disabled>true</qqq.logger.logSessionId.disabled>
|
||||
|
||||
+1
-1
@@ -773,7 +773,7 @@ class MobileHttpAcceptanceTest
|
||||
}
|
||||
}
|
||||
assertNotNull(mobile);
|
||||
assertEquals("1.6.0", mobile.getString("version"));
|
||||
assertEquals("1.5.0", mobile.getString("version"));
|
||||
assertEquals("/qbit/mobile-scanners", mobile.getString("pathPrefix"));
|
||||
var openApiResponse = request("GET", "/qqq/v1/openapi.json", null, null, device);
|
||||
assertEquals(200, openApiResponse.statusCode());
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ Scans, sessions, bindings and Echo scans are **kept indefinitely** by default. T
|
||||
|
||||
## Database migration beyond H2
|
||||
|
||||
The supplied, tested scripts are H2: `base/src/main/resources/db/mobile-scanners-h2.sql` and the Echo `echo-h2.sql`. Other backends are unsupported and untested here; a host that uses one **owns the equivalent migration**; do not assume `ADD COLUMN IF NOT EXISTS` or the column types. Additive columns that older databases need before running current servers: on `mobileScan`, nullable `aimIdentifier` (`VARCHAR(3)`) and `rawDataBase64`; on Echo, nullable `echo_scan.aimIdentifier`, `rendererValue` and `humanReadable`, and **`echo_run.copies`, which is `INT NOT NULL DEFAULT 1`** (existing runs keep one copy), so it is not nullable and the equivalent migration must supply the default. Echo also has nullable template columns (`templateId`, `templateRevisionId`) in `echo-h2.sql`. Test the migration on a copy, and snapshot first.
|
||||
The supplied, tested scripts are H2: `src/main/resources/db/mobile-scanners-h2.sql` and the Echo `echo-h2.sql`. Other backends are unsupported and untested here; a host that uses one **owns the equivalent migration**; do not assume `ADD COLUMN IF NOT EXISTS` or the column types. Additive columns that older databases need before running current servers: on `mobileScan`, nullable `aimIdentifier` (`VARCHAR(3)`) and `rawDataBase64`; on Echo, nullable `echo_scan.aimIdentifier`, `rendererValue` and `humanReadable`, and **`echo_run.copies`, which is `INT NOT NULL DEFAULT 1`** (existing runs keep one copy), so it is not nullable and the equivalent migration must supply the default. Echo also has nullable template columns (`templateId`, `templateRevisionId`) in `echo-h2.sql`. Test the migration on a copy, and snapshot first.
|
||||
|
||||
## Demo-only file adapters
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
| Android host libraries | Published development libraries from source `0ae2101`: SDK run 3634 passed and artifacts verified. The scanner application's newer source and signed candidate are recorded below. |
|
||||
| Current cohort tests | Combined five-module `verify` (2026-11-05): 196 server tests (53 / 8 / 22 / 74 / 39), zero failures, errors and skips, zero Checkstyle violations, with qualified private owner dependencies. Android 232 unit tests and lint pass. Inherited report-only guardrail findings remain visible. |
|
||||
| Storage integrity and recovery | `PrivateObjectFilesTest` concurrent-writer and dot-bucket regressions; `EchoDemoAcceptanceTest.restoredSnapshotKeepsScanAndRetainedFileAndRevertedApprovalStateIsReaudited` is the isolated local-demo recovery acceptance (stopped H2 plus object snapshot/restore, `RecordFilesTables.FILE` relationship and byte hashes). See [operations](OPERATIONS.md). |
|
||||
| Local runtime | One server using the tested development aggregate: public QQQ SNAPSHOT, current Collaboration, scoped local Record Files and qualified document inputs, plus Printing 1.0.0. API 1.10, mobile 1.5, printing 2.3, mobile-record-files 1.0; existing data preserved. Final immutable public-cohort qualification remains open. |
|
||||
| Local runtime | One server on public QQQ RC.21 and Printing 1.0.0; API 1.10, mobile 1.5, printing 2.3, mobile-record-files 1.0; existing data preserved. |
|
||||
| Device and admin processes | Enrollment, approval and revocation work from a single record and from bulk selection (checked rows, select-all, first N), with confirmation and visible results, covered by HTTP and browser E2E tests. Earlier browser run: 15 cases. |
|
||||
| Approved-scanner photos | Host-only `quarantineCapturedFiles=false` makes an approved device's captured JPEG/PNG `AVAILABLE`; other intake stays `QUARANTINED`. `record-files.release` is admin-only. Root-reported: 69 owner and 197 scanner/Echo tests passed, 13 focused Android tests passed, Checkstyle passed. A synthetic gallery PNG from the signed MC9400 app was `AVAILABLE` with exact parent/type/size/SHA-256. No camera-hardware or new full-preview proof. Depends on the unmerged Record Files owner PR 1. |
|
||||
| Hardware | TC22 manual tests: operator-reported pass on November 4 (no per-case artifacts). MC9400 physical trigger done: Saved scan with backend EMDK CODE128/AIM/raw bytes and attribution confirmed (the barcode was not the requested literal). |
|
||||
| Hardware | TC22 manual tests: operator-reported pass on November 4 (no per-case artifacts). MC9400 configured and approved; trigger check pending. |
|
||||
|
||||
## Open gates
|
||||
|
||||
@@ -21,12 +20,12 @@ The maintained server and existing TC22 app now run the GS1, rich test-data and
|
||||
|
||||
| Gate | What is still required |
|
||||
| --- | --- |
|
||||
| Public dependency cohort | Public, coherent Generation/bridges/Record Files/Scripting artifacts from their owner; adoption of the Core/Collaboration/Next UI foundations when released. Today these are qualified owner inputs, and the current local aggregate uses public Core SNAPSHOT, current Collaboration and a local Record Files change, not a final public cohort. |
|
||||
| Public dependency cohort | Public, coherent Generation/bridges/Record Files/Scripting artifacts from their owner; adoption of the Core/Collaboration/Next UI foundations when released. Today these are qualified owner inputs. |
|
||||
| Release | Retest the full gate when the final public dependency cohort is adopted, with a reviewed release manifest; Maven publication stays disabled until then. Redesign of the shared CI pipeline is outside this scope. |
|
||||
| Signing and distribution | Done: QRun key with backup, signed Android 1.0.1 (code 3) built from the merged PR 15 source tree and installed in place on an MC9400 (installed bytes match; login/enrollment preserved; Scan Capture reopened; HTTPS connected). Open: public dependencies, signing-APK download publication and final distribution. No signing CI. |
|
||||
| Signing and distribution | Done: QRun key with backup, signed Android 1.0.1 (code 3) built from the merged PR 15 source tree and installed in place on an MC9400 (installed bytes match; login/enrollment preserved; Scan Capture reopened; HTTPS connected). Open: MC9400 physical trigger scan, public dependencies and final distribution. No signing CI. |
|
||||
| Deployment | HTTPS and the host's identity provider. Single-instance procedure, recovery and default-indefinite, host-owned retention guidance is in [operations](OPERATIONS.md); isolated local-demo recovery acceptance has passed. Enterprise object-store/HA and non-H2 databases are unsupported and unqualified options, not release tasks. The HTTP loopback demo is not a production deployment. |
|
||||
| Provider authentication | Native OAuth2 requires UI API 1.10 native-session and nonce-validation support on the server (verified in the Android source). Shared Authenticator server configuration is verified (trusted HTTPS, API 1.10, scanner and printing extensions and channels, exact callbacks, REQUIRED nonce). Still open: native Authentik login, logout and account switching on a handheld (needs the MC9400 wireless-debugging endpoint). No native-auth pass is claimed. The Printing client nonce fix (PR 11, `443f642`; 352 tests and build passed) awaits hosted Core. |
|
||||
| Further device qualification | MDM-applied managed configuration remain unverified. Company profile/wallpaper is separate tracked scope, not a blocker for this release goal. The TC22 camera, GPS and screen-viewing checks are covered by the accepted operator group report; no separate per-case evidence is claimed or required again for that demo. |
|
||||
| Provider authentication | Native OAuth2 requires UI API 1.10 native-session and nonce-validation support on the server (verified in the Android source). Still open: native Authentik login, logout and account switching on a handheld. No such handheld test is claimed. |
|
||||
| Further device qualification | MC9400 physical trigger check and MDM-applied managed configuration remain unverified. Company profile/wallpaper is separate tracked scope, not a blocker for this release goal. The TC22 camera, GPS and screen-viewing checks are covered by the accepted operator group report; no separate per-case evidence is claimed or required again for that demo. |
|
||||
| Barcode fidelity | Echo's supported profiles are documented ([limits](../examples/echo/README.md#fidelity-and-limits)); The committed source supports bounded GS1-128; physical print/rescan remains open. Other GS1, ECI, structured and binary profiles remain refused. No universal barcode-reproduction claim. |
|
||||
| Final reviews | Reconcile the dated security, architecture and standards reports to the final revision; they are scoped historical reviews, not a fresh exhaustive scan. A dated static review of base `a9eae04`, its supplement and its scope and limits are in [review reconciliation](REVIEW-RECONCILIATION-2026-11-05.md); it is not an audit rating. |
|
||||
|
||||
|
||||
+4
-11
@@ -22,29 +22,22 @@ The maintained composed Echo server and **existing TC22 app** were updated in pl
|
||||
|
||||
Use **Test Data → Test Orders → a record → Actions → Add photo**. Details, Items, History and Photos tabs provide direct access. Search/filter/count and Back preserve table context. Approved photos have thumbnails/previews; quarantined uploads remain listed as awaiting review. Ordinary read/attach permissions still apply.
|
||||
|
||||
**Approved-scanner photos.** The Echo host sets Record Files `quarantineCapturedFiles=false`, so a JPEG/PNG captured by a currently approved device is `AVAILABLE` at once. Uploads, imports and attachment-panel files stay `QUARANTINED`. Parent tables are Echo scans plus the test orders, items and events; the scanner's existing `.attach` grants are retained. Only `admin` gains `record-files.release`; scanner grants are unchanged. Three earlier quarantined photos were released through the audited admin Release process. The server's current aggregate was built from public Core SNAPSHOT, current Collaboration, the scoped local Record Files change and qualified private document inputs, not a final public cohort. The scoped Record Files change is [owner PR 1](https://git.kof22.com/QRun-IO/qbit-record-files/pulls/1) (policy commit `3f08c584`), open and unmerged; its public CI currently fails an enrollment check that the coordinator owns, so neither the check nor its merge gates are changed here. No version or POM was guessed.
|
||||
|
||||
The [local demo](LOCAL-DEMO.md) source defaults remain QQQ `4.1.0-RC.21` and Printing `1.0.0` pending the public-cohort update; the maintained runtime uses the verified development aggregate described above. Host port is `57832`. The TC22 development app retains its loopback forwarding; the signed MC9400 app connects through trusted HTTPS. Contract versions remain UI API 1.10, mobile-scanners 1.5, printing 2.3 and mobile-record-files 1.0. This is local development qualification, not a customer production deployment.
|
||||
The [local demo](LOCAL-DEMO.md) uses public QQQ `4.1.0-RC.21`, released Printing `1.0.0`, and qualified document/files/scripting owner inputs. Host port is `57832`; device port 8080 forwards to it, retaining the app URL `http://127.0.0.1:8080`. Contract versions remain UI API 1.10, mobile-scanners 1.5, printing 2.3 and mobile-record-files 1.0. This loopback demo is separate from HTTPS production deployment.
|
||||
|
||||
## Verification
|
||||
|
||||
- Photo/admin change set (root-reported, not rerun in this review): 69 owner tests and 197 scanner/Echo tests passed (runs of 31, 158 and 8), 13 focused Android tests passed, and the relevant Checkstyle passed. These groupings differ from the module split below, so no per-module counts are claimed. Public immutable dependency qualification is still pending.
|
||||
- Live evidence: a fresh synthetic gallery PNG uploaded from the production-signed MC9400 app returned "Saved photo", and the server showed `AVAILABLE` with the exact parent, type, size and SHA-256. An older photo's Available state, thumbnail and Preview control were observed. The new photo's full preview was not clicked because ADB disconnected. No camera-hardware or full-preview proof is claimed.
|
||||
- The earlier combined five-module `verify` (2026-11-05, base `9e8685f` plus the storage fixes) passed **196 server tests** with zero failures, errors and skips and zero Checkstyle violations: scanner 53, base demo 8, mobile Record Files 22, Echo 74, Echo demo 39. It used qualified private owner dependencies; there is no public-dependency or physical-output qualification, and the gate must be repeated when the public cohort is adopted. The new build parent's report-only schema-location/contract-test findings remain visible.
|
||||
- Storage/recovery PR 21 is merged (`59959247`), with bounded cold-restore and race proof complete. Website 0.1.17 is complete. Evidence: `PrivateObjectFilesTest.concurrentSameKeyWritersLeaveOneWinnersBytesAndMetadata` and `dotBucketsAreRefusedAndValidBucketsStillWork`; recovery acceptance `EchoDemoAcceptanceTest.restoredSnapshotKeepsScanAndRetainedFileAndRevertedApprovalStateIsReaudited` (details in [OPERATIONS](OPERATIONS.md#isolated-local-demo-recovery-acceptance-automated-passed)).
|
||||
- The combined five-module `verify` (2026-11-05, base `9e8685f` plus the storage fixes) passed **196 server tests** with zero failures, errors and skips and zero Checkstyle violations: scanner 53, base demo 8, mobile Record Files 22, Echo 74, Echo demo 39. It used qualified private owner dependencies; there is no public-dependency or physical-output qualification, and the gate must be repeated when the public cohort is adopted. The new build parent's report-only schema-location/contract-test findings remain visible.
|
||||
- Storage evidence: `PrivateObjectFilesTest.concurrentSameKeyWritersLeaveOneWinnersBytesAndMetadata` and `dotBucketsAreRefusedAndValidBucketsStillWork`; recovery acceptance `EchoDemoAcceptanceTest.restoredSnapshotKeepsScanAndRetainedFileAndRevertedApprovalStateIsReaudited` (details in [OPERATIONS](OPERATIONS.md#isolated-local-demo-recovery-acceptance-automated-passed)).
|
||||
- Android passed **232 unit tests**, lint with **0 errors/0 warnings**, and the debug APK build. E2E APK/instrumentation builds and eight runner guard tests also passed.
|
||||
- Isolated MC9400 native acceptance passed search/filter/paging/Back, grouped/related records, camera/gallery upload, parent-scoped saved-photo list, approved preview, rotation, pending-upload navigation protection and forced-logout cleanup. All requests matched the semantic API. Process-photo regression also passed.
|
||||
- The final date-only correction received unit/lint/build checks and actual TC22 verification. Actual-device screenshots confirm Actions → Add photo, dates/timezones, currency, related tabs, photo empty state and return to page two. Synthetic camera/gallery inputs in automated acceptance are not a new operator camera report.
|
||||
- Earlier 135/188/198/377-test cohorts and 15 browser E2E cases are historical evidence, not a fresh run against future public dependencies. The snapshot source comparison applies to its original revision only.
|
||||
- 2026-11-06, branch `fix/refresh-device-versions`: the MC9400 in-place 1.0.0 to 1.0.1 update left the device record and every later scan reporting `appVersion` 1.0.0, because only enrollment ever wrote `manufacturer`/`model`/`osVersion`/`appVersion` and no later client request carried them. Extension 1.6 adds the same optional fields to `MobileScannersHeartbeatRequestV1`; the heartbeat refreshes the device record when a value differs and scans copy the refreshed record (see [UI-API](UI-API.md)). The Android host change (send `osVersion`/`appVersion` on heartbeat) is on the same-named branch in the Android repository; devices need that client build before their versions refresh. Root module: 56 tests, zero Checkstyle violations, new baseline `mobile-scanners-1.6.0.yaml`.
|
||||
|
||||
## Handhelds and remaining limits
|
||||
|
||||
Previous TC22 APK SHA-256: `F71033C835AC3EB361A04D78C842947C5A04C85CE1AB1B999AA8CEFBFC9D7A95`; prior preview hashes are in [history](history/RICH-RECORDS-2026-11-05.md).
|
||||
|
||||
Signed Android `1.0.1` (code 3) was built from the identical merged source tree (PR 15) and installed in place on the MC9400. The installed bytes match the built APK, login and enrollment were preserved, the authorized Scan Capture screen reopened, and the HTTPS connection was established. The MC9400 physical trigger is **done**: an actual operator trigger produced a Saved scan, and the backend confirmed EMDK CODE128, AIM and raw bytes with server-derived attribution. The barcode scanned was not the literal string requested, so no exact-test-string claim is made.
|
||||
|
||||
Shared Authenticator server configuration is verified: real trusted HTTPS, UI API 1.10, both scanner and printing extensions and channels, exact callbacks and a REQUIRED nonce. Native client login, logout and account switching are **not yet tested** (this needs the MC9400 wireless-debugging endpoint), so no native-auth pass is claimed. The Printing client required-nonce fix (PR 11, `443f642`; 352 Windows/CLI tests and build passed) awaits hosted Core. Pending: native Authentik login/logout/account switching, the final public Core/Collaboration/document/files/scripting/bridge artifacts, a public-cohort rerun, GS1 physical print/rescan, signing-APK download publication and owned cleanup.
|
||||
Signed Android `1.0.1` (code 3) was built from the identical merged source tree (PR 15) and installed in place on the MC9400. The installed bytes match the built APK, login and enrollment were preserved, the authorized Scan Capture screen reopened, and the HTTPS connection was established. Pending: the MC9400 physical trigger scan, native Authentik login/logout/account switching, the public dependency cohort and final distribution.
|
||||
|
||||
The November 4 TC22 operator group pass remains accepted and is not requested again. Physical GS1 print/rescan, provider callback acceptance and fleet rollout remain open. Echo supports only its documented [barcode profiles](../examples/echo/README.md#fidelity-and-limits). Company profile/wallpaper is separate tracked scope, not a blocker for this release goal.
|
||||
|
||||
|
||||
+3
-5
@@ -9,8 +9,6 @@ Open work only, as of **2026-11-05**. Present status is in [session state](SESSI
|
||||
|
||||
Note: redesign of the shared CI pipeline is outside this scanner/local Echo scope and is not tracked here; the local demo does not depend on it.
|
||||
|
||||
- [ ] **Record Files `quarantineCapturedFiles`.** The Echo host (`EchoDemo`) and the optional integration test already call/require `RecordFilesQBitConfig.withQuarantineCapturedFiles(Boolean)` (nullable, null inherits `quarantineNewFiles`; applies only to CAPTURE intake with a provider-verified device identity). The owner's scoped change (policy commit `3f08c584`, PR 1) is open and unmerged, and its CI currently fails a not-enrolled check owned by the coordinator; do not change CI or weaken merge gates. Adopt the released version as a reviewed pin once public; no coordinate is known, so none was guessed and this source builds only against the local owner input until then.
|
||||
|
||||
## This repository
|
||||
|
||||
- [ ] Qualify GS1 template/media setup and **physical print/rescan** of the requested label profile. Software duplication, native acceptance and maintained-demo adoption are complete.
|
||||
@@ -23,13 +21,13 @@ Retention stays indefinite by default and any change is a host-owned policy ([op
|
||||
|
||||
## Hardware and device follow-up
|
||||
|
||||
- [ ] Native Authentik login, logout and account switching on a handheld (not yet tested; needs the MC9400 wireless-debugging endpoint). The shared Authenticator server configuration is verified; the Printing client nonce fix (PR 11) awaits hosted Core. The MC9400 physical trigger check is done ([session state](SESSION-STATE.md#handhelds-and-remaining-limits)).
|
||||
- [ ] Optional: click the full preview of the newly uploaded gallery photo on a handheld (not observed because ADB disconnected). No camera-hardware proof is claimed.
|
||||
- [ ] **MC9400:** one physical trigger scan, then confirm the backend record. The signed 1.0.1 (code 3) build is installed in place and approved ([session state](SESSION-STATE.md#handhelds)).
|
||||
- [ ] Native Authentik login, logout and account switching on a handheld (not yet tested).
|
||||
- [ ] Optional: capture per-case evidence (photos, logs, a scanned-back label) on a future run. The November 4 operator pass is accepted as is and is not to be requested again.
|
||||
|
||||
## Release (deliberately last)
|
||||
|
||||
- [ ] Final distribution of the signed 1.0.1 build and the public dependencies it waits on. Signing is done: the build was installed in place on an MC9400 through ADB, preserved enrollment, and reopened Scan Capture against the HTTPS server. Remaining device checks are listed above; no automatic APK-signing CI is qualified. Also open: signing-APK download publication, owned cleanup, and a rerun of the public cohort with the final public Core/Collaboration/document/files/scripting/bridge artifacts.
|
||||
- [ ] Final distribution of the signed 1.0.1 build and the public dependencies it waits on. Signing is done: the build was installed in place on an MC9400 through ADB, preserved enrollment, and reopened Scan Capture against the HTTPS server. Remaining device checks are listed above; no automatic APK-signing CI is qualified.
|
||||
- [ ] Company profile/wallpaper is a separate tracked scope and not a blocker for this bounded release goal.
|
||||
- [ ] HTTPS deployment by the host (any non-H2 migration is host-owned and unsupported here) and the remaining gates in [production readiness](PRODUCTION-READINESS.md).
|
||||
|
||||
|
||||
+2
-4
@@ -1,6 +1,6 @@
|
||||
# Mobile Scanners semantic UI API
|
||||
|
||||
Mobile Scanners is an independently versioned QQQ UI API extension. `MobileScannersQBitProducer` registers the `mobile-scanners` contract, currently **1.6.0** (core UI API 1.10 on the maintained local server), through `MiddlewareSpecExtensionsMetaData`. The framework generates its routes, discovery advertisement and merged OpenAPI from the same endpoint specs. Optional operator-consented device-screen viewing is described in [DEVICE-SCREEN-VIEWING.md](DEVICE-SCREEN-VIEWING.md); app-content remains the default. There is no separate `/mobile/v1` API or legacy alias.
|
||||
Mobile Scanners is an independently versioned QQQ UI API extension. `MobileScannersQBitProducer` registers the `mobile-scanners` contract, currently **1.5.0** (core UI API 1.10 on the maintained local server), through `MiddlewareSpecExtensionsMetaData`. The framework generates its routes, discovery advertisement and merged OpenAPI from the same endpoint specs. Optional operator-consented device-screen viewing is described in [DEVICE-SCREEN-VIEWING.md](DEVICE-SCREEN-VIEWING.md); app-content remains the default. There is no separate `/mobile/v1` API or legacy alias.
|
||||
|
||||
The host must also install `MobileScannersRouteProvider` on the same server. This provider binds verified device headers to the current request; it does not register additional business routes. Keep the versioned QQQ routes enabled. The qbit registers the `android` client channel while preserving the host's existing channel policies. The demo disables legacy unversioned middleware routes.
|
||||
|
||||
@@ -36,8 +36,6 @@ Public discovery, OpenAPI, branding and connectivity ignore stale device headers
|
||||
|
||||
Enrollment takes `MobileScannersEnrollRequestV1`: required canonical UUID `installationId`, optional `displayName`, `manufacturer`, `model`, `osVersion` and `appVersion` strings, each at most 200 characters. The JSON request body is limited to 4096 characters. A duplicate installation returns HTTP 409 and never rotates or discloses its existing credential. A new installation starts `PENDING` and receives its private `deviceToken` once.
|
||||
|
||||
Since extension 1.6, `MobileScannersHeartbeatRequestV1` also accepts the same optional `manufacturer`, `model`, `osVersion` and `appVersion` strings (at most 200 characters, 400 otherwise). An approved device's record is updated only when a sent value differs; omitted, null or blank values leave the enrolled values unchanged. Scan events copy the device record at save time, so an in-place app or OS update is reflected on the next heartbeat and every later scan, while earlier scans keep the versions that produced them. The Android host sends `osVersion` and `appVersion` on every heartbeat.
|
||||
|
||||
Send `X-QQQ-Device-Id` and `X-QQQ-Device-Token` on authenticated device/core metadata, widget and process requests to this same origin. The device ID is a UUID; the token is private and at most 128 characters. These headers supplement the authenticated user session. They never replace user permission checks. Never put a token in metadata, URLs, process values, screenshots, logs or fixtures; never forward credentials to a branding asset origin. Store the issued credential privately. Only its digest is stored server-side.
|
||||
|
||||
`devices/current` returns `deviceId`, `displayName` and `status`, never a token. `PENDING` and `REVOKED` devices may read their status. Scanner access still requires `APPROVED`, checked when launching and saving, including asynchronous/resumed execution. Device approval/revocation uses the ordinary QQQ processes, including single-record and bulk selections.
|
||||
@@ -83,7 +81,7 @@ Schema migration (H2, idempotent, nullable): `ALTER TABLE mobileScan ADD COLUMN
|
||||
|
||||
## Contract checks and compatibility
|
||||
|
||||
The published fragment is [mobile-scanners.yaml](../base/src/main/resources/openapi/qqq-v1/mobile-scanners.yaml); the initial release baseline is [mobile-scanners-1.0.0.yaml](../base/src/test/resources/openapi/mobile-scanners-1.0.0.yaml), with additional frozen baselines such as [mobile-scanners-1.4.0.yaml](../base/src/test/resources/openapi/mobile-scanners-1.4.0.yaml) (the contract immediately before the 1.5.0 capture metadata) and [mobile-scanners-1.5.0.yaml](../base/src/test/resources/openapi/mobile-scanners-1.5.0.yaml), the frozen 1.5.0 release snapshot that later changes are checked against. `MobileScannersApiContractTest` rejects generated-document drift, unresolved contract structure, incompatible baseline changes and missing version bumps using QQQ's shared contract checker. Object required fields and scanner numeric bounds are standard OpenAPI keywords, added by small Schema subclasses because RC20's base model does not expose those setters.
|
||||
The published fragment is [mobile-scanners.yaml](../src/main/resources/openapi/qqq-v1/mobile-scanners.yaml); the initial release baseline is [mobile-scanners-1.0.0.yaml](../src/test/resources/openapi/mobile-scanners-1.0.0.yaml), with additional frozen baselines such as [mobile-scanners-1.4.0.yaml](../src/test/resources/openapi/mobile-scanners-1.4.0.yaml) (the contract immediately before the 1.5.0 capture metadata) and [mobile-scanners-1.5.0.yaml](../src/test/resources/openapi/mobile-scanners-1.5.0.yaml), the frozen 1.5.0 release snapshot that later changes are checked against. `MobileScannersApiContractTest` rejects generated-document drift, unresolved contract structure, incompatible baseline changes and missing version bumps using QQQ's shared contract checker. Object required fields and scanner numeric bounds are standard OpenAPI keywords, added by small Schema subclasses because RC20's base model does not expose those setters.
|
||||
|
||||
For an intentional contract edit, update specs/schemas and the extension semantic version, then regenerate only the current fragment:
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Date: 2026-11-02. Scope: `examples/echo/demo/**`. Source checkpoint, not a relea
|
||||
|
||||
`EchoDemo` extends `MobileScannersDemo` (database, `scanner`/`admin` accounts, native server) and composes Collaboration, Record Files, Printing, Document Generation and `EchoHost.install` from their public classes on one private H2 file (`WRITE_DELAY=0`). Composition runs under a scoped system context that is restored afterwards, then `QInstanceEnricher` enriches the instance, because the server only validates and the enricher registers Collaboration's record-feature permissions. `LocalFilesystemAttachmentStorage` implements the attachment owner's storage SPI over `PrivateObjectFiles` (hashed keys, temp-file-then-link, no overwrite) and adds no policy. `TrustedLocalEchoDemo` is the explicit developer launcher; the production `EchoDemo` default fails closed. See `README.md` for build, run and environment.
|
||||
|
||||
Authentication is the existing demo password/session module plus exact grants. `scanner`: `echo.use`, `printing_operator`, `document-generation.view|generate|print`, `record-files.view|manage`, `echoScan.attach` and the `printing_tenant` row key (replaced, never appended, on each validation); then `CollaborationSecurity.applyToSession`. `admin` additionally: `printing_admin`, `document-generation.configure|publish`, `record-files.release` (so approved captured photos release through the normal audited process). The scanner never gets release; no Record Files configure/review/audit for anyone.
|
||||
Authentication is the existing demo password/session module plus exact grants. `scanner`: `echo.use`, `printing_operator`, `document-generation.view|generate|print`, `record-files.view|manage`, `echoScan.attach` and the `printing_tenant` row key (replaced, never appended, on each validation); then `CollaborationSecurity.applyToSession`. `admin` additionally: `printing_admin`, `document-generation.configure|publish`. No Record Files release/configure/audit for anyone.
|
||||
|
||||
## Test isolation
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ There is **no default port**: pass one as the argument or set `ECHO_DEMO_PORT`.
|
||||
|
||||
## Status
|
||||
|
||||
The demo and Echo library tests pass with Checkstyle clean (counts change per run; see [session state](../../../docs/SESSION-STATE.md) for the latest reported results). The QQQ default is 4.1.0-RC.21 and Printing defaults to released 1.0.0; the other owner qbits remain qualified owner inputs until their public release. The composed acceptance test passes with a controlled synthetic renderer and a simulated Printing queue, so it is **not physical output**. TC22 physical acceptance is separately operator-reported as passing (November 4, group report). Not production-ready and not a public SDK release. The dated [`CLAUDE-HANDOFF.md`](CLAUDE-HANDOFF.md) is a historical checkpoint.
|
||||
The demo and Echo library tests pass with Checkstyle clean (current cohort: Echo 68, composed demo 35 tests; see [session state](../../../docs/SESSION-STATE.md)). The QQQ default is 4.1.0-RC.21 and Printing defaults to released 1.0.0; the other owner qbits remain qualified owner inputs until their public release. The composed acceptance test passes with a controlled synthetic renderer and a simulated Printing queue, so it is **not physical output**. TC22 physical acceptance is separately operator-reported as passing (November 4, group report). Not production-ready and not a public SDK release. The dated [`CLAUDE-HANDOFF.md`](CLAUDE-HANDOFF.md) is a historical checkpoint.
|
||||
|
||||
## Trusted local development launcher
|
||||
|
||||
@@ -88,7 +88,7 @@ The legacy `ECHO_TEMPLATE_ID`, `ECHO_TEMPLATE_MEDIA_ID` and `ECHO_TEMPLATE_MEDIA
|
||||
|
||||
## Accounts and permissions
|
||||
|
||||
`scanner` receives exactly: `echo.use`, `printing_operator`, `document-generation.view|generate|print`, `record-files.view|manage` (manage is the owner's intake permission), `.attach` on `echoScan` and the three mobile test-data tables (`testOrder`, `testOrderItem`, `testOrderEvent`) and the `printing_tenant` row key. `admin` receives the same plus `printing_admin` (Printing's native pairing/approval/setup processes) and `document-generation.configure|publish` to prepare templates. The scanner never gets these. Only `admin` also receives `record-files.release`, so approved captured photos can be released through the normal audited process; nobody gets Record Files configure/review/audit. Scans still need an enrolled and approved device, so use the existing mobile enrollment flow.
|
||||
`scanner` receives exactly: `echo.use`, `printing_operator`, `document-generation.view|generate|print`, `record-files.view|manage` (manage is the owner's intake permission) and the `printing_tenant` row key. `admin` receives the same plus `printing_admin` (Printing's native pairing/approval/setup processes) and `document-generation.configure|publish` to prepare templates. The scanner never gets these, and nobody gets Record Files release/configure/audit. Scans still need an enrolled and approved device, so use the existing mobile enrollment flow.
|
||||
|
||||
## Operator order
|
||||
|
||||
@@ -101,11 +101,10 @@ The legacy `ECHO_TEMPLATE_ID`, `ECHO_TEMPLATE_MEDIA_ID` and `ECHO_TEMPLATE_MEDIA
|
||||
The host also installs the existing `qbit-mobile-scanners-record-files` integration, so an approved scanner can attach photos to one of its own retained Echo scans. Nothing new is served: Record Files' registered, versioned `record-files` upload API (`/qqq/v1/qbit/record-files/...`) and the independently versioned `mobile-record-files` widget vocabulary are advertised in `/qqq/v1/version`, behind the same native auth and device guards.
|
||||
|
||||
- **Process:** `echoScanPhotos` ("Echo scan photos"), listed in the Echo app. It requires `echo.use`, `echoScan.attach` and a verified approved device. The first step lists the actor's own scans (the table's record security lock decides; label is the barcode and type, never the record id). The server then re-reads the chosen scan through the collaboration owner's visibility and `attach` checks and builds the `RECORD_FILES_CAPTURE` widget from the record that check returned, on the fixed `echoScan` table. The client never supplies a table or record reference, and rendering the widget directly names no parent. Record Files authorizes the parent again on every upload operation.
|
||||
- **Policy:** JPEG/PNG only, 20 MiB per file, up to four files, 256 KiB chunks, private staging under the demo's `objects` directory (separate staging namespace). The Echo host sets Record Files' `quarantineCapturedFiles=false` (leaving `quarantineNewFiles=true` and the generated-file setting unchanged), so a JPEG/PNG saved from this process by a device that `MobileCaptureIdentityProvider` currently verifies as approved is registered `AVAILABLE` and can be previewed immediately. The same upload API on any other host, and every upload, import or attachment-panel file here, stay `QUARANTINED` until released. This is a host trust decision, not a content scan or human review; no release event is written and review status is unchanged. **Requires a Record Files version that contains `RecordFilesQBitConfig.withQuarantineCapturedFiles(Boolean)`. The owner's change is an open, unmerged PR; this checkout's dependency pin has not been updated and builds only against the local owner input until a public version is pinned.** Files already uploaded stay `QUARANTINED` until released through the normal `record_files_file_record_files_release` process.
|
||||
- **Test-data records:** the host also registers the test orders, items and events as Record Files parents, so a scanner can add photos from a record's Actions menu. The same approved-device policy and authorization re-check apply. Release of any quarantined file is admin-only (`record-files.release`).
|
||||
- **Needs a real scan first (for the `echoScanPhotos` process):** the list is empty until the scanner has Echo scans. Nothing is seeded outside this module's tests.
|
||||
- **Policy:** JPEG/PNG only, 20 MiB per file, up to four files, 256 KiB chunks, private staging under the demo's `objects` directory (separate staging namespace). Retained originals follow the existing Record Files quarantine setting.
|
||||
- **Needs a real scan first:** the list is empty until the scanner has Echo scans. Nothing is seeded outside this module's tests.
|
||||
- **Existing databases:** the Record Files upload tables are added by the same tolerated-reapply schema step; plan the migration for a database from another version.
|
||||
- **Not claimed:** one synthetic gallery PNG uploaded from the signed MC9400 app was observed `AVAILABLE` with matching parent, type, size and SHA-256 (see [session state](../../../docs/SESSION-STATE.md)). No camera-hardware capture and no full preview of that photo are claimed.
|
||||
- **Not claimed:** no real photo upload, native capture or device run has been verified here. That needs the Android host against this server.
|
||||
|
||||
## Existing databases
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<qqq.version>4.1.0-RC.26</qqq.version>
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
<mobile.version>0.1.0-SNAPSHOT</mobile.version>
|
||||
<echo.version>0.1.0-SNAPSHOT</echo.version>
|
||||
<generation.version>1.1.0-RC.1</generation.version>
|
||||
<generation.version>0.1.0-SNAPSHOT</generation.version>
|
||||
<renderer.version>${generation.version}</renderer.version>
|
||||
<printing.version>1.2.0-RC.1</printing.version>
|
||||
<recordfiles.version>0.4.0-RC.1</recordfiles.version>
|
||||
<printing.version>1.0.0</printing.version>
|
||||
<recordfiles.version>0.1.0-SNAPSHOT</recordfiles.version>
|
||||
<mobilerecordfiles.version>0.1.0-SNAPSHOT</mobilerecordfiles.version>
|
||||
<collaboration.version>1.2.0-RC.1</collaboration.version>
|
||||
<collaboration.version>0.1.0-record-files-SNAPSHOT</collaboration.version>
|
||||
</properties>
|
||||
<dependencyManagement><dependencies>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-bom-pom</artifactId><version>${qqq.version}</version><type>pom</type><scope>import</scope></dependency>
|
||||
@@ -40,14 +40,14 @@
|
||||
<dependency><groupId>com.kingsrook.qbits</groupId><artifactId>qbit-mobile-scanners-record-files</artifactId><version>${mobilerecordfiles.version}</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qbits</groupId><artifactId>qbit-collaboration</artifactId><version>${collaboration.version}</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-backend-module-rdbms</artifactId></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-frontend-next</artifactId><version>1.0.0-RC.38</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-frontend-next</artifactId><version>1.0.0-RC.35</version></dependency>
|
||||
<dependency><groupId>com.h2database</groupId><artifactId>h2</artifactId><version>2.2.224</version></dependency>
|
||||
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>6.0.2</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-engine</artifactId><version>6.0.2</version><scope>test</scope></dependency>
|
||||
</dependencies>
|
||||
<build><plugins>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version><configuration><showWarnings>true</showWarnings><failOnWarning>true</failOnWarning><proc>none</proc><compilerArgs><arg>-Xlint:deprecation</arg><arg>-Xlint:unchecked</arg><arg>-Werror</arg></compilerArgs></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.6</version><configuration><systemPropertyVariables><qqq.logger.logSessionId.disabled>true</qqq.logger.logSessionId.disabled></systemPropertyVariables></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.2</version><configuration><systemPropertyVariables><qqq.logger.logSessionId.disabled>true</qqq.logger.logSessionId.disabled></systemPropertyVariables></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><version>3.8.1</version></plugin>
|
||||
<plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>3.5.0</version><configuration><mainClass>com.kingsrook.examples.echo.demo.EchoDemo</mainClass></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-checkstyle-plugin</artifactId><version>3.6.0</version><dependencies><dependency><groupId>com.puppycrawl.tools</groupId><artifactId>checkstyle</artifactId><version>14.3.0</version></dependency></dependencies><configuration><configLocation>${project.basedir}/../../../checkstyle/checkstyle.xml</configLocation><includeTestSourceDirectory>true</includeTestSourceDirectory><failOnViolation>true</failOnViolation><violationSeverity>warning</violationSeverity></configuration><executions><execution><phase>validate</phase><goals><goal>check</goal></goals></execution></executions></plugin>
|
||||
|
||||
@@ -225,11 +225,6 @@ public class EchoDemo extends MobileScannersDemo implements AutoCloseable
|
||||
RecordFilesQBitConfig recordFiles = new RecordFilesQBitConfig().withBackendName(BACKEND)
|
||||
.withParentTables(List.of(EchoQBitProducer.SCAN_TABLE, MobileTestData.ORDERS, MobileTestData.ITEMS, MobileTestData.EVENTS))
|
||||
.withQuarantineGeneratedFiles(settings.releaseGeneratedFiles() ? Boolean.FALSE : null)
|
||||
// Narrow, host-only opt-in: only CAPTURE intake with the verified approved-device identity from
|
||||
// MobileCaptureIdentityProvider (JPEG/PNG, bounded; see EchoPhotoCapture.uploadConfiguration) is AVAILABLE
|
||||
// on registration. quarantineNewFiles stays true for uploads, imports and attachment-panel files.
|
||||
// Requires the Record Files version that contains withQuarantineCapturedFiles.
|
||||
.withQuarantineCapturedFiles(Boolean.FALSE)
|
||||
.withDownloadConfiguration(new DownloadConfiguration("http://127.0.0.1:" + settings.port() + "/qqq/v1", 20 * 1024 * 1024, 2))
|
||||
.withUploadConfiguration(EchoPhotoCapture.uploadConfiguration());
|
||||
new RecordFilesQBitProducer().withQBitConfig(recordFiles).produce(instance);
|
||||
|
||||
+3
-7
@@ -22,10 +22,7 @@ import com.kingsrook.qqq.backend.core.model.session.QSession;
|
||||
/*******************************************************************************
|
||||
** The existing demo password/session validation plus exactly the grants the
|
||||
** owners' source requires. The validated account selects the role, never a
|
||||
** request field. Only the fixed admin account receives Printing administration,
|
||||
** template configure/publish and Record Files release (so approved scanner photos
|
||||
** can be released through the normal audited process); the scanner receives none
|
||||
** of them, and no one receives Record Files configure or review rights.
|
||||
** request field. Printing and Record Files administration is granted to no one.
|
||||
*******************************************************************************/
|
||||
public class EchoDemoAuthentication extends DemoAuthenticationModule
|
||||
{
|
||||
@@ -43,10 +40,9 @@ public class EchoDemoAuthentication extends DemoAuthenticationModule
|
||||
/**
|
||||
** Admin also gets Printing's own administrator permission, which its native
|
||||
** device pairing/approval/setup processes require, and what is needed to
|
||||
** prepare and publish templates, and Record Files release for approved
|
||||
** captured photos. The scanner never receives these.
|
||||
** prepare and publish templates. The scanner never receives these.
|
||||
*/
|
||||
static final List<String> ADMIN_ADDITIONS = List.of("printing_admin", "document-generation.configure", "document-generation.publish", "record-files.release");
|
||||
static final List<String> ADMIN_ADDITIONS = List.of("printing_admin", "document-generation.configure", "document-generation.publish");
|
||||
|
||||
private static volatile String tenant;
|
||||
|
||||
|
||||
+2
-2
@@ -111,7 +111,7 @@ class EchoDemoSettingsTest
|
||||
{
|
||||
assertEquals(List.of("echo.use", "printing_operator", "document-generation.view", "document-generation.generate", "document-generation.print",
|
||||
"record-files.view", "record-files.manage", "echoScan.attach", "testOrder.attach", "testOrderItem.attach", "testOrderEvent.attach"), EchoDemoAuthentication.SCANNER);
|
||||
assertEquals(List.of("printing_admin", "document-generation.configure", "document-generation.publish", "record-files.release"), EchoDemoAuthentication.ADMIN_ADDITIONS);
|
||||
assertFalse(EchoDemoAuthentication.SCANNER.stream().anyMatch(name -> name.endsWith(".configure") || name.endsWith(".publish") || name.endsWith("admin") || name.endsWith(".release")));
|
||||
assertEquals(List.of("printing_admin", "document-generation.configure", "document-generation.publish"), EchoDemoAuthentication.ADMIN_ADDITIONS);
|
||||
assertFalse(EchoDemoAuthentication.SCANNER.stream().anyMatch(name -> name.endsWith(".configure") || name.endsWith(".publish") || name.endsWith("admin")));
|
||||
}
|
||||
}
|
||||
-6
@@ -179,12 +179,6 @@ class EchoDemoStartupTest
|
||||
assertFalse(scanner.hasPermission("printing_admin") || scanner.hasPermission("document-generation.publish"));
|
||||
assertTrue(admin.hasPermission("printing_admin") && admin.hasPermission("document-generation.publish"));
|
||||
assertFalse(stranger.hasPermission("echo.use") || stranger.hasPermission("printing_operator"));
|
||||
assertTrue(admin.hasPermission("record-files.release"));
|
||||
assertFalse(scanner.hasPermission("record-files.release") || stranger.hasPermission("record-files.release"));
|
||||
assertFalse(admin.hasPermission("record-files.configure") || admin.hasPermission("record-files.review"));
|
||||
// Revalidation keeps the role derived from the validated user, never widening or dropping it.
|
||||
assertTrue(EchoDemoAuthentication.grant(instance, admin).hasPermission("record-files.release"));
|
||||
assertFalse(EchoDemoAuthentication.grant(instance, scanner).hasPermission("record-files.release"));
|
||||
|
||||
HttpResponse<String> version = send(port, "/printing/v1/version", null, null);
|
||||
assertEquals(200, version.statusCode());
|
||||
|
||||
-3
@@ -171,9 +171,6 @@ class EchoPhotoCaptureTest
|
||||
.filter(RecordFilesQBitConfig.class::isInstance).findFirst().orElseThrow();
|
||||
assertEquals(List.of(EchoQBitProducer.SCAN_TABLE, MobileTestData.ORDERS, MobileTestData.ITEMS, MobileTestData.EVENTS), config.getParentTables());
|
||||
assertEquals(Set.of("image/jpeg", "image/png"), config.getUploadConfiguration().limits().acceptedMediaTypes());
|
||||
assertEquals(Boolean.FALSE, config.getQuarantineCapturedFiles(), "approved-device captures are admitted immediately");
|
||||
assertEquals(Boolean.TRUE, config.getQuarantineNewFiles(), "every other origin keeps the quarantine default");
|
||||
assertNull(config.getQuarantineGeneratedFiles(), "the generated-output policy is unchanged");
|
||||
assertTrue(config.getUploadConfiguration().createIdentityProvider() instanceof MobileCaptureIdentityProvider);
|
||||
assertTrue(config.getUploadConfiguration().createStorage() instanceof LocalStagingChunkStorage);
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<qqq.version>4.1.0-RC.26</qqq.version>
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
<mobile.version>0.1.0-SNAPSHOT</mobile.version>
|
||||
<!-- Echo's copies per scan needs a Generation build with the print-copies change (appended copies on
|
||||
DocumentGenerationService.Request and GenerationPorts.PrintRequest, supportsCopies on the printing bridge,
|
||||
migration 20261102-print-copies-h2.sql). Printing 1.0.0 is released and qualified; only the Generation
|
||||
cohort still needs a coherent published input. Until that is published at this coordinate, override
|
||||
generation.version with a coherent build that has it; no private build is named here. -->
|
||||
<generation.version>1.1.0-RC.1</generation.version>
|
||||
<printing.version>1.2.0-RC.1</printing.version>
|
||||
<generation.version>0.1.0-SNAPSHOT</generation.version>
|
||||
<printing.version>1.0.0</printing.version>
|
||||
</properties>
|
||||
<dependencyManagement><dependencies>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-bom-pom</artifactId><version>${qqq.version}</version><type>pom</type><scope>import</scope></dependency>
|
||||
@@ -40,12 +40,12 @@
|
||||
<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><version>42.7.8</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>6.0.2</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-engine</artifactId><version>6.0.2</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-frontend-next</artifactId><version>1.0.0-RC.38</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-frontend-next</artifactId><version>1.0.0-RC.35</version><scope>test</scope></dependency>
|
||||
<dependency><groupId>com.kingsrook.qbits</groupId><artifactId>qbit-mobile-scanners-demo</artifactId><version>${mobile.version}</version><scope>test</scope></dependency>
|
||||
</dependencies>
|
||||
<build><resources><resource><directory>src/main/resources</directory><filtering>false</filtering></resource><resource><directory>${project.basedir}/../..</directory><filtering>false</filtering><includes><include>LICENSE</include><include>NOTICE</include></includes><targetPath>META-INF/qqq-echo</targetPath></resource></resources><plugins>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version><configuration><showWarnings>true</showWarnings><failOnWarning>true</failOnWarning><proc>none</proc><compilerArgs><arg>-Xlint:deprecation</arg><arg>-Xlint:unchecked</arg><arg>-Werror</arg></compilerArgs></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.6</version></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.2</version></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-checkstyle-plugin</artifactId><version>3.6.0</version><dependencies><dependency><groupId>com.puppycrawl.tools</groupId><artifactId>checkstyle</artifactId><version>14.3.0</version></dependency></dependencies><configuration><configLocation>${project.basedir}/../../checkstyle/checkstyle.xml</configLocation><includeTestSourceDirectory>true</includeTestSourceDirectory><failOnViolation>true</failOnViolation><violationSeverity>warning</violationSeverity></configuration><executions><execution><phase>validate</phase><goals><goal>check</goal></goals></execution></executions></plugin>
|
||||
</plugins></build>
|
||||
</project>
|
||||
+1
-1
@@ -66,7 +66,7 @@ class EchoHttpFixtureTest
|
||||
JSONObject item = (JSONObject) extension;
|
||||
if("mobile-scanners".equals(item.getString("name")))
|
||||
{
|
||||
mobile15 = item.getString("version").matches("1\\.([5-9]|[1-9][0-9]+)\\.[0-9]+");
|
||||
mobile15 = "1.5.0".equals(item.getString("version"));
|
||||
}
|
||||
}
|
||||
assertTrue(mobile15);
|
||||
|
||||
@@ -58,13 +58,8 @@ function Initialize-IsolatedScannerSource
|
||||
Remove-IsolatedBuildDirectory -ModuleRoot $ModuleRoot -LeafName 'scanner-source'
|
||||
$destination = Join-Path $ModuleRoot 'target/scanner-source'
|
||||
New-Item -ItemType Directory -Path $destination -Force | Out-Null
|
||||
foreach($name in @('mvnw.cmd', 'mvnw', '.mvn', 'checkstyle'))
|
||||
foreach($name in @('pom.xml', 'mvnw.cmd', 'mvnw', '.mvn', 'src', 'checkstyle'))
|
||||
{
|
||||
Copy-Item -LiteralPath (Join-Path $ScannerRoot $name) -Destination $destination -Recurse -Force
|
||||
}
|
||||
# The scanner base module (pom.xml, src) lives in base/ since the reactor layout; the scratch tree keeps the single-module shape.
|
||||
foreach($name in @('pom.xml', 'src'))
|
||||
{
|
||||
Copy-Item -LiteralPath (Join-Path (Join-Path $ScannerRoot 'base') $name) -Destination $destination -Recurse -Force
|
||||
}
|
||||
}
|
||||
@@ -70,23 +70,16 @@ OpenAPI identifiers are `getQbitRecordFilesCapabilities`,
|
||||
`postQbitRecordFilesUploadsByUploadIdCancel`. Native invoker/credential-scope IDs
|
||||
instead use `METHOD /qbit/record-files/...`; capability gating must distinguish them.
|
||||
|
||||
## Publication
|
||||
## Publication preparation
|
||||
|
||||
This module is a module of the repository's reactor (root `pom.xml`, artifact
|
||||
`qbit-mobile-scanners-reactor`), next to `base` (`qbit-mobile-scanners`). It inherits
|
||||
the root's single `<revision>` and the same `qbit-build-parent` 2.1.0, Apache-2.0
|
||||
metadata and canonical Gitea URLs. One root `mvn deploy` (the shared Gitea Actions
|
||||
`maven` workflow) tests and publishes the reactor POM, `qbit-mobile-scanners` and
|
||||
`qbit-mobile-scanners-record-files` at one version to the Gitea Maven registry.
|
||||
Its dependencies are immutable releases from that registry: `qbit-record-files`
|
||||
0.1.0-RC.1 and `qbit-collaboration` 1.1.0-RC.1, with QQQ 4.1.0-RC.22 from the root.
|
||||
Build only this module and the base with `./mvnw -pl integrations/record-files -am verify`.
|
||||
This module is a standard QBit module (parent `qbit-build-parent` 2.1.0, Apache-2.0
|
||||
metadata, canonical Gitea URLs) and produces a separate JAR from the root
|
||||
scanner; the root has no module or dependency on it. Preparing the POM is not
|
||||
publication. Publishing still requires a full immutable (non-SNAPSHOT) dependency set
|
||||
and the normal hosted qualification and publication path. No public version of this
|
||||
module exists, and no release test is claimed here.
|
||||
|
||||
## Reproducible isolated verification (legacy local harness)
|
||||
|
||||
The isolated scripts below date from the pre-publication frozen-candidate adoption on a
|
||||
Windows workstation and are not part of the release path; they predate the reactor
|
||||
layout and are kept as evidence tooling only.
|
||||
## Reproducible isolated verification
|
||||
|
||||
From this directory, run `./Verify-Isolated.ps1`. It verifies every checksum in the
|
||||
retained bundle, seeds a private repository from the local Maven cache, copies and
|
||||
|
||||
@@ -8,12 +8,12 @@ $ErrorActionPreference = 'Stop'
|
||||
$test = Join-Path $PSScriptRoot ('target/path-regression-' + [Guid]::NewGuid().ToString('N'))
|
||||
$inputRoot = Join-Path $test 'input'
|
||||
$moduleRoot = Join-Path $test 'module-root'
|
||||
New-Item -ItemType Directory -Force -Path $inputRoot, $moduleRoot, (Join-Path $inputRoot '.mvn'), (Join-Path $inputRoot 'base/src'), (Join-Path $inputRoot 'checkstyle'), (Join-Path $moduleRoot 'target/isolated-m2') | Out-Null
|
||||
foreach($name in @('mvnw.cmd', 'mvnw', 'base/pom.xml')) { Set-Content -LiteralPath (Join-Path $inputRoot $name) -Value 'fixture' }
|
||||
$removedSource = Join-Path $inputRoot 'base/src/Removed.java'
|
||||
New-Item -ItemType Directory -Force -Path $inputRoot, $moduleRoot, (Join-Path $inputRoot '.mvn'), (Join-Path $inputRoot 'src'), (Join-Path $inputRoot 'checkstyle'), (Join-Path $moduleRoot 'target/isolated-m2') | Out-Null
|
||||
foreach($name in @('pom.xml', 'mvnw.cmd', 'mvnw')) { Set-Content -LiteralPath (Join-Path $inputRoot $name) -Value 'fixture' }
|
||||
$removedSource = Join-Path $inputRoot 'src/Removed.java'
|
||||
Set-Content -LiteralPath $removedSource -Value 'old-source'
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $inputRoot 'base/src/main/resources') | Out-Null
|
||||
$removedResource = Join-Path $inputRoot 'base/src/main/resources/removed.txt'
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $inputRoot 'src/main/resources') | Out-Null
|
||||
$removedResource = Join-Path $inputRoot 'src/main/resources/removed.txt'
|
||||
Set-Content -LiteralPath $removedResource -Value 'old-resource'
|
||||
$sentinel = Join-Path $moduleRoot 'target/isolated-m2/keep.txt'
|
||||
Set-Content -LiteralPath $sentinel -Value 'repository-must-survive'
|
||||
@@ -23,7 +23,7 @@ New-Item -ItemType Directory -Force -Path (Join-Path $scratch 'target/classes')
|
||||
Set-Content -LiteralPath (Join-Path $scratch 'target/classes/Removed.class') -Value 'stale-class'
|
||||
Remove-Item -LiteralPath $removedSource
|
||||
Remove-Item -LiteralPath $removedResource
|
||||
Set-Content -LiteralPath (Join-Path $inputRoot 'base/src/Current.java') -Value 'current-source'
|
||||
Set-Content -LiteralPath (Join-Path $inputRoot 'src/Current.java') -Value 'current-source'
|
||||
Initialize-IsolatedScannerSource -ScannerRoot $inputRoot -ModuleRoot $moduleRoot
|
||||
if((Test-Path -LiteralPath (Join-Path $scratch 'src/Removed.java')) -or (Test-Path -LiteralPath (Join-Path $scratch 'target/classes/Removed.class'))) { throw 'Removed source/class survived the fresh snapshot.' }
|
||||
if(Test-Path -LiteralPath (Join-Path $scratch 'src/main/resources/removed.txt')) { throw 'Removed resource survived the fresh snapshot.' }
|
||||
|
||||
@@ -110,7 +110,7 @@ try
|
||||
Remove-IsolatedBuildDirectory -ModuleRoot $module -LeafName 'module'
|
||||
$runtimeClasspath = Join-Path $target 'runtime-classpath.txt'
|
||||
if(Test-Path -LiteralPath $runtimeClasspath) { Remove-Item -LiteralPath $runtimeClasspath }
|
||||
Invoke-Maven @('-B', '-ntp', '-Pisolated-module', 'clean', 'verify', 'org.apache.maven.plugins:maven-dependency-plugin:3.8.1:build-classpath', '-Dmdep.includeScope=test', '-Dmdep.outputFile=target/runtime-classpath.txt')
|
||||
Invoke-Maven @('-B', '-ntp', 'clean', 'verify', 'org.apache.maven.plugins:maven-dependency-plugin:3.8.1:build-classpath', '-Dmdep.includeScope=test', '-Dmdep.outputFile=target/runtime-classpath.txt')
|
||||
$runtime = (Get-Content -LiteralPath (Join-Path $target 'runtime-classpath.txt') -Raw).Trim().Split(';')
|
||||
$manifest = foreach($path in $runtime) { @{path=$path; sha256=(Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant() } }
|
||||
$manifest | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $target 'runtime-sha256.json') -Encoding utf8
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent><groupId>com.kingsrook.qbits</groupId><artifactId>qbit-mobile-scanners-reactor</artifactId><version>${revision}</version><relativePath>../../pom.xml</relativePath></parent>
|
||||
<parent>
|
||||
<groupId>com.kingsrook</groupId>
|
||||
<artifactId>qbit-build-parent</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>com.kingsrook.qbits</groupId>
|
||||
<artifactId>qbit-mobile-scanners-record-files</artifactId>
|
||||
<version>${revision}</version>
|
||||
@@ -28,13 +33,23 @@
|
||||
<url>https://git.kof22.com/QRun-IO/qbit-mobile-scanners/issues</url>
|
||||
</issueManagement>
|
||||
<properties>
|
||||
<!-- the base module is built in the same reactor; the others are published releases from the Gitea registry -->
|
||||
<mobile.version>${project.version}</mobile.version>
|
||||
<recordfiles.version>0.4.0-RC.1</recordfiles.version>
|
||||
<collaboration.version>1.2.0-RC.1</collaboration.version>
|
||||
<!-- effective version 0.1.0-SNAPSHOT; the parent's own revision (2.1.0) is overridden here -->
|
||||
<revision>0.1.0-SNAPSHOT</revision>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<!-- the same property names the root POM and the Echo demo use, with their defaults -->
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
<mobile.version>0.1.0-SNAPSHOT</mobile.version>
|
||||
<recordfiles.version>0.1.0-SNAPSHOT</recordfiles.version>
|
||||
<collaboration.version>0.1.0-record-files-SNAPSHOT</collaboration.version>
|
||||
<!-- developer-script override for core and rdbms only; by default it is the single qqq line, never a second one -->
|
||||
<qqq.frozen.version>${qqq.version}</qqq.frozen.version>
|
||||
</properties>
|
||||
<dependencyManagement><dependencies>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-bom-pom</artifactId><version>${qqq.version}</version><type>pom</type><scope>import</scope></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-backend-core</artifactId><version>${qqq.frozen.version}</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-backend-module-rdbms</artifactId><version>${qqq.frozen.version}</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qqq</groupId><artifactId>qqq-middleware-javalin</artifactId><version>${qqq.version}</version></dependency>
|
||||
<dependency><groupId>com.kingsrook.qbits</groupId><artifactId>qbit-collaboration</artifactId><version>${collaboration.version}</version></dependency>
|
||||
</dependencies></dependencyManagement>
|
||||
<dependencies>
|
||||
@@ -47,20 +62,13 @@
|
||||
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-params</artifactId><scope>test</scope></dependency>
|
||||
<dependency><groupId>org.assertj</groupId><artifactId>assertj-core</artifactId><version>3.27.7</version><scope>test</scope></dependency>
|
||||
</dependencies>
|
||||
<build><plugins>
|
||||
<build><directory>${project.basedir}/target/module</directory><plugins>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.6</version><configuration><systemPropertyVariables><qqq.logger.logSessionId.disabled>true</qqq.logger.logSessionId.disabled></systemPropertyVariables></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.2</version><configuration><systemPropertyVariables><qqq.logger.logSessionId.disabled>true</qqq.logger.logSessionId.disabled></systemPropertyVariables></configuration></plugin>
|
||||
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-checkstyle-plugin</artifactId><version>3.6.0</version>
|
||||
<dependencies><dependency><groupId>com.puppycrawl.tools</groupId><artifactId>checkstyle</artifactId><version>14.3.0</version></dependency></dependencies>
|
||||
<configuration><configLocation>${maven.multiModuleProjectDirectory}/checkstyle/checkstyle.xml</configLocation><includeTestSourceDirectory>true</includeTestSourceDirectory><failOnViolation>true</failOnViolation><violationSeverity>warning</violationSeverity></configuration>
|
||||
<configuration><configLocation>../../checkstyle/checkstyle.xml</configLocation><includeTestSourceDirectory>true</includeTestSourceDirectory><failOnViolation>true</failOnViolation><violationSeverity>warning</violationSeverity></configuration>
|
||||
<executions><execution><id>style</id><phase>validate</phase><goals><goal>check</goal></goals></execution></executions>
|
||||
</plugin>
|
||||
</plugins></build>
|
||||
<profiles>
|
||||
<!-- Isolated verification (Verify-Isolated.ps1) keeps its module output out of target/ itself; a normal reactor build and the standard capture use target/. -->
|
||||
<profile>
|
||||
<id>isolated-module</id>
|
||||
<build><directory>${project.basedir}/target/module</directory></build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
+2
-65
@@ -78,7 +78,6 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
@@ -409,58 +408,6 @@ public class MobileRecordFilesIntegrationTest extends RecordFilesFixture
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** A host that sets quarantineCapturedFiles=false (and leaves quarantineNewFiles
|
||||
** true) makes only an approved device's camera item AVAILABLE. The device is
|
||||
** the one the real provider verified, an unapproved device is still refused,
|
||||
** an UPLOAD item stays QUARANTINED, and the permitted preview read returns the
|
||||
** exact retained bytes only for the AVAILABLE version. Requires the owner
|
||||
** version that contains withQuarantineCapturedFiles.
|
||||
***************************************************************************/
|
||||
@Test
|
||||
void approvedDeviceCameraPhotoIsAvailableOnlyWhenHostOptsIn() throws Exception
|
||||
{
|
||||
config.withQuarantineCapturedFiles(false);
|
||||
assertTrue(config.getQuarantineNewFiles(), "the broad default stays quarantined");
|
||||
String scanner = signIn("scanner");
|
||||
String admin = signIn("admin");
|
||||
enrollHttp(scanner);
|
||||
assertEquals(403, send("POST", FILES + "/uploads", scanner, manifest(UUID.randomUUID().toString(), "CAMERA", "photo.jpg", "image/jpeg", CONTENT), true, Map.of()).statusCode(),
|
||||
"an unapproved device cannot start a capture upload even with the host opt-in");
|
||||
approveHttp(admin, "mobileDeviceApprove");
|
||||
byte[] photo = {(byte) 0xFF, (byte) 0xD8, 9, 8, 7};
|
||||
byte[] other = {4, 5, 6};
|
||||
assertEquals("AVAILABLE", finalizeLifecycle(scanner, "CAMERA", "photo.jpg", "image/jpeg", photo));
|
||||
assertEquals("QUARANTINED", finalizeLifecycle(scanner, "UPLOAD", "upload.jpg", "image/jpeg", other));
|
||||
QContext.init(instance, authenticated(scanner));
|
||||
var retained = files.listForRecord("document", "1");
|
||||
assertEquals(2, retained.size());
|
||||
var available = retained.stream().filter(file -> "AVAILABLE".equals(file.lifecycle())).findFirst().orElseThrow();
|
||||
var quarantined = retained.stream().filter(file -> "QUARANTINED".equals(file.lifecycle())).findFirst().orElseThrow();
|
||||
var reader = new com.kingsrook.qbits.recordfiles.api.RetainedContentReader(
|
||||
new com.kingsrook.qbits.collaboration.attachments.AttachmentsService(collaboration, new DiskAttachmentStorage()));
|
||||
var reference = reader.reference(available.id(), "preview-" + available.id());
|
||||
assertArrayEquals(photo, reader.read(reference, 1024).bytes());
|
||||
assertThrows(QException.class, () -> reader.reference(quarantined.id(), "preview-" + quarantined.id()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Create, upload one chunk and finalize one item; returns its commit lifecycle.
|
||||
***************************************************************************/
|
||||
private String finalizeLifecycle(String scanner, String origin, String fileName, String mediaType, byte[] bytes) throws Exception
|
||||
{
|
||||
String request = UUID.randomUUID().toString();
|
||||
String id = ok(send("POST", FILES + "/uploads", scanner, manifest(request, origin, fileName, mediaType, bytes), true, Map.of())).path("uploadId").asText();
|
||||
ok(send("PUT", FILES + "/uploads/" + id + "/items/20000000-0000-0000-0000-000000000001/chunks/0", scanner, bytes, true,
|
||||
Map.of("Content-Type", "application/octet-stream", "X-Chunk-SHA256", UploadManifest.hash(bytes))));
|
||||
return ok(send("POST", FILES + "/uploads/" + id + "/finalize", scanner, null, true, Map.of("Idempotency-Key", request)))
|
||||
.at("/receipt/items/0/lifecycleAtCommit").asText();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Different actors, missing device proof and revocation cannot resume intake.
|
||||
***************************************************************************/
|
||||
@@ -875,20 +822,10 @@ public class MobileRecordFilesIntegrationTest extends RecordFilesFixture
|
||||
** Immutable manifest has no device, user or session identity fields.
|
||||
***************************************************************************/
|
||||
private byte[] manifest(String request) throws Exception
|
||||
{
|
||||
return manifest(request, "UPLOAD", "fixture.pdf", "application/pdf", CONTENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** The same manifest with a chosen client-declared origin and content.
|
||||
***************************************************************************/
|
||||
private byte[] manifest(String request, String origin, String fileName, String mediaType, byte[] bytes) throws Exception
|
||||
{
|
||||
return JSON.writeValueAsBytes(Map.of("requestId", request, "parent", Map.of("tableName", "document", "recordId", "1"),
|
||||
"items", List.of(Map.of("itemId", "20000000-0000-0000-0000-000000000001", "position", 0, "fileName", fileName, "declaredMediaType", mediaType,
|
||||
"sizeBytes", bytes.length, "sha256", UploadManifest.hash(bytes), "origin", origin))));
|
||||
"items", List.of(Map.of("itemId", "20000000-0000-0000-0000-000000000001", "position", 0, "fileName", "fixture.pdf", "declaredMediaType", "application/pdf",
|
||||
"sizeBytes", CONTENT.length, "sha256", UploadManifest.hash(CONTENT), "origin", "UPLOAD"))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<!-- Reactor root AND parent of every module. The release pipeline rewrites only the version property below in THIS file, so it is the single version
|
||||
source of every published module. The root keeps the modules' former parent (qbit-build-parent 2.1.0), so inherited build configuration is unchanged. -->
|
||||
<parent>
|
||||
<groupId>com.kingsrook</groupId>
|
||||
<artifactId>qbit-build-parent</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<version>2.1.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>com.kingsrook.qbits</groupId>
|
||||
<artifactId>qbit-mobile-scanners-reactor</artifactId>
|
||||
<artifactId>qbit-mobile-scanners</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>QQQ Mobile Scanners (reactor)</name>
|
||||
<description>Aggregator for the published Mobile Scanners modules: the base qbit and its optional Record Files integration.</description>
|
||||
<name>QQQ Mobile Scanners</name>
|
||||
<description>Approved mobile devices and native QQQ barcode capture processes.</description>
|
||||
<url>https://git.kof22.com/QRun-IO/qbit-mobile-scanners</url>
|
||||
<scm>
|
||||
<connection>scm:git:https://git.kof22.com/QRun-IO/qbit-mobile-scanners.git</connection>
|
||||
@@ -34,41 +31,91 @@
|
||||
</license>
|
||||
</licenses>
|
||||
<properties>
|
||||
<revision>0.6.0-SNAPSHOT</revision>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<revision>0.1.0-RC.1</revision>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<qqq.version>4.1.0-RC.26</qqq.version>
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
</properties>
|
||||
<!-- Every published module, so one root deploy builds every GAV. demo/ and examples/ are runnable demonstrations with their own coordinates and are intentionally
|
||||
not part of this reactor. Build a subset with -pl <module> -am. -->
|
||||
<modules>
|
||||
<module>base</module>
|
||||
<module>integrations/record-files</module>
|
||||
</modules>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-bom-pom</artifactId>
|
||||
<version>${qqq.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-middleware-javalin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-module-rdbms</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.2.224</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-backend-module-postgres</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>1.21.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.7.14</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.11.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!-- Publish consumer POMs with the version resolved (the parent reference and the reactor root itself would otherwise carry the unresolved property). -->
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<version>1.7.3</version>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>14.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
<flattenMode>ossrh</flattenMode>
|
||||
<configLocation>checkstyle/checkstyle.xml</configLocation>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<id>checkstyle</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-5
@@ -69,13 +69,11 @@ final class MobileDeviceActivity
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Preserve last known coordinates with explicit availability and timestamps,
|
||||
** and refresh reported software versions in the same presence write.
|
||||
** Preserve last known coordinates with explicit availability and timestamps.
|
||||
***************************************************************************/
|
||||
static void heartbeat(QRecord device, Map<String, Object> input, boolean foreground) throws QException
|
||||
static void heartbeat(String id, Map<String, Object> input, boolean foreground) throws QException
|
||||
{
|
||||
QRecord changes = new QRecord().withValue("id", device.getValueString("id")).withValue("lastSeenAt", Instant.now());
|
||||
MobileService.refreshDeviceInfo(device, input, changes);
|
||||
QRecord changes = new QRecord().withValue("id", id).withValue("lastSeenAt", Instant.now());
|
||||
String status = MobileService.optional(input, "locationStatus", 30);
|
||||
if(status != null && !List.of("AVAILABLE", "PERMISSION_DENIED", "DISABLED", "UNAVAILABLE").contains(status))
|
||||
{
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -46,7 +46,7 @@ public final class MobileScannersUiApi
|
||||
***************************************************************************/
|
||||
public static MiddlewareSpecExtension extension()
|
||||
{
|
||||
return new MiddlewareSpecExtension().withName("mobile-scanners").withSemanticVersion("1.6.0")
|
||||
return new MiddlewareSpecExtension().withName("mobile-scanners").withSemanticVersion("1.5.0")
|
||||
.withDescription("Native scanner devices, customer branding and SCANNER process widget contract.")
|
||||
.withSpec(MobileBrandingSpec.class).withSpec(MobileStatusSpec.class)
|
||||
.withSpec(MobileEnrollSpec.class).withSpec(MobileCurrentDeviceSpec.class)
|
||||
File renamed without changes.
+1
-22
@@ -44,7 +44,6 @@ public final class MobileService
|
||||
{
|
||||
static final ThreadLocal<QBackendTransaction> TRANSACTION = new ThreadLocal<>();
|
||||
|
||||
static final List<String> DEVICE_INFO_FIELDS = List.of("manufacturer", "model", "osVersion", "appVersion");
|
||||
static final int AIM_IDENTIFIER_LENGTH = 3;
|
||||
static final int RAW_DATA_MAXIMUM_BYTES = 8192;
|
||||
static final int RAW_DATA_MAXIMUM_CHARACTERS = 10924;
|
||||
@@ -79,8 +78,7 @@ public final class MobileService
|
||||
QRecord credential = new QRecord().withValue("id", id).withValue("tokenHash", hash(token));
|
||||
QRecord device = new QRecord().withValue("id", id).withValue("installationId", id).withValue("status", "PENDING")
|
||||
.withValue("enrolledBy", userId()).withValue("enrolledAt", Instant.now());
|
||||
device.setValue("displayName", optional(input, "displayName", 200));
|
||||
for(String name : DEVICE_INFO_FIELDS)
|
||||
for(String name : new String[] { "displayName", "manufacturer", "model", "osVersion", "appVersion" })
|
||||
{
|
||||
device.setValue(name, optional(input, name, 200));
|
||||
}
|
||||
@@ -569,25 +567,6 @@ public final class MobileService
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** An updated app or OS reports new versions after enrollment; copy only
|
||||
** changed, bounded values so scans record the software that produced them.
|
||||
** Absent, null or blank values never erase what enrollment recorded.
|
||||
***************************************************************************/
|
||||
static void refreshDeviceInfo(QRecord device, Map<String, ?> input, QRecord changes) throws QException
|
||||
{
|
||||
for(String name : DEVICE_INFO_FIELDS)
|
||||
{
|
||||
String value = optional(input, name, 200);
|
||||
if(value != null && !value.isBlank() && !value.equals(device.getValueString(name)))
|
||||
{
|
||||
changes.setValue(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Enforce canonical UUIDs before using them as identifiers.
|
||||
***************************************************************************/
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -24,7 +24,7 @@ public class MobileSessionHeartbeatSpec extends MobileDeviceJsonSpec
|
||||
{
|
||||
return new BasicOperation().withHttpMethod(HttpMethod.POST).withPath(MobileScannersUiApi.PREFIX + "/sessions/heartbeat")
|
||||
.withOperationId("mobileScannersSessionHeartbeat").withShortSummary("Report current handheld session activity")
|
||||
.withLongDescription("Binds the current QQQ sign-in to the verified device. Nullable display metadata never grants permissions. Ended sign-ins return 401 and cannot start another mobile session. screenAvailable=false immediately removes the retained frame. Lease duration is expiresAt minus serverTime, not the device clock. Optional manufacturer, model, osVersion and appVersion refresh the enrolled device record when they differ (1.6); scans recorded afterwards carry the refreshed values.");
|
||||
.withLongDescription("Binds the current QQQ sign-in to the verified device. Nullable display metadata never grants permissions. Ended sign-ins return 401 and cannot start another mobile session. screenAvailable=false immediately removes the retained frame. Lease duration is expiresAt minus serverTime, not the device clock.");
|
||||
}
|
||||
|
||||
|
||||
File renamed without changes.
+1
-5
@@ -52,14 +52,10 @@ final class MobileSessionSchemas
|
||||
activity.put("traceId", nullableText(100));
|
||||
activity.put("locationStatus", text(30).withEnumValues(List.of("AVAILABLE", "PERMISSION_DENIED", "DISABLED", "UNAVAILABLE")));
|
||||
activity.put("location", ref("MobileScannersLocationV1").withNullable(true));
|
||||
for(String field : MobileService.DEVICE_INFO_FIELDS)
|
||||
{
|
||||
activity.put(field, text(200));
|
||||
}
|
||||
schemas.put("MobileScannersLocationV1", object("Optional foreground observation with runtime permission. Coordinates are last known, not a guarantee of current position; the server separately records receipt time.", Map.of(
|
||||
"latitude", new BoundedIntegerSchema(-90, 90).withType(Type.NUMBER), "longitude", new BoundedIntegerSchema(-180, 180).withType(Type.NUMBER),
|
||||
"accuracyMeters", new BoundedIntegerSchema(0, 10000000).withType(Type.NUMBER), "capturedAt", timestamp()), "latitude", "longitude", "accuracyMeters", "capturedAt"));
|
||||
schemas.put("MobileScannersHeartbeatRequestV1", object("Display activity only. Never include form values, barcodes, passwords or raw error messages. JSON maximum 4096 bytes. Omitted captureMode means APP_CONTENT, requiring foreground eligible app pixels. DEVICE_SCREEN requires explicit per-session Android operator consent and may remain available in background. False screenAvailable clears pixels and lease; changing mode invalidates old demand. Optional manufacturer, model, osVersion and appVersion (1.6) refresh the enrolled device record when they differ, so later scans carry the installed software; omitted or blank values leave stored values unchanged.", activity, "foreground", "screenAvailable"));
|
||||
schemas.put("MobileScannersHeartbeatRequestV1", object("Display activity only. Never include form values, barcodes, passwords or raw error messages. JSON maximum 4096 bytes. Omitted captureMode means APP_CONTENT, requiring foreground eligible app pixels. DEVICE_SCREEN requires explicit per-session Android operator consent and may remain available in background. False screenAvailable clears pixels and lease; changing mode invalidates old demand.", activity, "foreground", "screenAvailable"));
|
||||
schemas.put("MobileScannersScreenLeaseV1", object("Server-authorized capture demand. Compute remaining duration from expiresAt minus heartbeat serverTime. Sequence is scoped to this lease and resumes at nextSequence after client restart.", Map.of(
|
||||
"leaseId", uuid(), "expiresAt", timestamp(), "frameIntervalMillis", integer(1000, 1000), "maxWidth", integer(640, 640),
|
||||
"maxHeight", integer(1280, 1280), "maxBytes", integer(262144, 262144), "nextSequence", integer(0, 9007199254740990L), "captureMode", captureMode()),
|
||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -153,7 +153,7 @@ final class MobileSessionService
|
||||
String deviceId = currentDevice();
|
||||
synchronized(current())
|
||||
{
|
||||
QRecord device = MobileService.requireApproved(deviceId);
|
||||
MobileService.requireApproved(deviceId);
|
||||
QRecord session = observe(deviceId);
|
||||
boolean foreground = bool(input, "foreground");
|
||||
MobileCaptureMode mode = MobileCaptureMode.parse(input.get("captureMode"));
|
||||
@@ -173,7 +173,7 @@ final class MobileSessionService
|
||||
changes.setValue(name, MobileService.optional(input, name, 80));
|
||||
}
|
||||
changes.setValue("traceId", MobileService.optional(input, "traceId", 100));
|
||||
MobileDeviceActivity.heartbeat(device, input, foreground);
|
||||
MobileDeviceActivity.heartbeat(deviceId, input, foreground);
|
||||
update(changes);
|
||||
String id = session.getValueString("id");
|
||||
if(!available)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
-13
@@ -64,19 +64,11 @@ class MobileScannersApiContractTest
|
||||
assertTrue(model.getComponents().getSchemas().containsKey(schema), schema);
|
||||
}
|
||||
assertEquals(7, extension.getSpecs().size());
|
||||
assertEquals("1.6.0", extension.getSemanticVersion());
|
||||
for(String previous : java.util.List.of("1.4.0", "1.5.0", "1.6.0"))
|
||||
{
|
||||
assertEquals(java.util.List.of(), UiApiContract.check(generated, Files.readString(contract), Files.readString(Path.of("src/test/resources/openapi/mobile-scanners-" + previous + ".yaml")), 1,
|
||||
"Regenerate the current extension contract."));
|
||||
}
|
||||
var heartbeatRequest = model.getComponents().getSchemas().get("MobileScannersHeartbeatRequestV1");
|
||||
for(String optional : MobileService.DEVICE_INFO_FIELDS)
|
||||
{
|
||||
assertTrue(heartbeatRequest.getProperties().containsKey(optional), optional);
|
||||
assertEquals(200, heartbeatRequest.getProperties().get(optional).getMaxLength(), optional);
|
||||
assertFalse(generated.contains("- \"" + optional + "\""), optional + " must stay optional, never a required key.");
|
||||
}
|
||||
assertEquals("1.5.0", extension.getSemanticVersion());
|
||||
assertEquals(java.util.List.of(), UiApiContract.check(generated, Files.readString(contract), Files.readString(Path.of("src/test/resources/openapi/mobile-scanners-1.4.0.yaml")), 1,
|
||||
"Regenerate the current extension contract."));
|
||||
assertEquals(java.util.List.of(), UiApiContract.check(generated, Files.readString(contract), Files.readString(Path.of("src/test/resources/openapi/mobile-scanners-1.5.0.yaml")), 1,
|
||||
"Regenerate the current extension contract."));
|
||||
var scanEvent = model.getComponents().getSchemas().get("MobileScannersScanEventV1");
|
||||
var scanContext = model.getComponents().getSchemas().get("MobileScannersScanContextV1");
|
||||
for(String optional : java.util.List.of("aimIdentifier", "rawDataBase64"))
|
||||
+1
-101
@@ -26,7 +26,6 @@ import com.kingsrook.qqq.backend.core.actions.tables.InsertAction;
|
||||
import com.kingsrook.qqq.backend.core.actions.tables.QueryAction;
|
||||
import com.kingsrook.qqq.backend.core.actions.tables.UpdateAction;
|
||||
import com.kingsrook.qqq.backend.core.context.QContext;
|
||||
import com.kingsrook.qqq.backend.core.exceptions.QBadRequestException;
|
||||
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
||||
import com.kingsrook.qqq.backend.core.instances.QInstanceValidator;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepInput;
|
||||
@@ -943,93 +942,6 @@ class MobileScannersTest
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Enrollment records the installed software; heartbeats without versions,
|
||||
** or with blank ones, leave it unchanged and scans copy it.
|
||||
***************************************************************************/
|
||||
@Test
|
||||
void enrollmentStoresVersionsAndHeartbeatWithoutThemLeavesThemUnchanged() throws Exception
|
||||
{
|
||||
String device = approvedDevice(Map.of("osVersion", "14", "appVersion", "1.0.0"));
|
||||
QRecord enrolled = MobileService.get(MobileScannersQBitProducer.DEVICE, device);
|
||||
assertEquals("Zebra", enrolled.getValueString("manufacturer"));
|
||||
assertEquals("TC22", enrolled.getValueString("model"));
|
||||
assertEquals("14", enrolled.getValueString("osVersion"));
|
||||
assertEquals("1.0.0", enrolled.getValueString("appVersion"));
|
||||
bind(device);
|
||||
MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false));
|
||||
MobileSessionService.heartbeat(new HashMap<>(Map.of("foreground", true, "screenAvailable", false, "appVersion", "", "osVersion", " ")));
|
||||
QRecord unchanged = MobileService.get(MobileScannersQBitProducer.DEVICE, device);
|
||||
for(String field : MobileService.DEVICE_INFO_FIELDS)
|
||||
{
|
||||
assertEquals(enrolled.getValueString(field), unchanged.getValueString(field), field);
|
||||
}
|
||||
QRecord scan = MobileService.capture(scan());
|
||||
assertEquals("1.0.0", scan.getValueString("appVersion"));
|
||||
assertEquals("14", scan.getValueString("osVersion"));
|
||||
assertEquals("Zebra", scan.getValueString("manufacturer"));
|
||||
assertEquals("TC22", scan.getValueString("model"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** An in-place app update reports its new version on the next heartbeat and
|
||||
** every later scan carries it; earlier scans keep the version that made them.
|
||||
***************************************************************************/
|
||||
@Test
|
||||
void heartbeatRefreshesDeviceVersionsForLaterScans() throws Exception
|
||||
{
|
||||
String device = approvedDevice(Map.of("osVersion", "14", "appVersion", "1.0.0"));
|
||||
bind(device);
|
||||
QRecord before = MobileService.capture(scan());
|
||||
assertEquals("1.0.0", before.getValueString("appVersion"));
|
||||
MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false, "appVersion", "1.0.1", "osVersion", "15"));
|
||||
QRecord updated = MobileService.get(MobileScannersQBitProducer.DEVICE, device);
|
||||
assertEquals("1.0.1", updated.getValueString("appVersion"));
|
||||
assertEquals("15", updated.getValueString("osVersion"));
|
||||
assertEquals("Zebra", updated.getValueString("manufacturer"));
|
||||
assertEquals("TC22", updated.getValueString("model"));
|
||||
assertEquals("APPROVED", updated.getValueString("status"));
|
||||
QRecord after = MobileService.capture(scan());
|
||||
assertEquals("1.0.1", after.getValueString("appVersion"));
|
||||
assertEquals("15", after.getValueString("osVersion"));
|
||||
assertEquals("1.0.0", MobileService.get(MobileScannersQBitProducer.SCAN, before.getValueString("id")).getValueString("appVersion"));
|
||||
MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false, "manufacturer", "Zebra Technologies", "model", "MC9400"));
|
||||
QRecord hardware = MobileService.get(MobileScannersQBitProducer.DEVICE, device);
|
||||
assertEquals("Zebra Technologies", hardware.getValueString("manufacturer"));
|
||||
assertEquals("MC9400", hardware.getValueString("model"));
|
||||
assertEquals("1.0.1", hardware.getValueString("appVersion"));
|
||||
assertEquals("MC9400", MobileService.capture(scan()).getValueString("model"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Heartbeat versions obey the enrollment limits: strings of at most 200
|
||||
** characters; anything else is a 400 and the device record is untouched.
|
||||
***************************************************************************/
|
||||
@Test
|
||||
void heartbeatRejectsInvalidDeviceVersionsLikeEnrollment() throws Exception
|
||||
{
|
||||
String tooLong = "v".repeat(201);
|
||||
String longest = "v".repeat(200);
|
||||
assertThrows(QBadRequestException.class, () -> MobileService.enroll(Map.of("installationId", UUID.randomUUID().toString(), "appVersion", tooLong)));
|
||||
String device = approvedDevice(Map.of("osVersion", "14", "appVersion", "1.0.0"));
|
||||
bind(device);
|
||||
assertThrows(QBadRequestException.class, () -> MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false, "appVersion", tooLong)));
|
||||
assertThrows(QBadRequestException.class, () -> MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false, "osVersion", 15)));
|
||||
QRecord unchanged = MobileService.get(MobileScannersQBitProducer.DEVICE, device);
|
||||
assertEquals("1.0.0", unchanged.getValueString("appVersion"));
|
||||
assertEquals("14", unchanged.getValueString("osVersion"));
|
||||
assertEquals("1.0.0", MobileService.capture(scan()).getValueString("appVersion"));
|
||||
MobileSessionService.heartbeat(Map.of("foreground", true, "screenAvailable", false, "appVersion", longest));
|
||||
assertEquals(longest, MobileService.get(MobileScannersQBitProducer.DEVICE, device).getValueString("appVersion"));
|
||||
assertEquals(longest, MobileService.capture(scan()).getValueString("appVersion"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** A realistic installation, with no hardware identifier requirement.
|
||||
***************************************************************************/
|
||||
@@ -1251,19 +1163,7 @@ class MobileScannersTest
|
||||
***************************************************************************/
|
||||
private String approvedDevice() throws QException
|
||||
{
|
||||
return approvedDevice(Map.of());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** Approve an enrollment that also reported its software versions.
|
||||
***************************************************************************/
|
||||
private String approvedDevice(Map<String, Object> versions) throws QException
|
||||
{
|
||||
Map<String, Object> enrollment = new HashMap<>(Map.of("installationId", UUID.randomUUID().toString(), "displayName", "Test TC22", "manufacturer", "Zebra", "model", "TC22"));
|
||||
enrollment.putAll(versions);
|
||||
String id = (String) MobileService.enroll(enrollment).get("deviceId");
|
||||
String id = (String) enroll().get("deviceId");
|
||||
QContext.init(instance, admin);
|
||||
MobileService.setApproval(id, true);
|
||||
QContext.init(instance, scanner);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-20
@@ -170,18 +170,12 @@ components:
|
||||
\ APP_CONTENT, requiring foreground eligible app pixels. DEVICE_SCREEN requires\
|
||||
\ explicit per-session Android operator consent and may remain available in\
|
||||
\ background. False screenAvailable clears pixels and lease; changing mode\
|
||||
\ invalidates old demand. Optional manufacturer, model, osVersion and appVersion\
|
||||
\ (1.6) refresh the enrolled device record when they differ, so later scans\
|
||||
\ carry the installed software; omitted or blank values leave stored values\
|
||||
\ unchanged."
|
||||
\ invalidates old demand."
|
||||
properties:
|
||||
appName:
|
||||
maxLength: 200
|
||||
nullable: true
|
||||
type: "string"
|
||||
appVersion:
|
||||
maxLength: 200
|
||||
type: "string"
|
||||
captureBlockedReason:
|
||||
maxLength: 80
|
||||
nullable: true
|
||||
@@ -213,15 +207,6 @@ components:
|
||||
- "UNAVAILABLE"
|
||||
maxLength: 30
|
||||
type: "string"
|
||||
manufacturer:
|
||||
maxLength: 200
|
||||
type: "string"
|
||||
model:
|
||||
maxLength: 200
|
||||
type: "string"
|
||||
osVersion:
|
||||
maxLength: 200
|
||||
type: "string"
|
||||
processInstanceId:
|
||||
maxLength: 200
|
||||
nullable: true
|
||||
@@ -701,7 +686,7 @@ info:
|
||||
description: "Native scanner devices, customer branding and SCANNER process widget\
|
||||
\ contract."
|
||||
title: "QQQ Middleware API extension: mobile-scanners"
|
||||
version: "1.6.0"
|
||||
version: "1.5.0"
|
||||
openapi: "3.0.3"
|
||||
paths:
|
||||
/qqq/v1/qbit/mobile-scanners/branding:
|
||||
@@ -982,9 +967,7 @@ paths:
|
||||
\ display metadata never grants permissions. Ended sign-ins return 401 and\
|
||||
\ cannot start another mobile session. screenAvailable=false immediately removes\
|
||||
\ the retained frame. Lease duration is expiresAt minus serverTime, not the\
|
||||
\ device clock. Optional manufacturer, model, osVersion and appVersion refresh\
|
||||
\ the enrolled device record when they differ (1.6); scans recorded afterwards\
|
||||
\ carry the refreshed values."
|
||||
\ device clock."
|
||||
operationId: "mobileScannersSessionHeartbeat"
|
||||
parameters:
|
||||
- description: "Enrolled installation UUID"
|
||||
Reference in new issue
Block a user