Skip to content

Conversation

@appleboy
Copy link
Owner

@appleboy appleboy commented Oct 11, 2025

  • Rename the middleware configuration field from Authorizator to Authorizer throughout the codebase and documentation
  • Update all references and usage examples to use Authorizer instead of Authorizator
  • Revise test functions and comments to reflect the Authorizer naming change

fix #295

Summary by CodeRabbit

  • Refactor

    • Renamed the public authorization callback from “Authorizator” to “Authorizer.” Behavior unchanged, but you may need to update your configuration code.
  • Documentation

    • Updated English, Simplified Chinese, and Traditional Chinese guides to use “Authorizer” and aligned middleware flow descriptions.
  • Examples

    • Updated example configurations to reference “Authorizer.”
  • Tests

    • Renamed tests and updated usages to reflect “Authorizer.”

…base

- Rename the middleware configuration field from Authorizator to Authorizer throughout the codebase and documentation
- Update all references and usage examples to use Authorizer instead of Authorizator
- Revise test functions and comments to reflect the Authorizer naming change

fix #295

Signed-off-by: appleboy <[email protected]>
@appleboy appleboy merged commit 163bda7 into master Oct 11, 2025
3 of 5 checks passed
@appleboy appleboy deleted the typo branch October 11, 2025 05:01
@gemini-code-assist
Copy link

Summary of Changes

Hello @appleboy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing code consistency and readability by standardizing the naming of the authorization middleware. The change involves renaming the Authorizator field to Authorizer and updating all associated code, documentation, and examples to reflect this new, clearer terminology. This refactor improves the maintainability and understanding of the authorization flow within the application.

Highlights

  • Middleware Naming Standardization: The middleware configuration field Authorizator has been consistently renamed to Authorizer across the entire codebase.
  • Documentation and Examples Update: All references and usage examples in the documentation (including Chinese versions) and example applications have been updated to reflect the new Authorizer naming.
  • Test Function Refinement: Test functions and comments related to the authorization middleware have been revised to align with the Authorizer naming convention.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Renames the GinJWTMiddleware authorization hook from Authorizator to Authorizer across core type definitions, examples, tests, and documentation. Test names and README references are updated accordingly. Function signatures and runtime behavior remain unchanged.

Changes

Cohort / File(s) Summary
Docs update (Authorizator→Authorizer)
README.md, README.zh-CN.md, README.zh-TW.md
Replace all references of “Authorizator” with “Authorizer” in documentation; no logic changes.
Examples update
_example/basic/server.go, _example/redis_simple/main.go, _example/redis_store/main.go
Update GinJWTMiddleware struct literal field name from Authorizator to Authorizer; callback signatures unchanged.
Core middleware struct
auth_jwt.go
Rename public field GinJWTMiddleware.Authorizator → GinJWTMiddleware.Authorizer; preserve type and default behavior.
Tests
auth_jwt_test.go
Update field references to Authorizer and rename TestAuthorizator → TestAuthorizer; test logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I twitch my nose at names askew,
A hop, a swap—now spelled anew.
Authorizer, clean and bright,
Guards the burrow day and night.
With docs and tests in tidy rows,
I thump approval—onward it goes! 🐇✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch typo

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bad9f43 and a20dca5.

📒 Files selected for processing (8)
  • README.md (2 hunks)
  • README.zh-CN.md (1 hunks)
  • README.zh-TW.md (1 hunks)
  • _example/basic/server.go (1 hunks)
  • _example/redis_simple/main.go (1 hunks)
  • _example/redis_store/main.go (1 hunks)
  • auth_jwt.go (3 hunks)
  • auth_jwt_test.go (8 hunks)

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

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request standardizes the middleware configuration field name from Authorizator to Authorizer across the codebase and documentation, which improves consistency and corrects a typo. The changes are well-executed. I've added a couple of suggestions in the example files to also rename the associated example function from authorizator to authorizer to fully complete the naming standardization and improve code alignment.

IdentityHandler: identityHandler(),
Authenticator: authenticator(),
Authorizator: authorizator(),
Authorizer: authorizator(),

Choose a reason for hiding this comment

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

medium

For consistency with the refactoring to Authorizer, the example function authorizator() should also be renamed to authorizer(). This would involve updating both the function call here and its definition on line 235. I've also adjusted the spacing in the suggestion to align this field with the others.

Suggested change
Authorizer: authorizator(),
Authorizer: authorizer(),

IdentityHandler: identityHandler(),
Authenticator: authenticator(),
Authorizator: authorizator(),
Authorizer: authorizator(),

Choose a reason for hiding this comment

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

medium

To maintain consistency with the Authorizer field name, it's recommended to also rename the authorizator() function to authorizer(). You would need to update its definition on line 136 as well. I've adjusted the spacing in the suggestion to maintain alignment with the other fields.

Suggested change
Authorizer: authorizator(),
Authorizer: authorizer(),

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.

The correct spelling of the parameter "Authorizator" might be "Authorizer"

2 participants