Commit a74ee68
authored
feat(linear): add more Linear tools (#2467)
* feat(linear): align tool coverage with MCP list/get endpoints
* chore(linear): bump plugin version to 0.0.2
* chore(linear): bump dify plugin sdk range
* fix(linear): remove sensitive data from log messages
* fix(linear): prevent GraphQL injection by using query variables
Replace f-string interpolation of user input in GraphQL queries with
proper query variables to prevent injection attacks. This affects 9
tool files that were building filter strings via string interpolation.
Changes:
- Replace f-string filter building with GraphQL variable objects
- Pass variables dict to query_graphql() method
- Maintain same functionality while preventing injection
Fixes security vulnerability in:
- linear_list_projects.py
- linear_list_cycles.py
- linear_get_teams.py
- linear_list_issue_statuses.py
- linear_list_documents.py
- linear_get_users.py (complex nested OR/AND filters)
- linear_list_project_labels.py
- linear_list_issue_labels.py
- linear_get_user_issues.py
* fix(linear): add comprehensive security hardening
- Add resource whitelist validation to prevent GraphQL injection attacks
- Sanitize error messages to prevent information disclosure
- Add input length validation (title: 255 chars, description/body: 50,000 chars)
- Fix exception handling to prevent unbound variable errors
Security improvements address:
- HIGH: GraphQL injection via string interpolation in query_basic_resource
- MEDIUM: Information disclosure through raw API responses in errors
- LOW: DoS potential through unlimited input lengths
* fix(linear): use typed filter variables for optional GraphQL filters
Convert 7 tools from inline filter variables to typed $filter parameter.
Fixes bug where null filter values caused incorrect query results when
optional filters were omitted.
- Pattern: $filter: XxxFilter (optional), conditionally include in variables
- Affected: teams, cycles, documents, issueLabels, workflowStates, projectLabels, projects
* chore(linear): remove unused legacy LinearClient
Delete tools/linear/tools/linear_client.py (163 lines).
Zero imports or references found in codebase - all tools use
client/Linear.py instead.
* refactor(linear): simplify duplicated fallback logic in get_user_issues
Consolidate two identical fallback message branches into single path.
Behavior unchanged: summary attempted first, fallback on error or
missing session model.1 parent 68189a7 commit a74ee68
File tree
34 files changed
+2440
-633
lines changed- tools/linear
- client
- provider
- tools
34 files changed
+2440
-633
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
| |||
127 | 138 | | |
128 | 139 | | |
129 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
130 | 224 | | |
131 | 225 | | |
132 | 226 | | |
133 | 227 | | |
134 | 228 | | |
135 | | - | |
| |||
0 commit comments