merge license

This commit is contained in:
weisd
2025-04-08 22:27:39 +08:00
parent b39b8838cc
commit a770600fa7
4 changed files with 5 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ pub fn get_global_action_cred() -> Option<Credentials> {
GLOBAL_ACTIVE_CRED.get().cloned()
}
#[instrument]
#[instrument(skip(ecstore))]
pub async fn init_iam_sys(ecstore: Arc<ECStore>) -> Result<()> {
debug!("init iam system");
let s = IamCache::new(ObjectStore::new(ecstore)).await;

View File

@@ -39,7 +39,7 @@ use tokio::{
},
};
use tracing::error;
use tracing::{debug, warn};
use tracing::warn;
const IAM_FORMAT_FILE: &str = "format.json";
const IAM_FORMAT_VERSION_1: i32 = 1;

View File

@@ -24,7 +24,7 @@ use serde::{de::DeserializeOwned, Serialize};
use std::{collections::HashMap, sync::Arc};
use tokio::sync::broadcast::{self, Receiver as B_Receiver};
use tokio::sync::mpsc::{self, Sender};
use tracing::{debug, info, warn};
use tracing::{info, warn};
lazy_static! {
pub static ref IAM_CONFIG_PREFIX: String = format!("{}/iam", RUSTFS_CONFIG_PREFIX);

View File

@@ -27,7 +27,9 @@ pub fn get_license() -> Option<Token> {
LICENSE.get().cloned()
}
#[allow(unreachable_code)]
pub fn license_check() -> Result<()> {
return Ok(());
let inval_license = LICENSE.get().map(|token| {
if token.expired < SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() {
error!("License expired");