public void From(Gateway gateway) { this.BufferSize = gateway.BufferSize; this.PoolMaxSize = gateway.PoolMaxSize; foreach (var server in gateway.Agents.Servers) { Servers.Add(new ServerInfo { MaxConnections = server.MaxConnections, Uri = server.Uri.ToString(), Remark = server.Remark, Category = server.Category }); } this.OutputServerAddress = gateway.OutputServerAddress; this.AgentMaxConnection = gateway.AgentMaxConnection; this.AgentRequestQueueSize = gateway.AgentRequestQueueSize; this.GatewayQueueSize = gateway.GatewayQueueSize; this.InstanceID = gateway.InstanceID; UrlConfig urlConfig = new UrlConfig(); urlConfig.From(gateway.Routes.Default); Urls.Add(urlConfig); foreach (var route in gateway.Routes.Urls) { urlConfig = new UrlConfig(); urlConfig.From(route); Urls.Add(urlConfig); } this.PluginConfig = new PluginConfig(gateway.Pluginer); this.PluginsStatus = gateway.PluginCenter.PluginsStatus; }
public LuisService(UrlConfig urlConfig, string spellCheckerKey) { if (urlConfig == null) { throw new ArgumentNullException(nameof(urlConfig)); } if (String.IsNullOrEmpty(urlConfig.Url)) { throw new ArgumentNullException(nameof(urlConfig) + ".Url"); } if (String.IsNullOrEmpty(urlConfig.Key)) { throw new ArgumentNullException(nameof(urlConfig) + ".Key"); } this.BaseUrl = urlConfig.Url; this.SpellCheckerKey = spellCheckerKey; lock (client) { if (!client.DefaultRequestHeaders.Contains("Ocp-Apim-Subscription-Key")) { client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", urlConfig.Key); } } }
public async Task <IActionResult> load() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <BadgeEntity>(json); // load all badges var _posts = await BadgeBLL.Load(_context, data); // load all categories var _categories = await GA_CategoryBLL.Load(_context, new GACategoryEntity() { }); foreach (var item in _posts) { item.img_url = UrlConfig.Return_Badge_Image(item.icon); } var _records = 0; if (data.id == 0) { _records = BadgeBLL.Count(_context, data); } return(Ok(new { posts = _posts, records = _records, categories = _categories })); }
// Core script to handle website layout private void Process_Layout() { UGeneral ug = new UGeneral(); int selected_layout_option = Site_Settings.NavigationSection; if (selected_layout_option == 2) { // three column layout navigation1.Visible = false; // advance navigation disable navigation_sm1.Visible = true; // first column simple navigation third_nav1.Visible = true; // third column navigation } else { // two column layout navigation1.Visible = true; navigation_sm1.Visible = false; third_nav1.Visible = false; } NavigationClass = ug.Return_Navigation_Class(); BodyClass = ug.Return_Body_Class(); BodyRight = ug.Return_RightNav_Class(); // set meta information HtmlHead head = (HtmlHead)Page.Header; string meta_title = "Advance Channel Search"; string meta_description = "You can search user profiles and channels through list of advance search options available on this page"; MetaTagsBLL.META_StaticPage(this.Page, head, meta_title, meta_description, UrlConfig.Return_Website_Logo_Url(), Config.GetUrl("channel/searchoptions.aspx")); }
private async Task <string> GetAuthTokenAsync() { var request = new HttpRequestMessage(HttpMethod.Post, UrlConfig.Authorize()); var content = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("grant_type", "client_credentials") }; request.Content = new FormUrlEncodedContent(content); var authHeader = Base64UrlEncoder.Encode($"{_appSettings.ClientId}:{_appSettings.ClientSecret}"); request.Headers.Add("Authorization", $"Basic {authHeader}"); var client = _clientFactory.CreateClient(); var response = await client.SendAsync(request); if (!response.IsSuccessStatusCode) { throw new Exception("Unable to Authenticate with SpotifyId servers."); } var json = await response.Content.ReadAsStringAsync(); var token = JsonConvert.DeserializeObject <AuthResponse>(json); return($"{token.TokenType} {token.AccessToken}"); }
public void Load(UrlConfig urlConfig, ConfigNode node) { this._resourceUrl = urlConfig.Url; this._urlConfig = urlConfig; this._configFileFullName = urlConfig.Parent.FullPath; this.Load(node); }
static void ConfigureJwtBearerOptions(JwtBearerOptions opts, UrlConfig urlConfig) { opts.Authority = urlConfig.Auth; opts.Audience = "maw_api_resource"; // https://damienbod.com/2017/10/16/securing-an-angular-signalr-client-using-jwt-tokens-with-asp-net-core-and-identityserver4/ opts.Events = new JwtBearerEvents { OnMessageReceived = context => { var isUploadr = context.Request.Path.Value?.StartsWith("/uploadr", true, CultureInfo.InvariantCulture) ?? false; if (isUploadr && context.Request.Query.TryGetValue("token", out StringValues token)) { context.Token = token; } return(Task.CompletedTask); }, OnAuthenticationFailed = context => { var te = context.Exception; return(Task.CompletedTask); } }; }
private HostString GetHost(UrlConfig urlConfig) { if (urlConfig.HttpsPort.HasValue) { if (urlConfig.HttpsPort.Value == 443 || urlConfig.HttpsPort.Value <= 0) { return(new HostString(urlConfig.CanonicalHost)); } else { return(new HostString(urlConfig.CanonicalHost, urlConfig.HttpsPort.Value)); } } else if (urlConfig.HttpPort.HasValue) { if (urlConfig.HttpPort == 80 || urlConfig.HttpPort.Value <= 0) { return(new HostString(urlConfig.CanonicalHost)); } else { return(new HostString(urlConfig.CanonicalHost, urlConfig.HttpPort.Value)); } } else { return(new HostString(urlConfig.CanonicalHost)); } }
private string ProcessThumb(Member_Struct ph) { StringBuilder str = new StringBuilder(); if (this.ThumbCssClass == "") { this.ThumbCssClass = "thumbnail"; } // photo thumb string image_src = UrlConfig.Return_User_Profile_Photo(ph.UserName, ph.PictureName, this.ThumbPreviewOption, 0); if (ph.PictureName == "none" || ph.PictureName == "") { image_src = Config.GetUrl("images/dmember.png"); } else if (ph.PictureName.Contains("http")) { image_src = ph.PictureName; } str.Append("<a class=\"" + ThumbCssClass + "\" style=\"width:" + this.Width + "px;\" href=\"" + this.PreviewUrl + "\" title=\"" + ph.UserName + "\">"); // thumb link setup str.Append("<img src=\"" + image_src + "\" height=\"" + this.Height + "\" width=\"" + this.Width + "\">"); str.Append("</a>"); return(str.ToString()); }
public TaskEntity Add([FromBody] TaskDto taskDto, int idProject, int idJalon) { TaskEntity task = new TaskEntity() { AssigneeId = taskDto.AssigneeId, Label = taskDto.Label, PlannedStartDate = taskDto.PlannedStartDate, PlannedEndDate = taskDto.PlannedStartDate.AddDays(taskDto.Cost), RealStartDate = taskDto.RealStartDate, RealEndDate = taskDto.RealEndDate, Cost = taskDto.Cost, Description = taskDto.Description, Exigences = taskDto.Exigences, JalonId = idJalon, RequiredTask = taskDto.RequiredTaskId, }; UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon }; return(_TaskService.Add(task, config)); }
protected void Page_Load(object sender, EventArgs e) { if (Site_Settings.NavigationSection == 1) { // right side navigation NavigationClass = "chnl_right_nav"; BodyClass = "chnl_left_mn"; } // globalization text btn_login.Text = Resources.vsk.submit; if (!Page.IsPostBack) { if (Request.Params["status"] != null) { switch (Request.Params["status"].ToString()) { case "invalid": Config.ShowMessageV2(msg, "Error validation key and username", "Error!", 0); break; } } pnl_result.Visible = false; } // set meta information HtmlHead head = (HtmlHead)Page.Header; string meta_title = Resources.vsk.meta_forgotpassword_title; string meta_description = Resources.vsk.meta_forgotpassword_description; MetaTagsBLL.META_StaticPage(this.Page, head, meta_title, meta_description, UrlConfig.Return_Website_Logo_Url(), Config.GetUrl("forgotpassword.aspx")); }
public string Process(Comment_Struct grp) { this.AuthorUrl = UrlConfig.Prepare_User_Profile_Url(grp.UserName, this.isAdmin); StringBuilder str = new StringBuilder(); string reply_pad = ""; string container_size = "100%"; if (grp.ReplyID > 0) { reply_pad = "padding-left:3%;"; container_size = "97%"; } // don't remove class name "vskcmtcnt" its internal use only str.Append("<div id=\"citem_" + grp.CommentID + "\" class=\"vskcmtcnt\" style=\"width:" + container_size + ";" + reply_pad + ";\">\n"); str.Append("<div id=\"cmsg_" + grp.CommentID + "\"></div>\n"); // to display runtime messages str.Append("<div class=\"" + this.BoxCssClass + "\">\n"); string container = "class=\"item_pad_2\""; if (this.isHoverEffect) { container = "class=\"" + this.HoverCssClass + "\""; } if (this.isAltColor) { container = "class=\"" + this.AltCssClass + "\""; } str.Append("<div " + container + ">\n"); switch (this.TemplateID) { case 0: // youtube style comment style str.Append(YoutubeStyleTemplate(grp)); break; case 1: // Facebook style comment str.Append(FBStyleTemplate(grp)); break; case 2: // Blog style comment str.Append(BlogStyleTemplate(grp)); break; case 3: // Simple Style str.Append(ProcessContent_Simple(grp)); break; } str.Append("</div>\n"); //close hover box str.Append("</div>\n"); // close box css class str.Append("</div>\n"); // close main box // reset urls for next itemgroup this.AuthorUrl = ""; return(str.ToString()); }
public void Setup() { urlConfig = new UrlConfig() { CanonicalHost = "www.foo.bar", HttpPort = 80, HttpsPort = 443 }; rule = new RedirectToCanonicalHostRule(urlConfig); }
//UIConfig _uiConfig; public RequestEmailHandler(IRepository <Review, int> revRepository, UserManager <User> userManager, IEmailService mailer, IOptions <UrlConfig> uiConfig, IRazorViewToStringRenderer razorViewToStringRenderer) { _reviewRepository = revRepository; _userManager = userManager; _mailer = mailer; _uiConfig = uiConfig.Value; _razorViewToStringRenderer = razorViewToStringRenderer; }
/// <summary> /// Конструктор базового сервиса Http клиента /// </summary> /// <param name="client">Http клиент</param> /// <param name="accessor">Текущий Http клиент</param> /// <param name="options">Конфигурация подключения клиента</param> public BaseService(HttpClient client, IHttpContextAccessor accessor, IOptionsMonitor <UrlConfig> options) { _client = client; _accessor = accessor; _options = options.CurrentValue; }
protected void Page_Load(object sender, EventArgs e) { // set meta information HtmlHead head = (HtmlHead)Page.Header; string meta_title = Resources.vsk.meta_terms_title; string meta_description = Resources.vsk.meta_terms_description; MetaTagsBLL.META_StaticPage(this.Page, head, meta_title, meta_description, UrlConfig.Return_Website_Logo_Url(), Config.GetUrl("terms.aspx")); }
public List <JalonEntity> FindAll(int idProject) { UrlConfig config = new UrlConfig() { IdProject = idProject }; return(_jalonService.FindAll(config)); }
public UserEntity FindOne(int idUser) { UrlConfig config = new UrlConfig() { IdUser = idUser }; return(_UserService.FindOne(config)); }
public List <TaskEntity> FindAll(int idProject, int idJalon) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon }; return(_TaskService.FindAll(config)); }
public TaskEntity FindOne(int idProject, int idJalon, int idTask) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon, IdTask = idTask }; return(_TaskService.FindOne(config)); }
public List <TaskEntity> Remove(int idProject, int idJalon, int idTask) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon, IdTask = idTask }; return(_TaskService.Remove(config)); }
public JalonEntity FindOne(int idProject, int idJalon) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon }; return(_jalonService.FindOne(config)); }
public List <JalonEntity> Remove(int idProject, int idJalon) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdJalon = idJalon }; return(_jalonService.Remove(config)); }
public ProjectEntity FindOne(int idProject) { UrlConfig config = new UrlConfig() { IdProject = idProject }; return(_projectService.FindOne(config)); }
public List <ExigenceEntity> FindAll(int idProject) { UrlConfig config = new UrlConfig() { IdProject = idProject }; return(_exigenceService.FindAll(config)); }
public ExigenceEntity FindOne(int idExigence, int idProject) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdExigence = idExigence }; return(_exigenceService.FindOne(config)); }
public List <ExigenceEntity> Remove(int idProject, int idExigence) { UrlConfig config = new UrlConfig() { IdProject = idProject, IdExigence = idExigence }; return(_exigenceService.Remove(config)); }
public List <ProjectEntity> Remove(int idProject) { UrlConfig config = new UrlConfig() { IdProject = idProject }; return(_projectService.Remove(config)); }
public AuthorizationClientService(HttpClient client, IOptionsMonitor <UrlConfig> options, IHttpContextAccessor accessor) : base(client, accessor, options) { _options = options.CurrentValue; _client = client; _accessor = accessor; _client.BaseAddress = new Uri(_options.AuthenticateUrl); _client.DefaultRequestHeaders.Add("Accept", "*/*"); }
public ProjectEntity Add([FromBody] ProjectDto projectDto) { var project = new ProjectEntity { Label = projectDto.Label, AssigneeId = projectDto.AssigneeId }; UrlConfig config = new UrlConfig(); return(_projectService.Add(project, config)); }