22using FlowSynx . Plugins . Azure . Blobs . Models ;
33using FlowSynx . PluginCore . Extensions ;
44using FlowSynx . Plugins . Azure . Blobs . Services ;
5+ using FlowSynx . PluginCore . Helpers ;
56
67namespace FlowSynx . Plugins . Azure . Blobs ;
78
89public class AzureBlobPlugin : IPlugin
910{
1011 private IAzureBlobManager _manager = null ! ;
1112 private AzureBlobSpecifications _azureBlobSpecifications = null ! ;
13+ private bool _isInitialized ;
1214
1315 public PluginMetadata Metadata
1416 {
@@ -31,16 +33,23 @@ public PluginMetadata Metadata
3133
3234 public Task Initialize ( IPluginLogger logger )
3335 {
36+ if ( ReflectionHelper . IsCalledViaReflection ( ) )
37+ throw new InvalidOperationException ( Resources . ReflectionBasedAccessIsNotAllowed ) ;
38+
3439 ArgumentNullException . ThrowIfNull ( logger ) ;
3540 var connection = new AzureBlobConnection ( ) ;
3641 _azureBlobSpecifications = Specifications . ToObject < AzureBlobSpecifications > ( ) ;
3742 var client = connection . Connect ( _azureBlobSpecifications ) ;
3843 _manager = new AzureBlobManager ( logger , client , _azureBlobSpecifications . ContainerName ) ;
44+ _isInitialized = true ;
3945 return Task . CompletedTask ;
4046 }
4147
4248 public async Task < object ? > ExecuteAsync ( PluginParameters parameters , CancellationToken cancellationToken )
4349 {
50+ if ( ReflectionHelper . IsCalledViaReflection ( ) )
51+ throw new InvalidOperationException ( Resources . ReflectionBasedAccessIsNotAllowed ) ;
52+
4453 var operationParameter = parameters . ToObject < OperationParameter > ( ) ;
4554 var operation = operationParameter . Operation ;
4655
0 commit comments