Skip to content

docs: remove duplicate type definitions in jwt.md and middleware.md#176

Merged
veverkap merged 2 commits into
mainfrom
docs/remove-duplicate-type-definitions-aa0c7c6a031a2406
May 3, 2026
Merged

docs: remove duplicate type definitions in jwt.md and middleware.md#176
veverkap merged 2 commits into
mainfrom
docs/remove-duplicate-type-definitions-aa0c7c6a031a2406

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 2, 2026

Two type definitions were duplicated within their respective documentation sections.

docs/auth/jwt.mdClaims struct

In the Validating tokens section, the Claims struct was defined twice:

  1. As a standalone block immediately before the ValidateToken usage example
  2. Again under the prose paragraph "Claims embeds jwt.RegisteredClaims..."

The first block is removed. The struct definition now appears once, after the ValidateToken example, with its explanatory prose intact.

docs/auth/middleware.mdAdminChecker interface

In the Admin middleware section, the AdminChecker interface was defined twice:

  1. As a standalone block before the usage examples
  2. Again under the paragraph "AdminChecker is a single-method interface:"

Consolidated to a definition-first structure: define the interface once, follow with prose about UserStore compatibility and NewAdminCheckerFromRoleChecker, then show the usage examples.


No code changes. Documentation only.

Generated by Update Docs · ● 1M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/update-docs.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Greptile Summary

Documentation-only cleanup removing duplicate type definitions in jwt.md and middleware.md. Both files now define each type exactly once, with the middleware.md restructure additionally adding a cross-link to rbac.md and fixing a minor grammar nit.

Confidence Score: 5/5

Safe to merge — documentation-only changes with no code modifications.

No code changes. Both files correctly preserve all content while removing exact duplicates; no information was dropped and no broken links were introduced.

No files require special attention.

Important Files Changed

Filename Overview
docs/auth/jwt.md Removed duplicate Claims struct definition that appeared before the ValidateToken example; the struct now appears once with its explanatory prose intact.
docs/auth/middleware.md Consolidated duplicate AdminChecker interface definition — moved to a definition-first structure, removed the trailing duplicate block and redundant prose, added cross-link to rbac.md, and fixed minor grammar ("cached 5 seconds" → "cached for 5 seconds").

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph jwt.md ["docs/auth/jwt.md — Validating tokens"]
        A["ValidateToken usage example"] --> B["Claims struct definition\n+ explanatory prose"]
    end

    subgraph middleware.md ["docs/auth/middleware.md — Admin middleware"]
        C["Intro: AdminChecker.IsAdmin cached 5s"] --> D["AdminChecker interface definition"]
        D --> E["UserStore / NewAdminCheckerFromRoleChecker prose\n(+ link to rbac.md)"]
        E --> F["Usage examples\n(UserStore & RoleChecker)"]
    end
Loading

Reviews (2): Last reviewed commit: "docs: fix grammar in middleware.md admin..." | Re-trigger Greptile

docs/auth/jwt.md: Claims struct was defined twice in the 'Validating
tokens' section — once as a standalone block before the ValidateToken
example, then again in the 'Claims embeds jwt.RegisteredClaims...'
paragraph. Remove the first (earlier) block; the type definition now
appears once, after the usage example, with its explanatory prose.

docs/auth/middleware.md: AdminChecker interface was defined twice in
the 'Admin middleware' section — once as a standalone block before the
usage examples, then again under 'AdminChecker is a single-method
interface'. Consolidate into a single definition-first structure: define
the interface once, follow with prose about UserStore compatibility and
NewAdminCheckerFromRoleChecker, then show the usage examples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation documentation Improvements or additions to documentation labels May 2, 2026
@veverkap veverkap marked this pull request as ready for review May 3, 2026 13:30
@veverkap veverkap requested review from a team and Copilot May 3, 2026 13:30
Copy link
Copy Markdown
Contributor

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

Removes duplicated type/interface definitions in the auth documentation so each documented type is defined once per section, improving readability and reducing drift risk.

Changes:

  • docs/auth/jwt.md: remove the duplicated Claims struct block so it appears only once (with the explanatory prose).
  • docs/auth/middleware.md: consolidate the duplicated AdminChecker interface definition into a single definition-first flow and keep the RBAC pointer.
Show a summary per file
File Description
docs/auth/middleware.md Deduplicates AdminChecker definition and restructures the “Admin middleware” section for clearer progression.
docs/auth/jwt.md Removes a duplicate Claims struct definition in the “Validating tokens” section.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread docs/auth/middleware.md Outdated
Copy link
Copy Markdown
Contributor

@veverkap veverkap left a comment

Choose a reason for hiding this comment

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

Fixed: changed "cached 5 seconds per user" to "cached for 5 seconds per user" in docs/auth/middleware.md line 25.

@veverkap veverkap merged commit f51df5a into main May 3, 2026
7 checks passed
@veverkap veverkap deleted the docs/remove-duplicate-type-definitions-aa0c7c6a031a2406 branch May 3, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants