Commit 1620019
feat: full azd extension framework adoption - metadata, MCP server, lifecycle events (#37)
* feat: add metadata capability for IntelliSense and rich CLI help
Add the metadata capability to the azd-exec extension to enable:
- CLI help integration with rich usage information
- IntelliSense support for extension flags and arguments
- Configuration validation schemas
Changes:
- Add 'metadata' to capabilities in extension.yaml
- Create hidden metadata command that outputs JSON metadata
- Register metadata command in root command
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add lifecycle-events and mcp-server capabilities
Implement full azd extension framework integration:
- Real listen command with azdext.ExtensionHost for lifecycle events
- MCP server with exec_script, exec_inline, list_shells, get_environment tools
- Rate limiting (60 calls/min, burst 10) and security validation for MCP tools
- Update extension.yaml with lifecycle-events and mcp-server capabilities
- Add go.work entry for azure-dev dependency
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add distributed tracing and refactor to use azdextutil
- Hydrate context with TRACEPARENT for distributed trace correlation
- Replace duplicated rate limiter with azdextutil.RateLimiter
- Use azdextutil security helpers for path/shell validation
- Use azdextutil.GetProjectDir for safe directory resolution
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: use azdext SDK for tracing and metadata
- Switch from azdextutil.SetupTracingFromEnv to azdext.NewContext() for proper OTel tracing
- Replace hand-written metadata with azdext.GenerateExtensionMetadata() for framework-conforming schema
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: filter env vars in MCP tool and clean up lifecycle stubs
- Filter get_environment to only return AZD_*/AZURE_*/ARM_* prefixed vars (security)
- Remove meaningless lifecycle event handler stubs from listen command
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: preserve cobra context chain for signal handling
Replace azdext.NewContext() (starts from context.Background()) with
propagation.TraceContext{}.Extract() on the existing cobra context,
preserving Ctrl+C handling and other context values.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: security hardening for MCP server
- Filter secret-bearing env vars (SECRET, PASSWORD, KEY, TOKEN, etc.)
- Switch from deprecated ValidatePath to security.ValidatePathWithinBases
- Normalize shell binary names to lowercase for cross-platform compat
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: add MCP server unit tests for security-critical paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add CONNECTION_STRING to secret denylist
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: update azd-core to latest (CI-compatible pseudo-version)
Pin go.mod to azd-core v0.5.2-0.20260223042348-df3319c65059 which includes
lint fixes, macOS symlink test fix, and gofmt formatting.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: resolve lint errors (errcheck, gofmt)
- Check error return of fmt.Fprintln in metadata command
- Fix gofmt formatting (CRLF -> LF line endings)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: resolve remaining lint (errcheck, unlambda, gofmt)
- Use t.Setenv in tests instead of unchecked os.Setenv
- Simplify lambda wrappers (gocritic unlambda)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add azdext/traceparent terms to cspell dictionary
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: pin azd-core to tagged v0.5.2 release
Replace pseudo-version with official tagged release.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 1ae69b6 commit 1620019
11 files changed
Lines changed: 1130 additions & 18 deletions
File tree
- cli
- src/cmd/exec
- commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
18 | 45 | | |
| 46 | + | |
19 | 47 | | |
| 48 | + | |
20 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
21 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
22 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
23 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
24 | 83 | | |
| 84 | + | |
25 | 85 | | |
26 | 86 | | |
| 87 | + | |
27 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
28 | 93 | | |
0 commit comments