apiops init: generate a Copilot prompt file to audit artifacts against APIM best practices
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
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- azure, typescript
- Lĩnh vực
- backend-api-design, cli
Hướng nghiên cứu
Bắt đầu với src/templates/copilot/identity-setup-prompt.ts và src/services/init-service.ts để theo dõi mẫu tạo prompt hiện có. Sau đó kiểm tra src/commands/init-command.ts để xem output của các bước tiếp theo và cách xử lý generatedFiles.configs. Công việc được xem là hoàn tất khi apiops init tạo prompt mới cùng với identity prompt, đồng thời focused artifact audit bắt đầu bằng việc tìm các secrets hardcoded trong policy.xml và đưa ra phương án khắc phục.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem or use case
After apiops extract, users have no guided way to check their extracted APIM artifacts against APIM best practices. The audit should look for anti-patterns (e.g. named values holding secrets that aren''t marked secret) that otherwise go unnoticed. We want a low-friction, Copilot-assisted audit that also offers to fix the issues it finds.
Proposed solution
Have apiops init generate an additional Copilot prompt file — e.g. .github/prompts/apiops-check-best-practices.prompt.md — following the same generation pattern as the existing identity-setup prompt (src/templates/copilot/identity-setup-prompt.ts, written in src/services/init-service.ts). When opened with GitHub Copilot, the prompt guides the user through auditing the artifacts in the repo against a focused set of APIM best practices.
Scope — only things apiops-cli tracks
Keep the checks centered on apiops-managed artifacts (policies, named values, backends, diagnostics/loggers, subscriptions, products). Explicitly out of scope: infra/SKU/networking/scale guidance from the WAF doc that doesn''t map to apiops artifacts.
Checks (initial set)
- Hardcoded secrets in
policy.xml(headline check) — detect literal secrets in policy XML (set-headerauth/keys,set-query-parametercode/sig,authentication-basicpassword,validate-jwtkeys, connection-string fragments).- Offer to fix: create a (secret) named value for the secret and rewrite the policy to reference it via
{{named-value}}, per https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-properties
- Offer to fix: create a (secret) named value for the secret and rewrite the policy to reference it via
- Named values holding secrets that aren''t marked
secret: trueor aren''t Key Vault–backed → flag and offer to mark/migrate. - Backend URLs / keys inlined in policies instead of using named values/backends → suggest parameterizing.
(Start with check #1; #2–#3 can follow.)
Reference
APIM best-practice guidance: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-api-management — used as a source, but the prompt should distill only the artifact-level items above rather than the full large-deployment guidance.
Affected command
apiops init (generates the prompt file); the prompt itself assists with apiops extract output.
Implementation notes
- New template under
src/templates/copilot/(e.g.best-practices-prompt.ts) + embedded markdown, mirroringidentity-setup-prompt.ts. - Write the file in
init-service.tsalongside the identity prompt (conflict-check + add togeneratedFiles.configs), and mention it in theinit-command.tsnext-steps output. - Relates to #198 (the CLI-side redact-and-warn for the same class of issue; this prompt is the interactive remediation counterpart).
- Ngôn ngữ chính
- TypeScript
- Star
- 29
- Fork
- 10
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 22
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 Azure/apiops-cli
-
type:question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Azure/apiops-cli#24 · 1 bình luận ·
-
type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Azure/apiops-cli#291 ·
-
type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Azure/apiops-cli#276 ·
Tất cả issue của Azure/apiops-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·