-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afb1456
commit 06556f8
Showing
9 changed files
with
121 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{} | ||
|
15 changes: 15 additions & 0 deletions
15
pkg/languages/java/.snapshots/TestPattern-catch_class_decorator
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,15 @@ | ||
(*builder.Result)({ | ||
Query: (string) (len=147) "([(class_declaration [(modifiers . [(annotation [ (identifier )] @param1 [ (annotation_argument_list )])] .)] name: (_) [ (class_body )])] @root)", | ||
VariableNames: ([]string) (len=1) { | ||
(string) (len=1) "_" | ||
}, | ||
ParamToVariable: (map[string]string) { | ||
}, | ||
EqualParams: ([][]string) <nil>, | ||
ParamToContent: (map[string]map[string]string) (len=1) { | ||
(string) (len=6) "param1": (map[string]string) (len=1) { | ||
(string) (len=10) "identifier": (string) (len=14) "RequestMapping" | ||
} | ||
}, | ||
RootVariable: (*language.PatternVariable)(<nil>) | ||
}) |
15 changes: 15 additions & 0 deletions
15
pkg/languages/java/.snapshots/TestPattern-catch_function_decorator
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,15 @@ | ||
(*builder.Result)({ | ||
Query: (string) (len=241) "([(class_declaration name: (_) [(class_body [(method_declaration . [(modifiers . [(annotation [ (identifier )] @param1 [ (annotation_argument_list )])] .)] type: (_) . name: (_) . [ (formal_parameters )] [ (block )] .)] @match )])] @root)", | ||
VariableNames: ([]string) (len=1) { | ||
(string) (len=1) "_" | ||
}, | ||
ParamToVariable: (map[string]string) { | ||
}, | ||
EqualParams: ([][]string) <nil>, | ||
ParamToContent: (map[string]map[string]string) (len=1) { | ||
(string) (len=6) "param1": (map[string]string) (len=1) { | ||
(string) (len=10) "identifier": (string) (len=14) "RequestMapping" | ||
} | ||
}, | ||
RootVariable: (*language.PatternVariable)(<nil>) | ||
}) |
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,17 @@ | ||
languages: | ||
- java | ||
patterns: | ||
- pattern: | | ||
$<!>@RequestMapping($<...>) class $<...>$<_>$<...>{} | ||
- pattern: | | ||
class $<...>$<_> $<...>{ | ||
$<!>@GetMapping($<...>) | ||
$<...>$<_> $<_>($<...>)$<...>{} | ||
} | ||
severity: high | ||
metadata: | ||
description: Test detection decorator | ||
remediation_message: Test detection decorator | ||
cwe_id: | ||
- 42 | ||
id: decorator_test |
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,21 @@ | ||
package com.example; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@SpringBootApplication | ||
@RequestMapping("/api") | ||
@RestController | ||
public class App { | ||
public static void main(String[] args) { | ||
SpringApplication.run(SpringApiApp.class, args); | ||
} | ||
|
||
@GetMapping("/base-greet") | ||
public String baseGreet() { | ||
return "Hello from the base application class!"; | ||
} | ||
} |