moriturus / ktra

Your Little Cargo Registry
https://book.ktra.dev
Apache License 2.0
404 stars 37 forks source link

Ktra openid doesn't install via cargo #58

Open davidv1992 opened 1 year ago

davidv1992 commented 1 year ago

When installing Ktra 0.7.0 with openid-connect support via cargo install ktra --no-default-features --features=openid, compilation fails due to several missing crates:

error[E0432]: unresolved import `argon2`
 --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/db_manager/sled_db_manager.rs:6:14
  |
6 | use argon2::{self, hash_encoded, verify_encoded};
  |              ^^^^ no external crate `argon2`

error[E0433]: failed to resolve: use of undeclared crate or module `rand`
 --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/utils.rs:7:5
  |
7 | use rand::prelude::*;
  |     ^^^^ use of undeclared crate or module `rand`

error[E0433]: failed to resolve: use of undeclared crate or module `rand`
 --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/utils.rs:6:5
  |
6 | use rand::distributions::Alphanumeric;
  |     ^^^^ use of undeclared crate or module `rand`

error[E0432]: unresolved imports `argon2`, `rand::distributions::Alphanumeric`
 --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/db_manager/utils.rs:3:14
  |
3 | use argon2::{self, ThreadMode, Variant};
  |              ^^^^ no external crate `argon2`
  |
 ::: /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/utils.rs:6:5
  |
6 | use rand::distributions::Alphanumeric;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared crate or module `argon2`
  --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/error.rs:41:12
   |
41 |     Argon2(argon2::Error),
   |            ^^^^^^ use of undeclared crate or module `argon2`

error[E0433]: failed to resolve: use of undeclared crate or module `rand`
  --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/ktra-0.7.0/src/utils.rs:31:9
   |
31 |         rand::thread_rng()
   |         ^^^^ use of undeclared crate or module `rand`
davidv1992 commented 1 year ago

The current state of #57 already fixes this. Perhaps consider merging this early and doing the final database refactors separately?

gagbo commented 1 year ago

yeah, the feature set is in a weird state. You'll be able to get it working by adding secure-auth with openid normally, as that's what our CI does (and add crates-io-mirroring if that still fails but I don't think this one is mandatory)

I can't really give an ETA on #57 landing, so the workaround of having an extra feature is probably the quickest workaround now