-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6.2.0 adds click random link in email, and deny list
- Loading branch information
1 parent
ffcdd80
commit 7e32765
Showing
10 changed files
with
196 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2017 Carnegie Mellon University. All Rights Reserved. See LICENSE.md file for terms. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using Ghosts.Domain.Code.Helpers; | ||
using NLog; | ||
|
||
namespace Ghosts.Domain.Code | ||
{ | ||
public static class DenyListManager | ||
{ | ||
private static readonly Logger _log = LogManager.GetCurrentClassLogger(); | ||
|
||
public static IEnumerable<string> Load() | ||
{ | ||
try | ||
{ | ||
return File.ReadAllLines(ApplicationDetails.ConfigurationFiles.DenyList); | ||
} | ||
catch (Exception e) | ||
{ | ||
_log.Trace(e); | ||
return new List<string>(); | ||
} | ||
} | ||
|
||
public static bool IsInList(string item) | ||
{ | ||
var list = Load(); | ||
return list.Any(x => x.StartsWith(item.GetUriHost(), StringComparison.InvariantCultureIgnoreCase)); | ||
} | ||
|
||
public static IEnumerable<string> ScrubList(IEnumerable<string> list) | ||
{ | ||
var denyList = Load(); | ||
var filteredList = new List<string>(); | ||
foreach (var item in list) | ||
{ | ||
if (!denyList.Any(x => x.StartsWith(item.GetUriHost(), StringComparison.InvariantCultureIgnoreCase))) | ||
{ | ||
filteredList.Add(item); | ||
} | ||
} | ||
return filteredList; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
herein_lies_the_format_of_the_deny_list.org | ||
we_can_deny_entire_domains.com | ||
or_some_subnet.of_some_domain.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters