Repository navigation
Release v22.109.0
Storage connections can now be resolved per tenant: which server, database and identity a MongoDB or Entity Framework Core connection uses, from configuration, a template, an HTTP endpoint or your own code. Nothing changes unless you configure it.
Added
Cratis.Arc.Connections: a connection resolution contract (IConnectionResolver,ConnectionRequest,ResolvedConnection,ConnectionIdentity,ConnectionPurpose). Every part of a resolved connection is optional, so a resolver can answer for the connection string, the database, the schema, the identity, or any combination. (#3314)- Built-in
Default,Template,HttpandCustomresolvers, with aConnectionslot and anIdentityslot that use the same shape and are applied in order. Resolutions are cached in memory per request, honorexpiresAt, and are dropped when a login fails. (#3314) ArcOptions.ConnectionResolution, configurable in code or underCratis:Arc:ConnectionResolution, resolves connections for MongoDB and Entity Framework Core alike. An integration's ownConnectionResolutionreplaces it for that integration. (#3314)ConnectionPurposeScope.Begin(ConnectionPurpose.Schema)so migrations can connect with a different identity than data access. (#3314)MongoDBOptions.ConnectionResolution, configurable in code or underCratis:MongoDB:ConnectionResolution. A resolved user name and password becomes a SCRAM credential, and a resolved access token becomes a MONGODB-OIDC credential that refreshes through the resolver. (#3315)EntityFrameworkCoreOptions.ConnectionResolution. Arc-registered contexts resolve the connection for the current tenant and purpose every time it opens, so pooled contexts stay correct across tenants. Access tokens becomeSqlConnection.AccessTokenon SQL Server and the password on PostgreSQL. (#3316)- A language-neutral REST specification, with an OpenAPI description, of the endpoint the
Httpresolver calls: https://github.com/Cratis/Arc/blob/main/Documentation/connection-resolution-contract.md (part of #3317) - Documentation for connection resolution, with how-to pages for MongoDB and Entity Framework Core: https://github.com/Cratis/Arc/blob/main/Documentation/backend/csharp/tenancy/connection-resolution.md (#3317) (#3313)
Changed
EntityFrameworkCoreOptions(ConnectionString,AutoDiscoverDbContexts,ConnectionResolution) now bind from theCratis:EntityFrameworkCoreconfiguration section. TheconfigureOptionscallback runs afterwards and wins. (part of #3316)