fix: align nginx auth contract with API auth endpoints (#1332)#1339
fix: align nginx auth contract with API auth endpoints (#1332)#1339
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAligns reverse-proxy auth routing to API endpoints by switching nginx auth paths to Changes
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser
participant Nginx as NGINX (reverse-proxy)
participant API as Rackula API (/api/auth/*)
participant IdP as Identity Provider
Browser->>Nginx: Request protected resource
Nginx->>API: auth_request /api/auth/check
API-->>Nginx: 204 (authorized) / 401 (unauthorized)
alt authorized
Nginx->>Browser: proxy_pass resource
else unauthorized
Nginx->>Browser: redirect -> /api/auth/login?next=...
Browser->>API: GET /api/auth/login
API->>IdP: redirect to IdP (OAuth2)
IdP->>Browser: callback -> /api/auth/callback
Browser->>API: GET/POST /api/auth/callback
API-->>Nginx: set session / subsequent auth_check 204
Nginx->>Browser: redirect to original resource
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
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 `@api/src/app.ts`:
- Around line 109-130: The oidc detection currently uses plugin.id ===
"generic-oauth" which always fails because built-in genericOAuth plugins don't
expose id; update the check in the authPlugins.some(...) used by
oidcApiAvailable to detect OIDC by inspecting the plugin's actual shape (for
example check (plugin as any).providerId === "oidc" or use a type
guard/constructor name like plugin.constructor?.name === "GenericOAuth"),
ensuring you still verify authApi.signInSocial and authApi.callbackOAuth; update
the condition that defines oidcApiAvailable accordingly so it correctly reflects
when OIDC is configured.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
api/src/app.tsapi/src/auth-logger.test.tsdeploy/nginx.conf.templatedocs/deployment/AUTHENTICATION.mddocs/guides/SELF-HOSTING.md
There was a problem hiding this comment.
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 `@api/src/app.ts`:
- Around line 109-118: The OIDC detection is fine, but the redirect targets are
wrong: where the code currently redirects to
`/api/auth/sign-in/social?provider=oidc` and `/api/auth/callback/oidc`, change
those redirect targets to match Better Auth generic-oauth routes; use `POST
/sign-in/oauth2` for sign-in and `GET /oauth2/callback/:providerId` (replace
:providerId with the provider identifier used, e.g. oidc) for the callback.
Locate the logic that uses securityConfig.authEnabled, auth
(authApi/authPlugins/oidcApiAvailable) and update the sign-in and callback
redirect URLs accordingly so they point to `/sign-in/oauth2` and
`/oauth2/callback/oidc` (or the configured providerId).
api/src/app.ts
Outdated
| if (securityConfig.authEnabled) { | ||
| const authApi = (auth?.api ?? {}) as Record<string, unknown>; | ||
| const authPlugins = Array.isArray(auth?.options?.plugins) | ||
| ? auth.options.plugins | ||
| : []; | ||
| const oidcApiAvailable = | ||
| Boolean(auth) && | ||
| authPlugins.length > 0 && | ||
| typeof authApi.signInSocial === "function" && | ||
| typeof authApi.callbackOAuth === "function"; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd api && head -250 src/app.ts | tail -150Repository: RackulaLives/Rackula
Length of output: 5176
🌐 Web query:
Better Auth genericOAuth plugin routes endpoints sign-in callback
💡 Result:
For Better Auth’s Generic OAuth plugin, the server mounts these routes:
- Start sign-in:
POST /sign-in/oauth2(client:authClient.signIn.oauth2({ providerId, ... })) [1][2] - OAuth callback:
GET /oauth2/callback/:providerId(so the full callback URL is typically${baseURL}/api/auth/oauth2/callback/:providerId) [1][2] - Link an OAuth account:
POST /oauth2/link(client:authClient.oauth2.link({ providerId, callbackURL })) [1][2]
Callback URL to register with your OAuth provider: ${baseURL}/api/auth/oauth2/callback/:providerId (unless you’ve customized Better Auth’s base path/routing in your framework). [1]
Sources: [1] [2]
Fix endpoint paths: Better Auth's generic-oauth plugin uses different route paths than currently implemented.
The OIDC detection logic fix is correct—replacing plugin.id === "generic-oauth" with authPlugins.length > 0 appropriately leverages the fact that plugins are only populated when OIDC environment variables are configured. However, the redirect paths are incorrect.
Better Auth's generic-oauth plugin uses these routes:
- Sign-in:
POST /sign-in/oauth2 - Callback:
GET /oauth2/callback/:providerId
The current code redirects to /api/auth/sign-in/social?provider=oidc and /api/auth/callback/oidc, which do not match Better Auth's routes and will cause authentication failures. Update the redirect targets to align with Better Auth's actual generic-oauth plugin endpoints.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api/src/app.ts` around lines 109 - 118, The OIDC detection is fine, but the
redirect targets are wrong: where the code currently redirects to
`/api/auth/sign-in/social?provider=oidc` and `/api/auth/callback/oidc`, change
those redirect targets to match Better Auth generic-oauth routes; use `POST
/sign-in/oauth2` for sign-in and `GET /oauth2/callback/:providerId` (replace
:providerId with the provider identifier used, e.g. oidc) for the callback.
Locate the logic that uses securityConfig.authEnabled, auth
(authApi/authPlugins/oidcApiAvailable) and update the sign-in and callback
redirect URLs accordingly so they point to `/sign-in/oauth2` and
`/oauth2/callback/oidc` (or the configured providerId).
Better Auth's genericOAuth plugin doesn't expose an id property, so plugin.id === "generic-oauth" always evaluated to false. Use authPlugins.length > 0 instead — the plugins array is only populated when OIDC env vars are configured in createAuth(). API method checks (signInSocial/callbackOAuth) are kept as a secondary guard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ebb5f7d to
b5803b8
Compare
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramShows how Nginx forwards auth checks and public auth routes to the API compatibility endpoints (/api/auth/*), and how it preserves path+query in login redirects so deep links return after authentication. sequenceDiagram
participant Browser
participant Nginx
participant API
Browser->>Nginx: Request protected page
Nginx->>API: Internal auth probe -> GET /api/auth/check (session cookie)
alt Valid session (authorized)
API-->>Nginx: 204 (authorized)
Nginx-->>Browser: Serve protected page
else No session (unauthorized)
API-->>Nginx: 401 (unauthenticated)
Nginx-->>Browser: 302 Redirect /auth/login?next=<path>?<query>
Browser->>Nginx: GET /auth/login?next=...
Nginx->>API: Proxy to /api/auth/login?next=... (preserve path+query)
API-->>Browser: Continue login flow (IdP redirect / callback)
Generated by CodeAnt AI |
|
CodeAnt AI Incremental review completed. |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
docs/guides/SELF-HOSTING.md (1)
285-299: 🧹 Nitpick | 🔵 TrivialRate limiting
location /is reasonable, but consider clarifying scope (and/or zone naming).
limit_req zone=api_per_ip ...on the main frontend location will throttle all UI requests, not just API calls. That may be intended for a stop-gap hardening guide, but I’d either:
- rename the zone to something generic (e.g.,
per_ip), or- add a one-liner note explaining this also rate-limits UI navigation/assets.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/guides/SELF-HOSTING.md` around lines 285 - 299, The nginx config in the frontend location (the block starting with "location /") uses limit_req zone=api_per_ip which will rate-limit all UI requests; either rename the zone to a generic identifier (e.g., change zone name from api_per_ip to per_ip in the limit_req directive and its zone definition) or add a one-line comment in the SELF-HOSTING.md near the location / block clarifying that limit_req on location / affects UI navigation and static assets as well as API calls so readers know the scope of the rate limit.docs/deployment/AUTHENTICATION.md (1)
9-82:⚠️ Potential issue | 🟠 MajorDocs update is directionally correct, but the
next=<path-and-query>claim depends on fixing the nginx redirect encoding/contract.The “Optional auth mode” and “Reverse Proxy Auth Contract (Nginx)” sections align well with the
/api/auth/*compatibility endpoints and the 204/401 auth-check behavior.Two follow-ups to keep the contract precise:
- Consider explicitly documenting HTTP methods for compatibility routes too (e.g.,
POST /api/auth/logout), since you already do for/auth/logout.- The line “
/auth/login?next=<normalized-path-and-query>” is only true if the proxy preserves query insidenext(see nginx template comment aboutnext=$uri$is_args$argsparsing).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/deployment/AUTHENTICATION.md` around lines 9 - 82, Update the docs to (1) explicitly list HTTP methods for the compatibility endpoints (e.g., /api/auth/login, /api/auth/callback, /api/auth/check, /api/auth/logout) to match the /auth/* entries and make it clear which are GET vs POST, and (2) qualify the “/auth/login?next=<normalized-path-and-query>” claim by stating it only works if the reverse proxy preserves the full path+query when building next (reference the nginx template approach like using next=$uri$is_args$args or an equivalent that preserves/encodes the query); add a short sentence advising proxies must percent‑encode/escape the next value or use the shown template to ensure the callback receives the original path+query.deploy/nginx.conf.template (1)
165-201:⚠️ Potential issue | 🔴 CriticalCritical:
next=$uri$is_args$argswill not preserve full query strings (embedded&will be parsed as separate parameters).When the original request contains multiple query parameters like
/rack/view?tab=2&sort=asc, the unencoded redirect/auth/login?next=/rack/view?tab=2&sort=ascwill be parsed by the server asnext="/rack/view?tab=2"withsort="asc"as a separate parameter—losing the query params after the first&.The API-side code (api/src/security.ts) correctly uses
encodeURIComponent()to handle this, but the nginx config bypasses that with raw variable expansion. Either URL-encode the value in nginx (which requires external modules), use$request_uriwith careful handling to avoid double-encoding, or refactor to pass path and query separately and reconstruct server-side.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy/nginx.conf.template` around lines 165 - 201, The redirect in location `@auth_login_redirect` uses raw expansion next=$uri$is_args$args which breaks multi-parameter querystrings (e.g. /rack/view?tab=2&sort=asc) because the embedded & is treated as a separate parameter; change the implementation so the full original path+query is passed safely: either use $request_uri (which already contains the encoded query) or pass path and query separately and reassemble/URL-encode on the server side (see api/src/security.ts which uses encodeURIComponent()); update the `@auth_login_redirect` location to stop emitting unencoded next=$uri$is_args$args and instead forward a single, safe next value (or remove next and reconstruct server-side) so deep links keep their entire query string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api/src/app.ts`:
- Around line 321-330: Extract auth plugins into a safely-narrowed variable
before the guard: check if auth is truthy then set authPlugins =
Array.isArray(auth.options?.plugins) ? auth.options.plugins : []; use that
authPlugins in the oidcApiAvailable expression and add an inline comment on the
authPlugins.length > 0 check noting "Confirms OIDC provider was initialized with
credentials"; keep the duck-typing checks for authApi.signInWithOAuth2 and
authApi.oAuth2Callback as-is. Ensure you reference the existing symbols auth,
auth?.options?.plugins, authPlugins, oidcApiAvailable, and
authApi.signInWithOAuth2/authApi.oAuth2Callback when making the change.
In `@docs/deployment/AUTHENTICATION.md`:
- Around line 66-76: The API compatibility routes section lists endpoints but
omits HTTP methods; update the `/api/auth/*` entries to mirror the
browser-facing annotations (e.g., `GET /api/auth/login`, `GET
/api/auth/callback`, `GET /api/auth/check`, `POST /api/auth/logout`) so each
`/api/auth/*` route has the same method annotations as `/auth/login`,
`/auth/callback`, `/auth/check`, and `/auth/logout`.
---
Outside diff comments:
In `@deploy/nginx.conf.template`:
- Around line 165-201: The redirect in location `@auth_login_redirect` uses raw
expansion next=$uri$is_args$args which breaks multi-parameter querystrings (e.g.
/rack/view?tab=2&sort=asc) because the embedded & is treated as a separate
parameter; change the implementation so the full original path+query is passed
safely: either use $request_uri (which already contains the encoded query) or
pass path and query separately and reassemble/URL-encode on the server side (see
api/src/security.ts which uses encodeURIComponent()); update the
`@auth_login_redirect` location to stop emitting unencoded next=$uri$is_args$args
and instead forward a single, safe next value (or remove next and reconstruct
server-side) so deep links keep their entire query string.
In `@docs/deployment/AUTHENTICATION.md`:
- Around line 9-82: Update the docs to (1) explicitly list HTTP methods for the
compatibility endpoints (e.g., /api/auth/login, /api/auth/callback,
/api/auth/check, /api/auth/logout) to match the /auth/* entries and make it
clear which are GET vs POST, and (2) qualify the
“/auth/login?next=<normalized-path-and-query>” claim by stating it only works if
the reverse proxy preserves the full path+query when building next (reference
the nginx template approach like using next=$uri$is_args$args or an equivalent
that preserves/encodes the query); add a short sentence advising proxies must
percent‑encode/escape the next value or use the shown template to ensure the
callback receives the original path+query.
In `@docs/guides/SELF-HOSTING.md`:
- Around line 285-299: The nginx config in the frontend location (the block
starting with "location /") uses limit_req zone=api_per_ip which will rate-limit
all UI requests; either rename the zone to a generic identifier (e.g., change
zone name from api_per_ip to per_ip in the limit_req directive and its zone
definition) or add a one-line comment in the SELF-HOSTING.md near the location /
block clarifying that limit_req on location / affects UI navigation and static
assets as well as API calls so readers know the scope of the rate limit.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
api/src/app.tsdeploy/nginx.conf.templatedocs/deployment/AUTHENTICATION.mddocs/guides/SELF-HOSTING.md
| if (securityConfig.authEnabled) { | ||
| const authPlugins = Array.isArray(auth?.options?.plugins) | ||
| ? auth?.options?.plugins | ||
| ? auth.options.plugins | ||
| : []; | ||
| const oidcApiAvailable = | ||
| Boolean(auth) && | ||
| securityConfig.authMode === "oidc" && | ||
| authPlugins.some( | ||
| (plugin) => (plugin as { id?: unknown }).id === "generic-oauth", | ||
| ) && | ||
| authPlugins.length > 0 && | ||
| typeof authApi.signInWithOAuth2 === "function" && | ||
| typeof authApi.oAuth2Callback === "function"; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify createAuth() plugin population + OIDC configuration contract
rg -n --type ts "createAuth\(" api/src -C 5Repository: RackulaLives/Rackula
Length of output: 1425
🏁 Script executed:
#!/bin/bash
# Find all usages of auth.options.plugins
rg -n --type ts "auth\.options\.plugins" api/src -C 3Repository: RackulaLives/Rackula
Length of output: 388
🏁 Script executed:
#!/bin/bash
# Find OIDC-related configuration
rg -n --type ts "authMode|OIDC|oidc" api/src -C 3Repository: RackulaLives/Rackula
Length of output: 22483
🏁 Script executed:
#!/bin/bash
# Check the specific lines mentioned in the review (321-330)
sed -n '315,335p' api/src/app.tsRepository: RackulaLives/Rackula
Length of output: 785
Clarify authPlugins extraction for better type narrowing; validate OIDC guard assumptions.
The current ternary mixes optional chaining in the condition with direct access in the true branch. While runtime-safe, splitting the condition improves readability and helps TS analysis. Additionally, using authPlugins.length > 0 as an OIDC configured predicate is valid—createAuth() only populates the genericOAuth plugin when OIDC credentials are present, and throws if authMode is "oidc" but credentials are missing. However, the redundancy could be clarified with a comment.
Suggested clarification (same behavior, better narrowing)
- const authPlugins = Array.isArray(auth?.options?.plugins)
- ? auth.options.plugins
- : [];
+ const configuredPlugins = auth?.options?.plugins;
+ const authPlugins = Array.isArray(configuredPlugins) ? configuredPlugins : [];Optionally, add a comment on line 328:
authPlugins.length > 0 && // Confirms OIDC provider was initialized with credentials
The duck-typing checks for authApi methods (lines 329–330) already follow the learning guidance.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api/src/app.ts` around lines 321 - 330, Extract auth plugins into a
safely-narrowed variable before the guard: check if auth is truthy then set
authPlugins = Array.isArray(auth.options?.plugins) ? auth.options.plugins : [];
use that authPlugins in the oidcApiAvailable expression and add an inline
comment on the authPlugins.length > 0 check noting "Confirms OIDC provider was
initialized with credentials"; keep the duck-typing checks for
authApi.signInWithOAuth2 and authApi.oAuth2Callback as-is. Ensure you reference
the existing symbols auth, auth?.options?.plugins, authPlugins,
oidcApiAvailable, and authApi.signInWithOAuth2/authApi.oAuth2Callback when
making the change.
- Fix nginx auth redirect to use next=$uri (path only) to prevent query string params from splitting across the redirect URL - Add HTTP method annotations to API compatibility routes in auth docs - Clarify that next= preserves path only, not query strings - Rename misleading api_per_ip rate limit zone to per_ip Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
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 `@deploy/nginx.conf.template`:
- Around line 199-202: The redirect currently uses return 302
/auth/login?next=$uri; which drops query params; change the redirect to include
the original query string by using $uri$is_args$args (e.g. return 302
/auth/login?next=$uri$is_args$args;) so the full path plus its query parameters
are preserved across the auth redirect.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
deploy/nginx.conf.templatedocs/deployment/AUTHENTICATION.mddocs/guides/SELF-HOSTING.md
The login redirect was dropping query strings, so users returning from auth would lose their original URL parameters. Now uses $is_args$args to carry them through. Multi-param query strings with & will still split at the nginx level (proper fix needs OpenResty), but this is strictly better than losing everything. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
deploy/nginx.conf.template (1)
199-203:⚠️ Potential issue | 🟠 Major
next=redirect is still lossy for multi-parameter URLs.Line 203 still drops part of deep-link state when the original URL contains multiple
&query params; only the first segment remains innext. This misses the “exact page + query” objective for a common case.A robust fix needs an opaque state/cookie flow or backend-side reconstruction from raw query bytes (not parsed query params).
#!/bin/bash set -euo pipefail # Verify how login/callback handlers parse and reconstruct "next" today. # Expected: evidence whether code reads parsed query only (lossy) or raw query (can preserve full args). fd 'app.ts' rg -nP --type=ts -C3 'auth/login|auth/callback|next_path|next_query|searchParams\.get\("next"\)|URLSearchParams|ctx\.req\.query' api🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy/nginx.conf.template` around lines 199 - 203, The nginx redirect that returns 302 /auth/login?next=$uri$is_args$args is lossy for multi-parameter URLs; change to an opaque-state flow instead: have nginx set a short-lived cookie or include a state token (not a raw next= query) that represents the full original request URI (including the raw query string), then update your authentication handlers (auth/login and auth/callback) to read that opaque token (or cookie) to reconstruct the exact post-login redirect; implement generation/storage/validation of the state token server-side (or sign/encrypt it) and remove reliance on parsing next from URL query parameters so deep-link state is preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@deploy/nginx.conf.template`:
- Around line 199-203: The nginx redirect that returns 302
/auth/login?next=$uri$is_args$args is lossy for multi-parameter URLs; change to
an opaque-state flow instead: have nginx set a short-lived cookie or include a
state token (not a raw next= query) that represents the full original request
URI (including the raw query string), then update your authentication handlers
(auth/login and auth/callback) to read that opaque token (or cookie) to
reconstruct the exact post-login redirect; implement
generation/storage/validation of the state token server-side (or sign/encrypt
it) and remove reliance on parsing next from URL query parameters so deep-link
state is preserved.
User description
Summary
/api/auth/*compatibility endpointsnext=$uri$is_args$args/api/auth/*/api/auth/*in explicit API allowlist examplesTest Plan
npm run lintnpm run test:runnpm run buildcodeant static-analysis --uncommitted --fail-on INFOcodeant security-analysis --uncommitted --fail-on INFOcodeant secrets --uncommitted --fail-on allNotes
Closes #1332
CodeAnt-AI Description
Align Nginx reverse-proxy auth contract, preserve deep links, and fix OIDC availability detection
What Changed
Impact
✅ Fewer auth misconfigurations behind Nginx reverse-proxies✅ Preserve deep links after login✅ Clearer unauthorized responses from protected routes💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.