merge license

This commit is contained in:
weisd
2025-04-08 22:27:39 +08:00
parent d29bfcca9a
commit 5188d00a09
4 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ pub fn get_global_action_cred() -> Option<Credentials> {
GLOBAL_ACTIVE_CRED.get().cloned() GLOBAL_ACTIVE_CRED.get().cloned()
} }
#[instrument] #[instrument(skip(ecstore))]
pub async fn init_iam_sys(ecstore: Arc<ECStore>) -> Result<()> { pub async fn init_iam_sys(ecstore: Arc<ECStore>) -> Result<()> {
debug!("init iam system"); debug!("init iam system");
let s = IamCache::new(ObjectStore::new(ecstore)).await; let s = IamCache::new(ObjectStore::new(ecstore)).await;
+1 -1
View File
@@ -39,7 +39,7 @@ use tokio::{
}, },
}; };
use tracing::error; use tracing::error;
use tracing::{debug, warn}; use tracing::warn;
const IAM_FORMAT_FILE: &str = "format.json"; const IAM_FORMAT_FILE: &str = "format.json";
const IAM_FORMAT_VERSION_1: i32 = 1; const IAM_FORMAT_VERSION_1: i32 = 1;
+1 -1
View File
@@ -24,7 +24,7 @@ use serde::{de::DeserializeOwned, Serialize};
use std::{collections::HashMap, sync::Arc}; use std::{collections::HashMap, sync::Arc};
use tokio::sync::broadcast::{self, Receiver as B_Receiver}; use tokio::sync::broadcast::{self, Receiver as B_Receiver};
use tokio::sync::mpsc::{self, Sender}; use tokio::sync::mpsc::{self, Sender};
use tracing::{debug, info, warn}; use tracing::{info, warn};
lazy_static! { lazy_static! {
pub static ref IAM_CONFIG_PREFIX: String = format!("{}/iam", RUSTFS_CONFIG_PREFIX); pub static ref IAM_CONFIG_PREFIX: String = format!("{}/iam", RUSTFS_CONFIG_PREFIX);
+2
View File
@@ -27,7 +27,9 @@ pub fn get_license() -> Option<Token> {
LICENSE.get().cloned() LICENSE.get().cloned()
} }
#[allow(unreachable_code)]
pub fn license_check() -> Result<()> { pub fn license_check() -> Result<()> {
return Ok(());
let inval_license = LICENSE.get().map(|token| { let inval_license = LICENSE.get().map(|token| {
if token.expired < SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() { if token.expired < SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() {
error!("License expired"); error!("License expired");