put the shared HostnameRegexp code in the shared regex pack

This commit is contained in:
erik-krogh
2022-12-15 14:30:22 +01:00
parent 30451ee950
commit f67d0bc8c0
20 changed files with 369 additions and 653 deletions

View File

@@ -0,0 +1,20 @@
/**
* Provides predicates for reasoning about regular expressions
* that match URLs and hostname patterns.
*/
private import python
private import semmle.python.dataflow.new.DataFlow
private import semmle.python.RegexTreeView::RegexTreeView as TreeImpl
private import semmle.python.dataflow.new.Regexp as Regexp
private import codeql.regex.HostnameRegexp as Shared
private module Impl implements Shared::HostnameRegexpSig<TreeImpl> {
class DataFlowNode = DataFlow::Node;
class RegExpPatternSource = Regexp::RegExpPatternSource;
string getACommonTld() { result = Regexp::RegExpPatterns::getACommonTld() }
}
import Shared::Make<TreeImpl, Impl>