Repository navigation
Explain API authentication once and badge each endpoint with it - #4634
Merged
Merged
Conversation
Endpoint pages repeated the same Authentication section, because no spec overrides the document-level `security`. The Authentication page now holds the tabs and sits under Topics. Endpoints show an `auth` badge that links to it, and keep their own section only when their `security` differs. A `children:` page or an `x-topics` entry titled Authentication renders above the tabs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Override detection now counts the anonymous alternative, so `{}` added or dropped makes an endpoint keep its own section. The badge finds the Authentication page from endpoints under a tag-group classification. The shared section opens on topic, structural and Markdown pages, where the click handler ignored `#elastic-docs-v3`. The CommonMark writer for the section is shared, and the badge kind is an enum.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
theletterf
approved these changes
Oct 29, 2026
The Authentication page and a child Authentication page reused the endpoint's collapsible section, so they repeated the title and started closed. They now render the tabs directly. The endpoint keeps its collapsible section. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4634/ Sample changed pages: |
… page With one scheme the page showed a bare code block and never named it. The page has no section heading to carry the label, so it now always shows the tab strip, as the child pages do. Endpoint sections keep skipping the tab for a single scheme. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The titles sat in a bare section, so they used the Markdown heading size and padding. They now share the `api-page-intro` header of operation pages, with the same type size and a smaller gap under the breadcrumb. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A `children:` page keeps its H1 in its own Markdown, so it kept the Markdown heading size and padding. Its section now has a class, and the first heading takes the title style of operation and topic pages. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The badges under the path were filled pills that did not match the applicable-info badge beside them. They now share its outlined look in both the default and design-system styles, Deprecated keeps a red cue, and a linking badge is underlined. Their text is capitalised. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…y badge The badges inherited the page line height, so they were about 2px taller than the availability badge next to them. They now use the leading of its text. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The badges under the path had their own CSS, so their size drifted from the availability badge next to them. They now render with its classes in both looks, and only the red tone and the link style are set here. The design-system look is not checked against its availability badge, which renders larger than the design. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
They sat on the text baseline while the availability badge sits on the bottom of its line, so the row's badges were 1.4px apart vertically. They now share its alignment. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
With a children: page, as on Kibana, the Authentication page sat after it. It now leads the Topics heading whether it comes from the spec, a topic or a children: page, and the children: pages keep their declared order after it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The two pinned topics now lead the heading wherever they come from, including a children: page, which stands for the one its first heading or covered topic names. The other children: pages follow in declared order, then the spec's other topics by title. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
reakaleek
added a commit
that referenced
this pull request
Nov 23, 2026
* Show each API authentication method under its own heading The Authentication page put its methods in tabs, so a reader saw one at a time and could not link to one. Each method is now an `h2` with the anchor it had before #4634, listed in "On this page" and in the Markdown export. Endpoint pages keep their tabs. Headings under the smaller API page title now step down to 24px, and the API "On this page" list renders the same `_PageToc` partial as the docs, so it uses the docs type and shows the current section. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: describe the Authentication page headings in the API Explorer docs (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * Render API authentication sections as docs headings with Bump.sh anchors The sections were hand-built `h2` elements, so their headings were not linkable and their anchors (`#apikeyauth`) did not match the links readers already have from the Bump.sh portal (`#doc-authentication-api-key-auth`). The page now writes the sections as Markdown and renders them with its own prose, so each heading is a docs heading with a link, a hover anchor and an entry in "On this page". The anchors match Bump.sh, and the `.md` output comes from the same Markdown. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: say the Authentication page lists the document-level alternatives (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: render each authentication fragment on its own (per review by @infra-vault-gh-plugin-prod) A scheme description with an unclosed fence could swallow the credential and every later section, because the page rendered them as one Markdown document. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: render the child Authentication page's spec sections on the API description path (per review by @infra-vault-gh-plugin-prod) Appending them to the page's Markdown sent spec descriptions through the docs parser, which shows their HTML, such as `<br>`, as text. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: test that Authentication headings keep their Bump.sh anchors in the rail and the HTML (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * Build the Authentication sections from the document in one place The Authentication page and a child page that stands for it each read the requirements, built the sections and rendered them, and an `anchors` flag kept the Bump.sh anchors out of the `.md` output. Both pages now render through one helper that takes the document, and the API `.md` output drops heading anchors itself, as docs pages do, which also covers anchors written in topic and child-page prose. Generated Markdown renders as one fragment, and only spec descriptions render on their own. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Show an Authorization API key behind the ApiKey word The credential example said `Authorization: <value>`, while the curl samples and every Elastic API send `Authorization: ApiKey <key>`. The Authentication page and the endpoint tabs now show `Authorization: ApiKey <api-key>`. An API key in any other header keeps `<value>`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Style the On this page links once, on the shared list The API rail copied the docs sidebar link rule into `.api-rail-toc .sidebar-link`, because it sits outside the docs `.sidebar`. The shared `_PageToc` list now carries a `page-toc` class, and one `.page-toc .sidebar-link` rule in `styles.css` styles its links on docs and API pages. Each layout keeps hiding its own rail: docs from 1280px (lg), API from 1024px, where each puts the rail beside the article. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Say what api-rail-toc does on the API rail Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: say the Authentication page falls back to the declared schemes (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: say an endpoint with security: [] shows no Authentication section (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: close a fenced block only on a matching fence when stripping heading anchors (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: check the generated Authentication page renders its sections and no tabs (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: test that an unclosed fence in a scheme description stays in its own fragment (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor: match the docs parser's heading anchor when writing API .md (simplify pass) Co-Authored-By: Claude Opus 5.5 <[email protected]> * Leave heading anchors out of the Authentication .md instead of stripping them The `.md` output of every API page stripped a trailing `[anchor]` from headings, only so the Authentication sections needed no flag. That took a fence scanner and a copy of the docs parser's anchor pattern, and changed authored prose on pages this change is not about. `AuthenticationFragments` takes `anchors` again, and `ApiCommonMark` is back to what main has. A test stub that mostly checked its own output and an unrelated `ToTocItem` helper go too. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Jan Calanog <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API endpoint pages no longer repeat the same Authentication section. A shared Authentication page, listed under Topics, holds the tabs, and each endpoint gets an
Authbadge that links to it.Affects:
API referencePrompt summary: Reactivate the spec-generated Authentication page. Show an endpoint's own authentication only when it differs from the spec's default, and add a badge before the availability badge that points to the page. Prose from
children:andx-topicsbehaves the same and renders above the tabs.Why
No spec in the assembled set (Elasticsearch, Kibana, Cloud, Logstash) overrides the document-level
securityon any operation, so every endpoint shows the same block. The generated/authenticationpage is hidden and nothing links to it. Thecloudspec declares anapiKeyscheme but nosecurity, so its endpoints say nothing about authentication.What
Authentication page
/authenticationis built for every spec with security schemes and listed first under Topics, followed by Rate limiting, ahead of any otherchildren:pages and topics. It builds its tabs from the document-levelsecurity, or one tab per scheme when there is none. The tabs show open, under the page's own title, with no collapsible heading. A single scheme still gets its tab, because nothing else on the page names it. Anx-topicsentry titled Authentication, or achildren:page whose first heading is Authentication, renders above the tabs. A child page takes the place of the generated page in the sidebar, and the generated page stays hidden for old links.Page titles
The topic and Authentication pages put their title in the same
api-page-introheader as operation pages, with the same type size and a smaller gap under the breadcrumb. Achildren:page keeps its H1 in its own Markdown, so its first heading takes the same style through a class on its section. This applies to everychildren:page.Endpoint section and badge
An endpoint shows its own Authentication section only when its
securitynames other alternatives than the document's. AnAuthbadge sits before the availability badge. Both it andDeprecatedrender with the availability badge's own classes, in the default and design-system looks, so they keep its size and outline.Deprecatedkeeps a red cue, and a badge that links is underlined. It links to the page, or to the endpoint's own section when it overrides the default.Auth optionalmarks an anonymous alternative, andNo authmarkssecurity: []with no link. The CommonMark output gets anAuthentication:line.Tests and docs
A new
api-explorer-document-security.jsonfixture covers inherited, repeated, narrowed, optional and emptysecurity.docs/data/openapi/api-explorer.mddescribes the page, the badge table and the rule for the endpoint section.Out of scope: in the design-system look, the availability badge is a
<button>that renders at 16px text and 43.6px tall, larger than the 12px badge in the design. The new badges follow the design, so they are smaller than it there. That gets fixed separately. The page-level TOC of achildren:page is unchanged, and this PR does not move anyx-topicscontent tochildren:.Verify
Check on the preview
Authbadge before the availability badge, no Authentication section, and the badge links to the Authentication page.Authbadge (underlined, since it links), then aDeprecatedbadge with a red outline and red text, then the availability badge. All three share the outlined look.Auth optional, because the spec allows an anonymous alternative. It links to the Authentication page, which says "Authentication is optional" above the Basic tab.children:page: its title uses the same size and gap under the breadcrumb as the operation pages above.x-topicsAuthentication text first, then one open "Api key" tab withAuthorization: <value>, and no second Authentication title. This spec has no document-levelsecurity, so the tab comes fromcomponents.securitySchemes.