Skip to content

Commit

Permalink
Validate a TOTP code before saving it (#1055)
Browse files Browse the repository at this point in the history
In order to do this, I had to remove the very old and unmaintainted
`otplib` and replace it with the well-maintained
[otpauth](https://www.npmjs.com/package/otpauth).

I kept the parameters the same, but if there is something only slightly
off between the two libraries, this could cause a major headache. I am
unsure on how to test this though, or if we can provide some sort of
migration for this.

The reason for the upgrade is two-fold:

1. As I said, the original library was unmaintained
2. It's verification mechanism relied on a Buffer class that, as far as
I can tell, can't work without some `require` statements that are
missing from the library's source files.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eugene <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2024
1 parent fe521f2 commit 3c3b843
Show file tree
Hide file tree
Showing 7 changed files with 802 additions and 862 deletions.
8 changes: 6 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[build]
rustflags = ["--cfg", "tokio_unstable"]
#[build]
#rustflags = ["--cfg", "tokio_unstable"]

# https://github.com/rust-lang/cargo/issues/5376#issuecomment-2163350032
[target.'cfg(all())']
rustflags = ["--cfg", "tokio_unstable"]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ config.yaml
__pycache__
.pytest_cache
dhat-heap.json

# IntelliJ based IDEs
.idea/
/.data/
Loading

0 comments on commit 3c3b843

Please sign in to comment.