remove a lot of unecessary clone and ref

This commit is contained in:
Irevoire
2022-10-25 10:53:29 +02:00
committed by Clément Renault
parent 4d25c159e6
commit 7e52f1effb
5 changed files with 32 additions and 32 deletions

View File

@ -470,7 +470,7 @@ async fn error_access_forbidden_routes() {
"searchRules" => json!(["*"]),
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
};
let web_token = generate_tenant_token(&uid, &key, tenant_token);
let web_token = generate_tenant_token(uid, key, tenant_token);
server.use_api_key(&web_token);
for ((method, route), actions) in AUTHORIZATIONS.iter() {
@ -506,7 +506,7 @@ async fn error_access_expired_parent_key() {
"searchRules" => json!(["*"]),
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
};
let web_token = generate_tenant_token(&uid, &key, tenant_token);
let web_token = generate_tenant_token(uid, key, tenant_token);
server.use_api_key(&web_token);
// test search request while parent_key is not expired
@ -545,7 +545,7 @@ async fn error_access_modified_token() {
"searchRules" => json!(["products"]),
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
};
let web_token = generate_tenant_token(&uid, &key, tenant_token);
let web_token = generate_tenant_token(uid, key, tenant_token);
server.use_api_key(&web_token);
// test search request while web_token is valid
@ -558,7 +558,7 @@ async fn error_access_modified_token() {
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
};
let alt = generate_tenant_token(&uid, &key, tenant_token);
let alt = generate_tenant_token(uid, key, tenant_token);
let altered_token = [
web_token.split('.').next().unwrap(),
alt.split('.').nth(1).unwrap(),