Commit 20b5b70
Implement RegisterEntity generic API endpoint
Implements the RegisterEntity gRPC endpoint to provide a unified,
synchronous API for registering any entity type (repositories, releases,
artifacts, pull requests) in Minder.
This change extracts common entity creation logic into a reusable
EntityCreator service that is used by both synchronous (RegisterEntity)
and asynchronous (webhook-based) entity registration flows.
Key changes:
- Add RegisterEntity RPC handler with generic entity creation
- Create EntityCreator service to unify entity creation logic
- Implement pluggable validator framework (RepositoryValidator)
- Refactor RepositoryService to use EntityCreator (reduced from ~90 to ~30 lines)
- Refactor async entity handler to use EntityCreator
- Update proto to use google.protobuf.Struct for type-safe properties
- Add comprehensive test coverage (27 new tests)
Security improvements:
- Input validation for property count (max 100) and key length (max 200)
- Context cancellation protection in cleanup operations
- Improved error wrapping for better debugging
The implementation maintains backward compatibility with existing
RegisterRepository RPC while providing a foundation for registering
other entity types through a single unified API.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent e4f6f47 commit 20b5b70
File tree
20 files changed
+2233
-385
lines changed- docs/docs/ref
- internal
- controlplane
- entities
- handlers
- strategies/entity
- service
- mock
- validators
- repositories
- service
- pkg/api
- openapi/minder/v1
- protobuf/go/minder/v1
- proto/minder/v1
20 files changed
+2233
-385
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
181 | 184 | | |
182 | 185 | | |
183 | 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 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
0 commit comments