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
This also repairs the LINGYUN.Abp.MaxMindGeoIP2.Tests build: the previous commit removed
AbpMaxMindGeoIP2Module.DefaultDatabaseFile while this project still referenced it.
GeoLite2 is licensed by MaxMind and must not be redistributed, so the module no longer
ships or embeds the database: the consumer supplies it at deployment time, and a missing
file degrades to empty results instead of failing the host.
...
BREAKING CHANGE: AbpMaxMindGeoIP2Module.DefaultDatabaseFile was removed and the module no
longer embeds GeoLite2-City.mmdb. Hosts must download a GeoLite2 database and configure
MaxMindGeoIP2:DatabaseFile; without it IP location resolution returns empty results.
Migrate the local file system blobs written by the legacy OssManagement to
BlobManagement, so an existing deployment can be moved to the new storage
without touching the files by hand.
- add BlobMigrationCommand (blob-migration): walk the working directory and upload
every file matching the search pattern through IBlobIntegrationService; the options
cover the working directory (-wd), the search option (-so) and pattern (-sp), the
bucket (-bn), the blob path (-pn) and name (-on), the service url (-u), the tenant
(-t) and overwrite (-ow), plus a list only mode (-ls) to confirm the blob names first
- add ICurrentBlob/CurrentBlob and BlobHttpClientHandler so the command can retarget the
client proxies to the given BlobManagement url, send the __tenant header and skip the
result wrapper for the current run
- register the BlobManagement static client proxies and AbpHttpClientModule in
AbpCliModule, and embed the generated ClientProxies json into the assembly
- add the Volo.Abp.Ddd.Application.Contracts and Volo.Abp.Http.Client references, and make
CreateCommand.GetUsageInfo virtual so the new command can reuse it
- set an output template for the file logger and split the launchSettings profiles into
one profile per command
Serilog enrichers:
- AbpLoggingSerilogElasticsearchModule and AbpLoggingSerilogOpenObserveModule now depend on
AbpSerilogEnrichersApplicationModule and AbpSerilogEnrichersUniqueIdModule, so the providers
pull in the ApplicationName / UniqueId enrichers their queries rely on
- add the corresponding project references (and drop the unused LINGYUN.Linq.Dynamic.Queryable
reference from the Elasticsearch logging package, add Serilog.Sinks.OpenTelemetry to the
OpenObserve logging package)
Documentation:
- add aspnet-core/framework/logging/README.md: a directory level index covering all five logging
modules (core Logging, the Elasticsearch and OpenObserve ILoggingProvider implementations and
the two Serilog enrichers) with module references, configuration options and notes
- document the OpenObserve audit log store in aspnet-core/framework/auditing/README.md:
storage support, module reference, AuditLogging:OpenObserve options and the platform notes
(per-tenant streams, append-only/delete not supported, flattened nested arrays, stream creation)
- add the missing English README of LINGYUN.Abp.Logging.Serilog.OpenObserve (the Chinese one linked
to a file that did not exist) and document that the condition parser / SQL builder helpers moved
from LINGYUN.Abp.Logging.Serilog.OpenObserve.Utils to LINGYUN.Abp.OpenObserve.Utils
Add an OpenObserve implementation of the audit logging stores as an alternative to
Elasticsearch: audit logs, security logs, entity changes and actions go into separate
streams and are queried with OpenObserve SQL.
LINGYUN.Abp.AuditLogging.OpenObserve:
- AbpAuditLoggingOpenObserveOptions binds AuditLogging:OpenObserve; the child streams are
derived from AuditLogStream (GetEntityChangeStream/GetActionStream), no separate options
- OpenObserveAuditLogWriter / OpenObserveSecurityLogWriter replace IAuditLogWriter /
ISecurityLogWriter; OpenObserveAuditLogManager / OpenObserveSecurityLogManager replace
IAuditLogManager / ISecurityLogManager; OpenObserveEntityChangeStore replaces IEntityChangeStore
- entity changes and actions are flattened into their own streams; Actions.* conditions use a
two-step query (match auditlogid in the actions stream, then filter the main stream by id),
because OpenObserve cannot query nested arrays structurally
- multi-tenancy: stream names are per tenant (audit_log_{tenantId:N}) via
IOpenObserveStreamNameNormalizer; writes resolve the log's own tenant, queries the current one
- writes may override _timestamp with the log time (AuditLog.ExecutionTime /
SecurityLog.CreationTime), bounded by TimestampAllowedUptoHours since OpenObserve only accepts
data within ZO_INGEST_ALLOWED_UPTO (5 hours by default)
- entity change details and _timestamp are handled by OpenObserveEntityChangeConverter through
IAuditLoggingOpenObserveSerializer (ABP IJsonSerializer by default), so entities never use
JsonSerializer directly
- deletion is not supported by OpenObserve (append-only, no DELETE/UPDATE): DeleteAsync /
DeleteManyAsync throw the business exception AuditLoggingOpenObserve:010001
("当前日志设施不支持删除记录!" / "The current logging facility does not support deleting records!")
backed by a zh-Hans/en localization resource
- a stream that does not exist yet (nothing ingested) yields an empty result and logs a warning
instead of failing
Shared infrastructure:
- move Condition / ComparisonOp / ExpressionParser from LINGYUN.Abp.Logging.Serilog.OpenObserve
to LINGYUN.Abp.OpenObserve (the parser now also handles Any(member) expressions) and add
OpenObserveSqlBuilder for SQL condition building
Tests:
- LINGYUN.Abp.AuditLogging.OpenObserve.Tests runs the shared AuditLogManager_Tests suite (delete
hooks overridden to assert the not-supported exception) plus tests for the timestamp helper,
localization, entity change round-trip, multi-tenant isolation and the missing-stream warning;
test streams are unique per host instance and cleaned up on shutdown
- AuditLogManager_Tests gains virtual DeleteAsync / DeleteManyAsync hooks (default behaviour unchanged)
Introduce an extension point that lets modules enrich audit/security log entries
before they are queued or written, instead of having to replace the whole store.
- add IAuditLogInfoContributor / ISecurityLogInfoContributor together with
AuditLogInfoContributorContext / SecurityLogInfoContributorContext
(IServiceProviderAccessor + the log info being enriched)
- AbpAuditLoggingOptions gains AuditLogInfoContributors / SecurityLogInfoContributors;
AuditingStore and SecurityLogStore run them (guarded by Any()) inside a fresh
service scope before enqueueing or writing the log
- LINGYUN.Abp.AuditLogging.IP.Location now contributes the resolved IP location
through that extension point instead of replacing IAuditingStore / ISecurityLogStore:
remove IPLocationAuditingStore and IPLocationSecurityLogStore, add
IPLocationAuditLogInfoContributor / IPLocationSecurityLogInfoContributor and
IPLocationConstants, and have AbpAuditLoggingIPLocationModule register both contributors
- document AbpAuditLoggingIPLocationOptions (section AuditLogging:IPLocation,
environment variable AuditLogging__IPLocation__IsEnabled) and make its default
IsEnabled = false explicit
- EfCoreAuditLogManager.GetAsync uses FindAsync with a nullable mapping so that a
missing audit log returns null instead of throwing
Note: the IP location remark is now stored under the "IPLocation" extra property
(previously "Location").
- migrate both test modules to the new options: RemoveCountry / RemoveProvince
name arrays instead of the previous UseCountry / UseProvince predicates
- add IPLocationRemarksTest: a table driven test for the shared remark rules with one
dedicated address per case (IPv4 and IPv6), covering
* nothing configured -> country only (中国)
* country matches RemoveCountry -> province + city (浙江省杭州市), same-name
collapse (重庆市), province only (香港特别行政区), country data only -> empty remarks
* country does not match -> unchanged (日本, 德国)
* province matches RemoveProvince -> city only (吉林市), no city -> empty remarks,
and it also applies to non-Chinese addresses (2001:200::1 -> 新宿区)
* province takes precedence over country (8.8.8.8 -> 杭州市)
- update the provider expectations for the new rules:
* IP2Region: 220.246.0.1 -> 香港特别行政区 (was 中国香港特别行政区);
the physical file test now expects the default country-only remark (中国)
* MaxMind: the two "country data only" cases (114.114.114.114, 180.76.76.76) moved to
TestSearchRemovedCountryOnly, which asserts Country == "中国" while Remarks is empty
No production code changes; these tests pin the shared rules implemented in
LINGYUN.Abp.IP.Location.
Verified: dotnet test LINGYUN.Abp.IP2Region.Tests (85 passed) and
LINGYUN.Abp.MaxMindGeoIP2.Tests (42 passed), 0 failed.
- delete aspnet-core/services/LY.MicroService.IdentityServer[.HttpApi.Host],
aspnet-core/services/LY.AIO.Applications.Single and their
EntityFrameworkCore / DbMigrator projects
- drop the stale references in build/modules.dependencies.json and tye.yaml
- add AbpAuditLoggingIPLocationModule / AbpMaxMindGeoIP2Module to the startup modules of
every service, gateway and the Aspire hosts (project references included)
- enable AuditLogging:IPLocation:IsEnabled and IPLocation:RemoveCountry (中国) in
docker-compose and the hosts' appsettings.Development.json
- AbpIPLocationResolveOptions: replace the UseCountry/UseProvince predicates with the
RemoveCountry/RemoveProvince name arrays and bind them from the new "IPLocation"
configuration section in AbpIPLocationModule
- IPLocationResolveContributorBase: shared remark rules for every provider
(province matches RemoveProvince -> city only; country matches RemoveCountry ->
province + city with the same-name collapse; otherwise country only; empty remarks
when every part was removed)
- document the rules, the IPLocation section and the environment variables in the
LINGYUN.Abp.IP2Region and LINGYUN.Abp.MaxMindGeoIP2 READMEs
Logging:
- reference LINGYUN.Abp.Logging.Serilog.OpenObserve and register
AbpLoggingSerilogOpenObserveModule (the Elasticsearch module is now declared
explicitly in the module dependencies)
- wrap the Serilog WriteTo pipeline in an Async sink and add an OpenTelemetry
sink (endpoint, protocol, resource attributes)
- set Logging:Provider to ElasticsearchLoggingProvider and add the OpenObserve
endpoint/token to the development settings
- add the Serilog.Sinks.Async / Serilog.Sinks.Console / Serilog.Sinks.OpenTelemetry
package references
- rotate the file sinks by size as well (rollOnFileSizeLimit, retainedFileCountLimit
50, fileSizeLimitBytes 5 MB)
Solutions:
- add LINGYUN.Abp.Logging.Serilog.OpenObserve to the AllInOne solution and remove
the duplicated /tests/ folder (those test projects stay in LINGYUN.MicroService.All.slnx)
- add LINGYUN.Abp.MaxMindGeoIP2 to the Aspire solution
Auth:
- accept the API resource audience of this host: AuthServer:ValidAudiences now also
contains "all_in_one" (the access token audience comes from the API scope resource
created in OpenIddictDataSeederContributor), so OpenIddict validation no longer
rejects tokens with ID2094
- the JwtBearer scheme now applies ValidAudiences from configuration as well, together
with the wildcard issuer validator configuration
Also: global usings tidied up (LINGYUN.Abp.IP.Location is no longer needed by the host).
Rename the single (monolith) application, its migration projects and the
associated solution file to follow the LINGYUN.Abp.MicroService.* naming
convention.
Renamed projects:
- LY.MicroService.Applications.Single
-> LINGYUN.Abp.MicroService.AllInOne
- LY.MicroService.Applications.Single.EntityFrameworkCore
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore
- LY.MicroService.Applications.Single.EntityFrameworkCore.MySql
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.MySql
- LY.MicroService.Applications.Single.EntityFrameworkCore.PostgreSql
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.PostgreSql
- LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.SqlServer
- LY.MicroService.Applications.Single.DbMigrator
-> LINGYUN.Abp.MicroService.AllInOne.DbMigrator
- aspnet-core/LINGYUN.MicroService.SingleProject.slnx
-> aspnet-core/LINGYUN.MicroService.AllInOne.slnx
Renamed identifiers:
- MicroServiceApplicationsSingleModule -> AllInOneModule
(AllInOneModule.cs, AllInOneModule.Configure.cs, referenced from Program.cs)
Also updated:
- namespaces, <RootNamespace>, ProjectReference paths and the solution entries
- Dockerfile entry point (LINGYUN.Abp.MicroService.AllInOne.dll)
- build/build-aspnetcore-common.ps1 (solution array)
- README.md / README.en.md (solution list) and the project READMEs / docs that
referenced the previous names
Code fixes required by the new namespace (namespaces under LINGYUN.Abp shadow
top-level namespaces):
- SingleMigrationsDbContext: fully qualify LINGYUN.Platform.Datas.Data, because
the simple name Data now resolves to the LINGYUN.Abp.Data.* namespace
- AllInOneModule.Configure: use global::Elsa.* for the Elsa startup types,
because Elsa.Activities.* now resolves to LINGYUN.Abp.Elsa.Activities.*
(Elsa.Activities.Webhooks.Startup would otherwise silently bind to the wrong type)
BREAKING CHANGE: assembly names, namespaces, the Docker entry point and the
published package ids of the migration projects changed. Consumers must update
their references:
- LY.MicroService.Applications.Single.EntityFrameworkCore
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore
- LY.MicroService.Applications.Single.EntityFrameworkCore.MySql
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.MySql
- LY.MicroService.Applications.Single.EntityFrameworkCore.PostgreSql
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.PostgreSql
- LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer
-> LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.SqlServer
- LY.MicroService.Applications.Single.DbMigrator
-> LINGYUN.Abp.MicroService.AllInOne.DbMigrator
Stale package artifacts in the LocalNuget output folders were removed; rebuild
(or pack) to regenerate them with the new names.
Verified:
- dotnet build aspnet-core/LINGYUN.MicroService.AllInOne.slnx (0 errors)
- all six renamed projects build with 0 errors
- 196 tracked files were relocated (193 detected as renames), no tracked file lost
- text scan for the previous names returns no remaining references
Note: aspnet-core/templates/aio still declares MicroServiceApplicationsSingleModule;
renaming the AIO template is intentionally left for a follow-up.