<commit_before>﻿namespace TestHttpCompositionConsoleApp.ConfigurationSources
{
    using Contexts.Http;
    using Contexts.Http.Configuration;
    using Newtonsoft.Json;
    using Serviceable.Objects.Composition.Graph.Stages.Configuration;
    using Serviceable.Objects.IO.NamedPipes.Server;
    using Serviceable.Objects.IO.NamedPipes.Server.Configuration;

    public sealed class ServiceContainerConfigurationSource : IConfigurationSource
    {
        public string GetConfigurationValueForKey(string serviceName, string graphNodeId, string typeName)
        {
            switch (typeName)
            {
                case var s when s == typeof(NamedPipeServerContext).AssemblyQualifiedName:
                    return JsonConvert.SerializeObject(new NamedPipeServerConfiguration
                    {
                        PipeName  = string.Join(".", serviceName, graphNodeId) // TODO: centralise the configuration discovery
                    });
                case var s when s == typeof(OwinHttpContext).AssemblyQualifiedName:
                    return JsonConvert.SerializeObject(new OwinHttpContextConfiguration()
                    {
                        Host = "$in.Host",
                        Port = "$in.Port",
                    });
                default:
                    return null;
            }
        }
    }
}<commit_msg>TODO item is irrelevant now<commit_after>﻿namespace TestHttpCompositionConsoleApp.ConfigurationSources
{
    using Contexts.Http;
    using Contexts.Http.Configuration;
    using Newtonsoft.Json;
    using Serviceable.Objects.Composition.Graph.Stages.Configuration;
    using Serviceable.Objects.IO.NamedPipes.Server;
    using Serviceable.Objects.IO.NamedPipes.Server.Configuration;

    public sealed class ServiceContainerConfigurationSource : IConfigurationSource
    {
        public string GetConfigurationValueForKey(string serviceName, string graphNodeId, string typeName)
        {
            switch (typeName)
            {
                case var s when s == typeof(NamedPipeServerContext).AssemblyQualifiedName:
                    return JsonConvert.SerializeObject(new NamedPipeServerConfiguration
                    {
                        PipeName  = string.Join(".", serviceName, graphNodeId)
                    });
                case var s when s == typeof(OwinHttpContext).AssemblyQualifiedName:
                    return JsonConvert.SerializeObject(new OwinHttpContextConfiguration()
                    {
                        Host = "$in.Host",
                        Port = "$in.Port",
                    });
                default:
                    return null;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.06994818652849741, 'fraction_numerical': 0.0, 'mean_word_length': 1.8971061093247588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7396933', 'n_tokens_mistral': 628, 'n_tokens_neox': 602, 'n_words': 125}