0
Completed

No type validation on the constant transformation

Matthew Clark 11 years ago updated by anonymous 8 years ago 5

The Constant transformation has a feature to enter the type of value used for the constant. The default type is a Guid type field, and I am allowed to enter anything I want for its value. I am able to start an adapter with a constant value therefore populating a Guid field "newguid" with the string value "something". I was also able to do this with a date field. Depending on the type of field that gets mapped in FIM, I'm not entirely sure what would happen on an attempt to import this field - I imagine it would result in every entry failing with unexpected data, or possibly when committing the value to the adapter context.

The result is the following when you finally set up the MA and run an import:

The extensible extension returned an unsupported error.
 The stack trace is:
 
 "System.Exception: Error encountered attempting import: Invalid date time - the value passed was something    at Unify.Product.IdentityBroker.EntityDateTimeTypeSchemaValidator`1.CreateValue(Object dataValue)
   at Unify.Product.IdentityBroker.ConstantTransformationFactory.CreateComponent(IAdapterEntityTransformationFactoryInformation factoryInformation)
   at Unify.Product.IdentityBroker.EntitySequentialAdapterFactory.<>c__DisplayClasse.<CreateComponent>b__d(ITransformationFactory innerFactory)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Unify.Product.IdentityBroker.EntitySequentialAdapterFactory.CreateComponent(IAdapterEntityTransformationFactoryInformation factoryInformation)
   at Unify.Product.IdentityBroker.Adapter.GetAllTransformedEntities(Boolean reflect)
   at Unify.Product.IdentityBroker.AdapterNotifierDecoratorBase`1.GetAllEntities(Boolean reflect)
   at Unify.Product.IdentityBroker.LDIFAdapterBase.GetEntitiesForFullImport(Guid adapterId)
   at Unify.Product.IdentityBroker.LDIFAdapterBase.ImportAll(Guid adapterId)
   at Unify.Product.IdentityBroker.LDIFAdapterServiceHostDecoratorBase.ImportAll(Guid adapterId)
   at SyncInvokeImportAll(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
   at Unify.Product.IdentityBroker.IdentityBrokerManagementAgentProxy.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData)
   at Unify.Product.IdentityBroker.IdentityBrokerManagementAgent.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData) in S:\Hg\Adapters\Microsoft.FIM\Master\Source\Unify.IdentityBroker.FIMAdapter\IdentityBrokerManagementAgent.cs:line 53
Forefront Identity Manager 4.0.2592.0"

This also halted the entire import process - it was not just an error on a per object basis

"Halted entire process" because the transformation factory couldn't be created. This is the correct behaviour. As for validation, exception description needs to be improved obviously; on the UI side, this is a little tricky to do on the client side, you could do it potentially pretty easily on the server side (validation errors).

Matthew Clark, I have updated the constant transformation to validate. Please let me know if you have any issues with it.

Confirmed or migrated to VSO.