Skip to content

core: migrate notp to otpauth#1157

Merged
undefined-moe merged 1 commit intohydro-dev:masterfrom
renbaoshuo:refactor/otpauth
May 9, 2026
Merged

core: migrate notp to otpauth#1157
undefined-moe merged 1 commit intohydro-dev:masterfrom
renbaoshuo:refactor/otpauth

Conversation

@renbaoshuo
Copy link
Copy Markdown
Contributor

@renbaoshuo renbaoshuo commented May 8, 2026

Last update of notp package is 12 years ago, this PR migrate verifyTFA to a morden package otpauth.

Summary by CodeRabbit

  • Chores

    • Updated authentication verification dependencies for improved library compatibility and maintenance.
  • Refactor

    • Refactored internal two-factor authentication verification logic to utilize updated libraries and improve code efficiency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5caf7164-3e1e-4d7a-8e7a-3b64f04afab1

📥 Commits

Reviewing files that changed from the base of the PR and between ca2fb94 and dc0779f.

📒 Files selected for processing (2)
  • packages/hydrooj/package.json
  • packages/hydrooj/src/lib/verifyTFA.ts

Walkthrough

This PR migrates the two-factor authentication OTP library from notp to otpauth. The packages/hydrooj/package.json dependency set is updated to remove notp@^2.0.3 and @types/notp, replacing them with otpauth@^9.5.1. The verifyTFA function in packages/hydrooj/src/lib/verifyTFA.ts is refactored to use the new library's Secret and TOTP classes for Base32 decoding and TOTP token validation. The function behavior changes to return false instead of null when the input code is missing or empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'core: migrate notp to otpauth' directly and clearly describes the main change: migrating from the notp library to otpauth library across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@undefined-moe undefined-moe merged commit 62cabb1 into hydro-dev:master May 9, 2026
6 checks passed
@renbaoshuo renbaoshuo deleted the refactor/otpauth branch May 9, 2026 17:10
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.

2 participants