apiops init: generate a Copilot prompt file to audit artifacts against APIM best practices
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- azure, typescript
- Ambito
- backend-api-design, cli
Direzione di ricerca
Inizia da src/templates/copilot/identity-setup-prompt.ts e src/services/init-service.ts per seguire il pattern esistente di generazione dei prompt. Poi esamina src/commands/init-command.ts per l’output dei passaggi successivi e la gestione di generatedFiles.configs. Il lavoro è completo quando apiops init genera il nuovo prompt insieme al prompt di identità e l’audit mirato dell’artefatto inizia con la ricerca di secret hardcoded in policy.xml, offrendo una remediation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- TypeScript
- Stelle
- 29
- Fork
- 10
- Merge medio
- 1g 14h
- PR unite (30g)
- 22
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/apiops-cli
-
type:question
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Azure/apiops-cli#24 · 1 commento ·
-
type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Azure/apiops-cli#291 ·
-
type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
Azure/apiops-cli#276 ·
Tutte le issue di Azure/apiops-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
copse-dev/agent-pane#2953 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·