Skip to content

docs: align mTLS skill with service model#7

Merged
guoqqqi merged 4 commits intomasterfrom
codex/fix-mtls-skill-service-model
Apr 28, 2026
Merged

docs: align mTLS skill with service model#7
guoqqqi merged 4 commits intomasterfrom
codex/fix-mtls-skill-service-model

Conversation

@guoqqqi
Copy link
Copy Markdown
Contributor

@guoqqqi guoqqqi commented Apr 28, 2026

Summary

  • Replace legacy a7 upstream create usage in a7-recipe-mtls with a7 service create.
  • Update route examples from upstream_id / uri to current service_id / paths model.
  • Update config sync example from upstreams to services.

Validation

  • make validate-skills
  • make test-skills
  • git diff --check

Fixes review feedback from #5 (comment)

Summary by CodeRabbit

  • Documentation
    • Reworked recipe to use a service-based workflow instead of upstreams, including creating a service before adding a protected route.
    • Updated route and configuration examples to reflect paths + service IDs and the services-based Config Sync structure.
    • mTLS guidance now references certificate IDs for client certs instead of inline PEM fields.
    • Troubleshooting updated to use service-based terminology.

Copilot AI review requested due to automatic review settings April 28, 2026 11:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@guoqqqi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 5 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c26a70a-91ee-4917-880c-5a73e2e56f8d

📥 Commits

Reviewing files that changed from the base of the PR and between 05a8ab9 and 002f1b1.

📒 Files selected for processing (1)
  • skills/a7-recipe-mtls/SKILL.md
📝 Walkthrough

Walkthrough

Rewrites the SKILL.md recipe to migrate examples and steps from the upstream model to the service model: replaces upstream resources and uri/upstream_id usages with service resources and paths/service_id, nests upstream TLS under service.upstream, and reorders Part 1 to create the service before the protected route.

Changes

Cohort / File(s) Summary
Recipe Model Migration
skills/a7-recipe-mtls/SKILL.md
Replaces upstream-centric CLI commands and Config Sync YAML with service-centric equivalents (a7 upstream createa7 service create), swaps uri+upstream_id for paths+service_id, moves upstream config under service.upstream, changes client TLS from inline PEM fields to upstream.tls.client_cert_id, updates node format and troubleshooting text, and reorders Part 1 to create the service before the route.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: updating mTLS documentation to align with the new service model instead of the legacy upstream model.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
E2e Test Quality Review ✅ Passed PR is documentation-only update to SKILL.md with no code, unit tests, or E2E test files. E2E test quality check criteria do not apply.
Security Check ✅ Passed Documentation uses certificate ID-based references, placeholder variables, explicit security guidance for private key files, and includes dedicated section for external secret manager support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-mtls-skill-service-model

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the a7-recipe-mtls skill documentation to match API7 EE’s current service-backed route model and remove legacy standalone upstream workflows.

Changes:

  • Replace legacy a7 upstream create examples with a7 service create using inline upstream.
  • Update route examples to use service_id and paths instead of upstream_id and uri.
  • Update the declarative config example from upstreams to services, and adjust route fields accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/a7-recipe-mtls/SKILL.md Outdated
Comment on lines 152 to 156
@@ -132,14 +155,14 @@ EOF
- `tls.client_key`: Private key for the client certificate.
- `pass_host`: Set to `"pass"` (default) or `"rewrite"` if upstream expects a specific Host header.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field list still documents scheme, tls.client_cert, tls.client_key, and pass_host as top-level keys, but in the updated examples these are nested under the inline upstream object (e.g., upstream.scheme, upstream.tls.client_cert, upstream.pass_host). Update the bullets to match the new service payload structure to avoid copy/paste misconfiguration.

