| 177 | } |
| 178 | |
| 179 | func extractPermissions(description string) []string { |
| 180 | matches := permissionRegex.FindStringSubmatch(description) |
| 181 | if len(matches) < 2 { |
| 182 | return nil |
| 183 | } |
| 184 | |
| 185 | permStr := strings.TrimSpace(matches[1]) |
| 186 | if permStr == "None" || permStr == "" { |
| 187 | return nil |
| 188 | } |
| 189 | |
| 190 | // Remove parenthetical notes like "(for project parent)" |
| 191 | if idx := strings.Index(permStr, "("); idx > 0 { |
| 192 | permStr = strings.TrimSpace(permStr[:idx]) |
| 193 | } |
| 194 | |
| 195 | // Split by comma |
| 196 | perms := strings.Split(permStr, ",") |
| 197 | |
| 198 | var result []string |
| 199 | for _, p := range perms { |
| 200 | p = strings.TrimSpace(p) |
| 201 | if p != "" && p != "None" { |
| 202 | result = append(result, p) |
| 203 | } |
| 204 | } |
| 205 | return result |
| 206 | } |
| 207 | |
| 208 | func (idx *OpenAPIIndex) indexKeywords(ep *EndpointInfo) { |
| 209 | // Extract keywords from service, method, summary |