@@ -141,6 +141,7 @@ namespace plugify {
141141 struct Security {
142142 std::unordered_set<std::string> whitelistedExtensions;
143143 std::unordered_set<std::string> blacklistedExtensions;
144+ std::unordered_set<std::filesystem::path> excludedDirs = DefaultExludedDirs;
144145
145146 bool HasWhitelist () const {
146147 return !whitelistedExtensions.empty ();
@@ -149,6 +150,10 @@ namespace plugify {
149150 bool HasBlacklist () const {
150151 return !blacklistedExtensions.empty ();
151152 }
153+
154+ bool HasExcluded () const {
155+ return excludedDirs != DefaultExludedDirs;
156+ }
152157 } security;
153158
154159 // Logging configuration
@@ -301,6 +306,10 @@ namespace plugify {
301306 security.blacklistedExtensions = other.security .blacklistedExtensions ;
302307 securityChanged = true ;
303308 }
309+ if (other.security .HasExcluded ()) {
310+ security.excludedDirs = other.security .excludedDirs ;
311+ securityChanged = true ;
312+ }
304313 } else {
305314 // Other sources merge/append
306315 if (other.security .HasWhitelist ()) {
@@ -317,6 +326,13 @@ namespace plugify {
317326 );
318327 securityChanged = true ;
319328 }
329+ if (other.security .HasExcluded ()) {
330+ security.excludedDirs .insert (
331+ other.security .excludedDirs .begin (),
332+ other.security .excludedDirs .end ()
333+ );
334+ securityChanged = true ;
335+ }
320336 }
321337
322338 if (securityChanged) {
@@ -451,5 +467,14 @@ namespace plugify {
451467
452468 return {};
453469 }
470+
471+ private:
472+ static constexpr std::unordered_set<std::filesystem::path> DefaultExludedDirs = {
473+ PLUGIFY_PATH_LITERAL (" disabled" ),
474+ PLUGIFY_PATH_LITERAL (" .git" ),
475+ PLUGIFY_PATH_LITERAL (" .svn" ),
476+ PLUGIFY_PATH_LITERAL (" temp" ),
477+ PLUGIFY_PATH_LITERAL (" tmp" ),
478+ };
454479 };
455480} // namespace plugify
0 commit comments