Support environment variable placeholders in configuration files
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi việc tải cấu hình cho devproxyrc.json và các tệp cấu hình plugin, sau đó đọc ProxyUtils.ReplaceVariables, IProxyConfiguration.Env và đường dẫn thay thế hiện có của MinimalPermissionsPlugin. Xác minh cách các giá trị môi trường và phần cấu hình env được biểu diễn trước khi quyết định việc phân giải nên nằm ở đâu. Hoàn tất khi các placeholder ${VAR_NAME} được phân giải nhất quán trong các tệp cấu hình được nêu mà không cần một script viết lại, với việc bao phủ các placeholder được nhúng như issuer URL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Dev Proxy config files (devproxyrc.json and plugin config files like CrudApiPlugin API files) don't support environment variable placeholders. This means values that vary per environment — like Entra app client IDs or tenant IDs — must be hardcoded in config files, or users need to write scripts to patch them before running Dev Proxy.
Example: the workaround today
In the da-ristorante-api-devproxy-entra sample, we need to inject ENTRA_APP_CLIENT_ID and ENTRA_APP_TENANT_ID into the CrudApiPlugin API files. Because Dev Proxy doesn't support this, the sample includes a Node.js script that reads .env.local and rewrites the JSON config files before each run.
The config file looks like this:
{
"entraAuthConfig": {
"audience": "<ENTRA_APP_CLIENT_ID>",
"issuer": "https://login.microsoftonline.com/<ENTRA_APP_TENANT_ID>/v2.0"
}
}
And the script manually replaces those placeholders with values from env files. This works but adds friction — extra tooling, an extra build step, and mutated config files that can accidentally get committed.
What I'd like to see
Support for environment variable references in config files, for example:
{
"entraAuthConfig": {
"audience": "${ENTRA_APP_CLIENT_ID}",
"issuer": "https://login.microsoftonline.com/${ENTRA_APP_TENANT_ID}/v2.0"
}
}
When Dev Proxy loads a config file, it would resolve ${VAR_NAME} placeholders against environment variables (or the env config section).
Why this seems feasible
Dev Proxy already has closely related infrastructure:
- Path tokens:
~appFolderand~dataFolderare resolved viaProxyUtils.ReplacePathTokenswhen loading config/plugin paths @dynamictokens: used in mock responses and rate limiting headers, resolved at runtimeProxyUtils.ReplaceVariables: a general-purpose string replacement utility that replaces variable references in a string given a dictionary of valuesIProxyConfiguration.Env: the proxy configuration already exposes aDictionary<string, string> EnvpropertyMinimalPermissionsPluginalready usesProxyUtils.ReplaceVariables(fileContents, ProxyConfiguration.Env, v => $"{{{v}}}")to resolve{VAR}placeholders in OpenAPI spec files
The pattern is already proven in plugins — it just needs to be applied when loading configuration files too.
Benefits
- No more wrapper scripts to inject environment-specific values
- Config files stay clean and committable (no secrets, no environment-specific values)
- Consistent with how other tools handle this (Docker Compose, Azure Pipelines, GitHub Actions, etc.)
- Works naturally with
.envfiles and CI/CD environments
- Ngôn ngữ chính
- C#
- Star
- 832
- Fork
- 90
- Merge trung bình
- 18 giờ 41 phút
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/dev-proxy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting for response
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
dotnet/dev-proxy#1914 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less messageCó thể làm lại được @garrytrinder đã nhận 86 ngày trước và không có pull request nào đang mở. Đang mở
dotnet/dev-proxy#1757 · 1 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dotnet/dev-proxy
Issue tương tự
-
Bug pulumi/pulumi
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
activescott/lessmsi#306 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
HTML sitemap lists unpublished pagesCó thể đã có người làm @KrzysztofPajak đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
grandnode/grandnode2#883 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: `winapp ui <command> --on sandbox --help` starts sandbox setup instead of showing helpĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày