File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ package poetry
33import (
44 "context"
55 "fmt"
6+ "path/filepath"
7+ "regexp"
8+ "strings"
9+
610 "github.com/murphysecurity/murphysec/model"
711 "github.com/murphysecurity/murphysec/utils"
812 "github.com/pelletier/go-toml/v2"
913 "github.com/pkg/errors"
10- "path/filepath"
11- "regexp"
12- "strings"
1314)
1415
1516var ErrParsePoetry = poetryErr ("ErrParsePoetry: Bad manifest" )
@@ -95,6 +96,21 @@ func parsePoetry(input []byte) (*Manifest, error) {
9596 m [k ] = v
9697 }
9798 }
99+
100+ // 解析 [tool.poetry.group.<group_name>.dependencies]
101+ if groups , ok := root .Get ("tool" , "poetry" , "group" ).v .(map [string ]any ); ok {
102+ for _ , group := range groups {
103+ if groupMap , ok := group .(map [string ]any ); ok {
104+ if deps , ok := groupMap ["dependencies" ].(map [string ]any ); ok {
105+ for k , v := range deps {
106+ m [k ] = v
107+ }
108+ }
109+ }
110+ }
111+ }
112+
113+ // 解析 [project.dependencies](兼容性处理)
98114 if mm , ok := root .Get ("project" , "dependencies" ).v .([]any ); ok {
99115 for _ , _s := range mm {
100116 var s , ok = _s .(string )
You can’t perform that action at this time.
0 commit comments