Skip to content

Commit

Permalink
🚑 Read revoked tokens at liftoff
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Aug 10, 2024
1 parent 3bd8bed commit 8aa142a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/orangutan-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orangutan-server"
version = "0.4.11"
version = "0.4.12"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 3 additions & 0 deletions src/orangutan-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use rocket::{
response::{self, Responder},
Request,
};
use routes::auth_routes::REVOKED_TOKENS;
#[cfg(feature = "templating")]
use tracing::debug;
use tracing::warn;
Expand Down Expand Up @@ -74,6 +75,8 @@ fn rocket() -> _ {
fn liftoff() -> Result<(), Error> {
create_tmp_dir()?;
clone_repository()?;
// NOTE: This is just a hotfix. I had to quickly revoke a token. I'll improve this one day.
*REVOKED_TOKENS.write().unwrap() = read_revoked_tokens()?;
generate_default_website()?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/orangutan-server/src/routes/auth_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
};

lazy_static! {
pub(super) static ref REVOKED_TOKENS: RwLock<HashSet<Vec<u8>>> = RwLock::default();
pub static ref REVOKED_TOKENS: RwLock<HashSet<Vec<u8>>> = RwLock::default();
}

pub(super) fn routes() -> Vec<Route> {
Expand Down

0 comments on commit 8aa142a

Please sign in to comment.