File tree Expand file tree Collapse file tree 4 files changed +27
-3
lines changed
Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using jcdcdev . Umbraco . Core . Extensions ;
3+ using Umbraco . Cms . Core . Manifest ;
4+ using Umbraco . Cms . Infrastructure . Manifest ;
5+
6+ namespace Umbraco . Community . DataProtection . Composing ;
7+
8+ public class PackageManifestReader : IPackageManifestReader
9+ {
10+ public Task < IEnumerable < PackageManifest > > ReadPackageManifestsAsync ( )
11+ {
12+ var packageManifest = new PackageManifest
13+ {
14+ Name = Constants . PackageName ,
15+ Version = Assembly . GetAssembly ( typeof ( PackageManifestReader ) ) ? . GetName ( ) . Version ? . ToSemVer ( ) ? . ToString ( ) ?? "0.1.0" ,
16+ AllowPublicAccess = false ,
17+ AllowTelemetry = true ,
18+ Extensions = [ ]
19+ } ;
20+
21+ return Task . FromResult < IEnumerable < PackageManifest > > ( [ packageManifest ] ) ;
22+ }
23+ }
Original file line number Diff line number Diff line change 33using Microsoft . Extensions . DependencyInjection ;
44using Microsoft . Extensions . Options ;
55using Umbraco . Cms . Core . DependencyInjection ;
6+ using Umbraco . Cms . Infrastructure . Manifest ;
67using Umbraco . Community . DataProtection . Persistence ;
78using Umbraco . Extensions ;
89
@@ -12,6 +13,7 @@ public static class UmbracoBuilderExtensions
1213{
1314 public static IDataProtectionBuilder AddUmbracoDataProtection ( this IUmbracoBuilder builder , string ? applicationDiscriminator = null , Action < KeyManagementOptions > ? configureOptions = null )
1415 {
16+ builder . Services . AddSingleton < IPackageManifestReader , PackageManifestReader > ( ) ;
1517 builder . PackageMigrationPlans ( ) ! . Add < MigrationPlan > ( ) ;
1618 builder . Services . AddSingleton < UmbracoXmlRepository > ( ) ;
1719 builder . Services . AddSingleton < IConfigureOptions < KeyManagementOptions > > ( services =>
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ namespace Umbraco.Community.DataProtection;
22
33public static class Constants
44{
5- public const string PackageId = "Umbraco.Community.DataProtection" ;
6- public const string PackageName = "Simple Data Protection" ;
5+ public const string PackageName = "Umbraco.Community.DataProtection" ;
76
87 public static class Tables
98 {
Original file line number Diff line number Diff line change 22
33namespace Umbraco . Community . DataProtection . Persistence ;
44
5- public class MigrationPlan ( ) : PackageMigrationPlan ( Constants . PackageId )
5+ public class MigrationPlan ( ) : PackageMigrationPlan ( Constants . PackageName )
66{
77 protected override void DefinePlan ( )
88 {
You can’t perform that action at this time.
0 commit comments