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,19 @@
/**
* Provides predicates for reasoning about regular expressions
* that match URLs and hostname patterns.
*/
private import javascript as JS
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeImpl
private import semmle.javascript.Regexp as RegExp
private import codeql.regex.HostnameRegexp as Shared
private module Impl implements Shared::HostnameRegexpSig<TreeImpl> {
class DataFlowNode = JS::DataFlow::Node;
class RegExpPatternSource = RegExp::RegExpPatternSource;
string getACommonTld() { result = RegExp::RegExpPatterns::getACommonTld() }
}
import Shared::Make<TreeImpl, Impl>