mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
merge license
This commit is contained in:
+1
-1
@@ -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
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user