@hmcts/media-viewer 4.2.34 → 4.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/README.md CHANGED
@@ -122,6 +122,128 @@ Viewer and AAT-backed proxy configuration while keeping the browser at
122
122
  the opt-in external-service contracts for those live service probes. The lightweight
123
123
  route and health check remains available as `yarn smoke:local:aat`.
124
124
 
125
+ ### Test a local `em-icp-api` change
126
+
127
+ The standalone app reaches ICP through its local API. Keep the other services on AAT,
128
+ but override only `ICP_API_URL` in the ignored `.env` file:
129
+
130
+ ```
131
+ ICP_API_URL=http://localhost:8080
132
+ ```
133
+
134
+ Create an isolated worktree for the ICP branch under test. The example below uses
135
+ PR #1546 and leaves the normal ICP checkout untouched:
136
+
137
+ ```
138
+ cd ../em-icp-api
139
+ git fetch origin pull/1546/head
140
+ git worktree add --detach /private/tmp/em-icp-pr1546-validation FETCH_HEAD
141
+ cd /private/tmp/em-icp-pr1546-validation
142
+ yarn install --immutable
143
+ docker compose -f docker-compose.yml up -d redis
144
+ ```
145
+
146
+ Its `config/local-dev.yaml` is ignored by `em-icp-api`; create it and configure the
147
+ AAT IdAM URL, local Redis and AAT Web PubSub client URL:
148
+
149
+ ```yaml
150
+ idam:
151
+ url: https://idam-api.aat.platform.hmcts.net
152
+ redis:
153
+ host: localhost
154
+ port: 6379
155
+ useTLS: "false"
156
+ icp:
157
+ wsUrl: wss://em-icp-webpubsub.aat.platform.hmcts.net/client/hubs/localhub
158
+ ```
159
+
160
+ Check that the active Azure identity can read the approved secret without printing its
161
+ value:
162
+
163
+ ```
164
+ az keyvault secret show \
165
+ --vault-name em-icp-aat \
166
+ --name em-icp-web-pubsub-primary-connection-string \
167
+ --query id -o tsv
168
+ ```
169
+
170
+ Immediately before starting ICP, load the connection string into `NODE_CONFIG` only for
171
+ that process. This command does not echo or write the secret to disk:
172
+
173
+ ```
174
+ local_webpubsub_secret="$(az keyvault secret show \
175
+ --vault-name em-icp-aat \
176
+ --name em-icp-web-pubsub-primary-connection-string \
177
+ --query value -o tsv)"
178
+ export NODE_CONFIG="$(LOCAL_WEBPUBSUB_SECRET="$local_webpubsub_secret" node -e 'console.log(JSON.stringify({secrets: {"em-icp": {"em-icp-web-pubsub-primary-connection-string": process.env.LOCAL_WEBPUBSUB_SECRET}}}))')"
179
+ unset local_webpubsub_secret
180
+ ```
181
+
182
+ For Web PubSub callback testing, make the following local-only edits in the ICP
183
+ checkout before starting it. The API currently hard-codes the deployed `Hub`/`hub`
184
+ names in three places, whereas the tunnel uses `localhub`; do not commit these edits
185
+ with the change being tested:
186
+
187
+ ```
188
+ app.ts: new WebPubSubServiceClient(primaryConnectionstring, "localhub")
189
+ app.ts: new WebPubSubEventHandler("localhub", ...)
190
+ api/routes/sessions.ts: new WebPubSubServiceClient(primaryConnectionstring, "localhub")
191
+ ```
192
+
193
+ Then start ICP and check its health:
194
+
195
+ ```
196
+ yarn start:local
197
+ curl -fsS http://localhost:8080/health
198
+ yarn test:unit
199
+ ```
200
+
201
+ Then tunnel the AAT Web PubSub hub to the local ICP process in another terminal. Use
202
+ the AAT Web PubSub endpoint and keep the upstream HTTP URL local:
203
+
204
+ ```
205
+ npx --yes --package @azure/web-pubsub-tunnel-tool awps-tunnel run \
206
+ --hub localhub \
207
+ --endpoint https://em-icp-webpubsub-aat.webpubsub.azure.com \
208
+ --upstream http://localhost:8080 \
209
+ -s 1c4f0704-a29e-403d-b719-b90c34ef14c9 \
210
+ -g em-icp-aat
211
+ ```
212
+
213
+ The tunnel needs an authenticated Azure identity that can read the AAT hub settings.
214
+ If it reports `403` after resolving the subscription and resource group, obtain the
215
+ required AAT Web PubSub access policy or RBAC permission; that is an Azure access
216
+ blocker, not a local ICP or Media Viewer failure.
217
+
218
+ Then start Media Viewer from its repository. Populate the ignored AAT `.env` if it
219
+ does not already contain the approved AAT settings, then set the ICP override:
220
+
221
+ ```
222
+ cd ../rpx-xui-media-viewer
223
+ yarn env:populate:aat
224
+ # In .env set:
225
+ # ICP_API_URL=http://localhost:8080
226
+ yarn start:aat
227
+ ```
228
+
229
+ Open `http://localhost:3000/#/media-viewer`, then run the browser regression lane:
230
+
231
+ ```
232
+ PLAYWRIGHT_REPORTERS=list yarn test:local:aat
233
+ ```
234
+
235
+ This setup tests local ICP code with AAT authentication and Web PubSub; it does not
236
+ recreate the complete retired `em-showcase` Docker stack. The validation run recorded
237
+ 19 passing ICP unit tests and 71 passing Media Viewer tests.
238
+
239
+ Current ICP source warning: `api/routes/sessions.ts` logs the primary Web PubSub
240
+ connection string. Do not make an authenticated `/icp/sessions/...` request with a
241
+ real secret until that log statement is removed; this is a source-security blocker,
242
+ not a Media Viewer setup failure.
243
+
244
+ Stop the local processes with `Ctrl+C`, then clean up Redis from the ICP worktree with
245
+ `docker compose -f docker-compose.yml down`.
246
+
125
247
  ### 5. Run Playwright tests
126
248
  Media Viewer is starting its Playwright migration with the same runner and
127
249
  reporting shape used in MC and MO, scaled to the current smoke coverage. The
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmcts/media-viewer",
3
- "version": "4.2.34",
3
+ "version": "4.2.37",
4
4
  "description": "Media Viewer",
5
5
  "keywords": [
6
6
  "Angular",
@@ -23,7 +23,7 @@
23
23
  "pdfjs-dist": "^4.10.38",
24
24
  "socket.io-client": "^4.8.0",
25
25
  "tslib": "^2.3.0",
26
- "uuid": "^11.0.3"
26
+ "uuid": "^11.1.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@angular/animations": "^20.0.0",
package/package.tgz CHANGED
Binary file