Ejemplo n.º 1
0
        /// <summary>
        /// This method adds the encryption handler to the Microservice.
        /// </summary>
        /// <typeparam name="P">The pipeline type.</typeparam>
        /// <param name="pipeline">The pipeline.</param>
        /// <param name="handler">The handler instance.</param>
        /// <param name="action">The action on the handler.</param>
        /// <returns>The pipeline.</returns>
        public static P AddAuthenticationHandler <P>(this P pipeline
                                                     , IServiceHandlerAuthentication handler
                                                     , Action <IServiceHandlerAuthentication> action = null)
            where P : IPipeline
        {
            action?.Invoke(handler);

            pipeline.Service.ServiceHandlers.Authentication.Add(handler);

            return(pipeline);
        }
 private void OnAuthenticationAdd(IServiceHandlerAuthentication handler)
 {
     handler.Collector    = Collector;
     handler.OriginatorId = OriginatorId;
 }