V17/17.3 hmac image url updates - #946
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates uSync’s rich-text dependency detection to better include linked media/content and introduces a helper to regenerate HMAC-protected image URLs when moving content between environments. It also updates the generated OpenAPI clients (History + Backoffice Management Client) to rely on Umbraco’s preconfigured HTTP client instead of manually wiring auth at extension init time.
Changes:
- Add
ISyncImageUpdateHelper+ implementation and invoke it from the RTE mapper during import to refresh image URLs when HMAC is enabled. - Refactor RTE dependency scanning to optionally include linked media/items via both UDIs and
{localLink:...}patterns (and avoid unnecessary lookups unless flags request it). - Update Swagger/OpenAPI client generation + runtime configuration (umbHttpClient-based), add bearer security metadata/401 error typings, and bump package versions to
17.3.0.
Reviewed changes
Copilot reviewed 25 out of 27 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| uSync.History/uSyncHistoryComposer.cs | Swagger doc key adjustments and adds an operation security filter for the History API. |
| uSync.History/uSyncHistory.cs | Introduces SyncHistoryConstants.ApiName. |
| uSync.History/history-client/src/index.ts | Removes manual auth/client configuration during extension init. |
| uSync.History/history-client/src/hey-api.ts | Adds runtime config hook to inherit settings from umbHttpClient. |
| uSync.History/history-client/src/api/types.gen.ts | Adds typed 401 error shapes for secured endpoints. |
| uSync.History/history-client/src/api/sdk.gen.ts | Adds bearer security metadata to requests and uses typed error shapes. |
| uSync.History/history-client/src/api/index.ts | Re-exports newly generated error types. |
| uSync.History/history-client/src/api/client.gen.ts | Uses runtime config (createClientConfig) during client creation. |
| uSync.History/history-client/scripts/generate-openapi.js | Configures hey-api client generation to use runtimeConfigPath. |
| uSync.History/history-client/package.json | Version bump to 17.3.0. |
| uSync.History/history-client/package-lock.json | Lockfile version bump alignment to 17.3.0. |
| uSync.History/Controllers/uSyncHistoryController.cs | Uses SyncHistoryConstants.ApiName for MapToApi. |
| uSync.Core/Versions/17.3/SyncImageUpdateHelper.cs | New helper to parse RTE HTML and regenerate image URLs (HMAC-aware). |
| uSync.Core/Versions/17.3/ISyncImageUpdateHelper.cs | New interface for updating image URLs inside HTML. |
| uSync.Core/uSyncCoreBuilderExtensions.cs | Registers ISyncImageUpdateHelper in DI. |
| uSync.Core/Mapping/Mappers/RTEMapper.cs | Updates import pipeline and dependency extraction (UDIs + localLink GUIDs), and wires in HMAC image URL updating. |
| uSync.Backoffice.Management.Client/usync-assets/tsconfig.dist.json | Changes dist build to emit JS (not declarations-only) and tightens TS extension importing. |
| uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/settings/settings.element.ts | Adjusts re-export path for a settings component. |
| uSync.Backoffice.Management.Client/usync-assets/src/index.ts | Removes manual auth/client configuration during extension init. |
| uSync.Backoffice.Management.Client/usync-assets/src/hey-api.ts | Adds runtime config hook to inherit settings from umbHttpClient. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/types.gen.ts | Regenerated types (removes some previously exported models). |
| uSync.Backoffice.Management.Client/usync-assets/src/api/index.ts | Updates exports to match regenerated types. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/client.gen.ts | Uses runtime config (createClientConfig) during client creation. |
| uSync.Backoffice.Management.Client/usync-assets/package.json | Version bump to 17.3.0. |
| uSync.Backoffice.Management.Client/usync-assets/package-lock.json | Lockfile version bump alignment to 17.3.0. |
| uSync.Backoffice.Management.Client/usync-assets/openapi-ts.config.ts | Configures hey-api generation to use runtimeConfigPath. |
| Directory.Packages.props | Adds a centrally-managed version for Clean.Core. |
Files not reviewed (2)
- uSync.Backoffice.Management.Client/usync-assets/package-lock.json: Language not supported
- uSync.History/history-client/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR expands uSync’s import/mapping pipeline to support updating image URLs when Umbraco imaging HMAC settings differ between environments, and updates OpenAPI client generation/consumption to rely on the backoffice HTTP client configuration (bearer auth, base URL, etc.). It also adds a version/format “sync file info” endpoint and supporting client plumbing.
Changes:
- Add
ISyncImageUpdateHelper+ implementation and wire it into RTE import to remap image URLs (HMAC-aware). - Extend import value-mapper APIs to accept
SyncSerializerOptions, and update mapper collection + serializers to pass options through. - Add version-file service + management API endpoint (
GetSyncFileInfo) and generated client updates (Hey API runtime config, bearer security).
Reviewed changes
Copilot reviewed 53 out of 55 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Adds a centrally-managed package version entry. |
| uSync.BackOffice/Services/ISyncVersionFileService.cs | New interface for reading/writing the uSync version file metadata. |
| uSync.BackOffice/Services/SyncService.cs | Uses version-file service during export startup. |
| uSync.BackOffice/Services/SyncService_Handlers.cs | Writes version file after bulk export via new service. |
| uSync.BackOffice/Services/SyncVersionFileService.cs | Implements version file read/write + HMAC check model. |
| uSync.BackOffice/uSyncBackOfficeBuilderExtensions.cs | Registers ISyncVersionFileService. |
| uSync.Backoffice.Management.Api/Controllers/Actions/uSyncActionsController.cs | Adds GetSyncFileInfo endpoint. |
| uSync.Backoffice.Management.Api/Models/SyncActionGroup.cs | Minor formatting cleanup. |
| uSync.Backoffice.Management.Api/Services/ISyncManagementService.cs | Adds GetSyncFileInfo() contract. |
| uSync.Backoffice.Management.Api/Services/uSyncManagementService.cs | Implements GetSyncFileInfo() and adjusts unpack call. |
| uSync.Backoffice.Management.Client/usync-assets/openapi-ts.config.ts | Configures Hey API runtime client config path. |
| uSync.Backoffice.Management.Client/usync-assets/package-lock.json | Bumps client package lock version fields. |
| uSync.Backoffice.Management.Client/usync-assets/package.json | Bumps client package version. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/client.gen.ts | Generated client now uses runtime config helper. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/index.ts | Exports new API types for sync file info. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/sdk.gen.ts | Adds ActionsService.getSyncFileInfo() and security metadata. |
| uSync.Backoffice.Management.Client/usync-assets/src/api/types.gen.ts | Adds SyncFileVersionCheckResult + endpoint types. |
| uSync.Backoffice.Management.Client/usync-assets/src/components/index.ts | Exports new sync-file-info banner component. |
| uSync.Backoffice.Management.Client/usync-assets/src/components/usync-sync-file-info-view.ts | New UI component for HMAC/format mismatch banners. |
| uSync.Backoffice.Management.Client/usync-assets/src/hey-api.ts | New helper to inherit config from umbHttpClient. |
| uSync.Backoffice.Management.Client/usync-assets/src/index.ts | Removes manual auth wiring; relies on runtime config. |
| uSync.Backoffice.Management.Client/usync-assets/src/lang/files/en-us.ts | Adds localized strings for HMAC/format mismatch banner. |
| uSync.Backoffice.Management.Client/usync-assets/src/repository/SyncAction.respositoy.ts | Adds repository method for sync file info. |
| uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncAction.source.ts | Adds data source method for sync file info. |
| uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/default/default.element.ts | Fetches sync-file-info and introduces placeholder rendering hook. |
| uSync.Backoffice.Management.Client/usync-assets/src/workspace/views/settings/settings.element.ts | Switches settings component re-export path. |
| uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts | Stores syncFileInfo state and fetch method. |
| uSync.Backoffice.Management.Client/usync-assets/tsconfig.dist.json | Emits JS during dist build (not declarations only). |
| uSync.Core/Mapping/ISyncMapper.cs | Adds options-aware import overloads + updates ISyncPropertyMapper. |
| uSync.Core/Mapping/Mappers/DateMapper.cs | Updates mapper import signature to accept options. |
| uSync.Core/Mapping/Mappers/ImagePathMapper.cs | Updates mapper import signature and nullability tweaks. |
| uSync.Core/Mapping/Mappers/MemberGroupPickerManager.cs | Updates mapper import signature to accept options. |
| uSync.Core/Mapping/Mappers/RTEMappers/RTEBlockDataContentMigrator.cs | Updates mapper import signature + forwards options. |
| uSync.Core/Mapping/Mappers/RTEMapper.cs | Adds HMAC mapping on import and improves dependency detection behavior. |
| uSync.Core/Mapping/Mappers/RepeatableValueMapper.cs | Updates mapper import signature to accept options. |
| uSync.Core/Mapping/SyncBlockMapperBase.cs | Passes SyncSerializerOptions through block mapping pipeline. |
| uSync.Core/Mapping/SyncValueMapperBase.cs | Introduces options-aware overloads and obsoletes older import signature. |
| uSync.Core/Mapping/SyncValueMapperCollection.cs | Threads SyncSerializerOptions into mapper invocation. |
| uSync.Core/Serialization/Serializers/ContentSerializerBase.cs | Threads SyncSerializerOptions through import mapping calls. |
| uSync.Core/Versions/17.3/ISyncImageUpdateHelper.cs | New helper interface for HMAC-aware image URL updates. |
| uSync.Core/Versions/17.3/SyncImageUpdateHelper.cs | New HTML image URL rewriter using Umbraco media + image URL generator. |
| uSync.Core/uSyncConstants.cs | Removes obsolete attribute from legacy types container. |
| uSync.Core/uSyncCoreBuilderExtensions.cs | Registers ISyncImageUpdateHelper. |
| uSync.History/Controllers/uSyncHistoryController.cs | Uses constant for MapToApi name. |
| uSync.History/history-client/package-lock.json | Bumps history-client lock version fields. |
| uSync.History/history-client/package.json | Bumps history-client package version. |
| uSync.History/history-client/scripts/generate-openapi.js | Adds Hey API runtime config path for generated client. |
| uSync.History/history-client/src/api/client.gen.ts | Generated client now uses runtime config helper. |
| uSync.History/history-client/src/api/index.ts | Exports new generated error types. |
| uSync.History/history-client/src/api/sdk.gen.ts | Adds bearer security + typed error maps. |
| uSync.History/history-client/src/api/types.gen.ts | Adds 401 error types for operations. |
| uSync.History/history-client/src/hey-api.ts | New helper to inherit config from umbHttpClient. |
| uSync.History/history-client/src/index.ts | Removes manual auth wiring; relies on runtime config. |
| uSync.History/uSyncHistory.cs | Introduces ApiName constant. |
| uSync.History/uSyncHistoryComposer.cs | Aligns Swagger API doc naming + adds security operation filter. |
Files not reviewed (2)
- uSync.Backoffice.Management.Client/usync-assets/package-lock.json: Language not supported
- uSync.History/history-client/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Updates the dependency checks for RTE values so we can also include linked media as part of a content item push/pull.
Adds a ISyncImageUpdateHelper method that allows us to update HMAC query values on URLs. (used in the RTE Mapper for now).