docs: remove duplicate type definitions in jwt.md and middleware.md#176
Merged
veverkap merged 2 commits intoMay 3, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 duplicatedClaimsstruct block so it appears only once (with the explanatory prose).docs/auth/middleware.md: consolidate the duplicatedAdminCheckerinterface 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
veverkap
reviewed
May 3, 2026
Contributor
veverkap
left a comment
There was a problem hiding this comment.
Fixed: changed "cached 5 seconds per user" to "cached for 5 seconds per user" in docs/auth/middleware.md line 25.
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.
Two type definitions were duplicated within their respective documentation sections.
docs/auth/jwt.md—ClaimsstructIn the Validating tokens section, the
Claimsstruct was defined twice:ValidateTokenusage exampleClaimsembedsjwt.RegisteredClaims..."The first block is removed. The struct definition now appears once, after the
ValidateTokenexample, with its explanatory prose intact.docs/auth/middleware.md—AdminCheckerinterfaceIn the Admin middleware section, the
AdminCheckerinterface was defined twice:AdminCheckeris a single-method interface:"Consolidated to a definition-first structure: define the interface once, follow with prose about
UserStorecompatibility andNewAdminCheckerFromRoleChecker, then show the usage examples.No code changes. Documentation only.
Greptile Summary
Documentation-only cleanup removing duplicate type definitions in
jwt.mdandmiddleware.md. Both files now define each type exactly once, with themiddleware.mdrestructure additionally adding a cross-link torbac.mdand 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
Claimsstruct definition that appeared before theValidateTokenexample; the struct now appears once with its explanatory prose intact.AdminCheckerinterface 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)"] endReviews (2): Last reviewed commit: "docs: fix grammar in middleware.md admin..." | Re-trigger Greptile