Copilot uses AI. Check for mistakes.
Comment thread skills/a7-recipe-mtls/SKILL.md Outdated
Comment on lines +331 to +335
@@ -297,4 +332,4 @@ routes:
| Certificate expired | TLS cert past validity date | Rotate certificate with `a7 ssl update` |
| SNI mismatch | Domain doesn't match `snis` list | Add the domain to the `snis` array |
| Command failed with 401 | Invalid token | Refresh your token using `a7 context create` |
| Upstream not found | Different gateway group | Ensure `--gateway-group` matches where resources were created |
| Service not found | Different gateway group | Ensure `--gateway-group` matches where resources were created |
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This troubleshooting section still references tls.client_cert as if it were a top-level field. In the updated service-based examples, the client cert is configured under the inline upstream (upstream.tls.client_cert / upstream.tls.client_key). Update the reference to match where the setting actually lives in the service payload.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/a7-recipe-mtls/SKILL.md`:
- Around line 136-146: The "nodes" array and inline "tls" PEM in the upstream
definitions are invalid for API7 EE: replace the array-style nodes (e.g., the
[{"host":"secure-backend","port":443,"weight":1}]) with the map format keyed by
"host:port" (e.g., "secure-backend:443": 1) and remove the inline "tls" object
containing "client_cert" and "client_key"; instead upload the client certificate
and key as separate SSL Certificate objects in API7 EE and reference those
certificate IDs in the upstream configuration per API7 workflow. Also fix the
same nodes array issue in Part 1 where "nodes" uses the array form. Ensure no
PEMs remain inline and that only certificate IDs are referenced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1bf3408-bdf3-4cca-872b-31d120a3f8d3

📥 Commits

Reviewing files that changed from the base of the PR and between ce83883 and d032e05.

📒 Files selected for processing (1)
  • skills/a7-recipe-mtls/SKILL.md

Comment thread skills/a7-recipe-mtls/SKILL.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/a7-recipe-mtls/SKILL.md`:
- Around line 122-129: Update the sentence "Add an SSL Certificate using the
certificate API7 EE should present to the upstream." to read "Add an SSL
Certificate using the certificate that API7 EE should present to the upstream."
and apply the same grammar fix to the similar occurrences in the block that
describes creating the upstream client SSL certificate and CA certificate (the
paragraph starting with "Create the upstream client SSL certificate and CA
certificate in API7 EE first..."); ensure the word "that" is inserted after
"certificate" wherever the same construction appears.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3045a6c-0328-4f5a-a993-cd8393e4be89

📥 Commits

Reviewing files that changed from the base of the PR and between d032e05 and 05a8ab9.

📒 Files selected for processing (1)
  • skills/a7-recipe-mtls/SKILL.md

Comment thread skills/a7-recipe-mtls/SKILL.md
Copilot AI review requested due to automatic review settings April 28, 2026 15:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

skills/a7-recipe-mtls/SKILL.md:88

  • The service create example uses upstream.nodes as an object map ({"backend:8080": 1}), but the runtime service API/CLI examples in this repo use the array form ([{"host": ..., "port": ..., "weight": ...}]). Update this snippet to use the array form so it matches a7 service create payloads used in e2e tests and avoids schema mismatches.
  "upstream": {
    "type": "roundrobin",
    "nodes": {
      "backend:8080": 1
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/a7-recipe-mtls/SKILL.md Outdated
type: roundrobin
scheme: https
nodes:
"backend:443": 1
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Config Sync example, services[].upstream.nodes is still shown as a {"host:port": weight} map. If services.upstream.nodes is intended to mirror the runtime service payloads used by a7 service create (and e2e tests), switch this to the array form (- host: ...\n port: ...\n weight: ...) for consistency and to reduce confusion.

Suggested change
"backend:443": 1
- host: backend
port: 443
weight: 1

Copilot uses AI. Check for mistakes.
Comment thread skills/a7-recipe-mtls/SKILL.md Outdated
Comment on lines +139 to +144
"upstream": {
"type": "roundrobin",
"scheme": "https",
"nodes": {
"secure-backend:443": 1
},
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This service create example also formats upstream.nodes as a map ({"secure-backend:443": 1}), but a7 service create examples/tests use the array node format with explicit host/port/weight. Consider switching the snippet to the array form to ensure it’s accepted by the service API.

Copilot uses AI. Check for mistakes.
Comment thread skills/a7-recipe-mtls/SKILL.md Outdated
Comment on lines +204 to +206
"nodes": {
"internal-service:443": 1
},
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here: upstream.nodes is shown as a map, but service payloads in this repo use the array node format for a7 service create. Update this snippet to use the array form to prevent copy/paste failures.

Suggested change
"nodes": {
"internal-service:443": 1
},
"nodes": [
{
"host": "internal-service",
"port": 443,
"weight": 1
}
],

Copilot uses AI. Check for mistakes.
@guoqqqi guoqqqi merged commit f999918 into master Apr 28, 2026
6 checks passed
@guoqqqi guoqqqi deleted the codex/fix-mtls-skill-service-model branch April 28, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants