Give the OAuth login and the mini program login their own WeChat Work grant types instead
of sharing one, and add the code2session exchange the mini program flow needs.
- AbpWeChatWorkGlobalConsts.GrantType becomes OAuthGrantType with the value "wecom_oauth",
and MiniProgramGrantType ("wecom_mp") is added
- WeChatWorkTokenExtensionGrant becomes abstract and exposes a FindUserInfoAsync hook;
WeChatWorkOAuthTokenExtensionGrant keeps the existing user info exchange and the new
WeChatWorkMiniProgramTokenExtensionGrant exchanges the js code through
IWeChatWorkUserFinder.GetCode2SessionAsync
- add the code2session model, response and mapping, plus the
/cgi-bin/miniprogram/jscode2session client call
- register both grant types in AbpOpenIddictWeChatWorkModule and allow both custom flows
in AllowWeChatWorkFlow, and migrate the remaining GrantType call sites
BREAKING CHANGE: AbpWeChatWorkGlobalConsts.GrantType was removed and its value changed, so
clients that authenticate with grant_type "wecom" must switch to "wecom_oauth"; the public
WeChatWorkTokenExtensionGrant is now abstract and must be subclassed.
Match a blob by its full name and an optional container id instead of joining the
container table on every existence check, and resolve the container once in the
calling service so the check is scoped to the current blob provider.
The FileSystem provider combined the user controlled blob name (and container name)
into the storage path without any validation, so an authenticated user holding the
BlobManagement permissions could read, overwrite or delete arbitrary files - and, with
the PublicAccess feature enabled, do it anonymously through the public download endpoint.
Fix (defence in depth):
- CalculateBlobName now resolves the path with Path.GetFullPath and asserts it is still
inside the current tenant directory (host or tenants/{id}); this also stops absolute
path injection, because Path.Combine discards its prefix when the second argument is
rooted. The prefix comparison adds a directory separator to avoid the classic
"blobs-evil" prefix bypass, and uses Ordinal on case sensitive file systems (Linux)
and OrdinalIgnoreCase on Windows/macOS
- new BlobManagementNameValidator (Domain.Shared) with a cross platform rule set shared by
the entities and the provider: rejects path separators, . and .. segments, the union of
invalid characters (\0 / \ : * ? " < > |), trailing dots/spaces and reserved device names
(CON/PRN/AUX/NUL/COM1-9/LPT1-9); CheckName validates a single segment, CheckPath validates
a path segment by segment
- container names are validated too: a name such as "x/../abp-c" stays inside the base path
(so the containment check cannot catch it) but resolves to another container directory,
which broke container isolation (e.g. writing into the private "users" container)
- BlobContainer.Name, Blob.Name and Blob.FullName are validated in the domain as well, so
invalid names are rejected before they are persisted
- new error codes BlobManagement:001005 (container name) and BlobManagement:002008 (blob name)
with zh-Hans/en texts
Tests:
- LINGYUN.Abp.BlobManagement.Domain.Tests (76 tests) for Blob / BlobContainer / the validator
- LINGYUN.Abp.BlobManagement.FileSystem.Tests (54 tests) drives the provider resolved from DI
(the test module enables BlobManagement:Provider=FileSystem with a temporary BasePath and
removes it on shutdown), covering traversal, absolute paths, NTFS alternate data streams,
Windows normalization collisions, container names/aliases, tenant isolation and legitimate
names
configureawait.props now provides the ConfigureAwait weaver through the Fody 6.9.3
WeaverConfiguration property and sets FodyGenerateXsd=false, so the per-project
FodyWeavers.xml files and every FodyWeavers.xsd are redundant.
- delete 450 FodyWeavers.xml and 438 FodyWeavers.xsd from the framework, modules,
services, gateways, tests and migrations projects and from the micro service template
- every removed FodyWeavers.xml was equivalent to the default supplied by configureawait.props
(439 x <ConfigureAwait ContinueOnCapturedContext="false" />, 20 x <ConfigureAwait />, whose
default is ContinueOnCapturedContext=false, and 2 of those with an XML declaration); no
Blazor / AspNetCore.Components project carried one and the template manifests do not list them
- the aio template keeps its 22 files: its own Directory.Packages.props pins Fody 6.8.0, which
does not support the WeaverConfiguration property