Exemplo n.º 1
0
        public string GetSearchItemUrl(object dataItem)
        {
            BootstrapSearchResult sr = (BootstrapSearchResult)dataItem;
            string url = sr.Section != null?BootstrapUtils.GenerateDemoSectionUrl(sr.Section) : BootstrapUtils.GenerateDemoPageUrl(sr.Demo);

            return(string.Format(LinkFormatString, ResolveClientUrl(url)));
        }
Exemplo n.º 2
0
        public string GetSearchItemDemoGroupUrl(object dataItem)
        {
            BootstrapSearchResult sr = (BootstrapSearchResult)dataItem;
            string url = BootstrapUtils.GenerateDemoPageUrl(sr.Group);

            return(string.Format(LinkFormatString, ResolveClientUrl(url)));
        }
        /// <summary>
        /// Adds SecureSign configuration information to the config builder.
        /// </summary>
        /// <param name="config"></param>
        public static IConfigurationBuilder AddSecureSignConfig(this IConfigurationBuilder config)
        {
            var rootPath = BootstrapUtils.DetermineRootDirectory();

            config.Sources.Clear();
            return(config
                   .AddInMemoryCollection(new Dictionary <string, string>
            {
                // Default path configuration
                { "Paths:Root", rootPath },
                { "Paths:EncryptionKeys", Path.Combine(rootPath, "keys") },
                { "Paths:Certificates", Path.Combine(rootPath, "secrets") },                       // https://youtu.be/_j-Tji1DueU
            })

                   .SetBasePath(rootPath)
                   // TODO: This should probably load `appsettings.{environment}.json too.
                   .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                   .AddJsonFile(PathConfig.ACCESS_TOKEN_FILENAME, optional: true, reloadOnChange: true)

                   .AddEnvironmentVariables());
        }