mirror of
https://github.com/sadoyan/aralez.git
synced 2026-05-30 03:44:06 +08:00
fix: token logging, unneeded copy
This commit is contained in:
429
Cargo.lock
generated
429
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
26
Makefile
Normal file
26
Makefile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
update:
|
||||||
|
cargo update --verbose
|
||||||
|
|
||||||
|
features:
|
||||||
|
cargo features
|
||||||
|
|
||||||
|
checkup:
|
||||||
|
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
|
cargo check --workspace --all-targets --all-features
|
||||||
|
# cargo shear
|
||||||
|
# cargo machete
|
||||||
|
cargo audit
|
||||||
|
|
||||||
|
fix:
|
||||||
|
cargo fix
|
||||||
|
|
||||||
|
fix-all:
|
||||||
|
cargo fix --all
|
||||||
|
cargo clippy --workspace --all-targets --all-features --fix
|
||||||
|
|
||||||
|
test:
|
||||||
|
cargo test --workspace --all-targets --all-features
|
||||||
|
|
||||||
|
.PHONY: update features checkup fix fix-all test run pg-migrate
|
||||||
|
|
||||||
|
# -- ⚝ by Dave -- in NeoVim ⚝ --
|
||||||
@@ -15,7 +15,7 @@ use axum::{Json, Router};
|
|||||||
use futures::channel::mpsc::Sender;
|
use futures::channel::mpsc::Sender;
|
||||||
use futures::SinkExt;
|
use futures::SinkExt;
|
||||||
use jsonwebtoken::{encode, EncodingKey, Header};
|
use jsonwebtoken::{encode, EncodingKey, Header};
|
||||||
use log::{error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use prometheus::{gather, Encoder, TextEncoder};
|
use prometheus::{gather, Encoder, TextEncoder};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@@ -49,7 +49,7 @@ pub async fn run_server(config: &APIUpstreamProvider, mut to_return: Sender<Conf
|
|||||||
cert_creds: credsfile,
|
cert_creds: credsfile,
|
||||||
certs_dir: config.certs_dir.clone(),
|
certs_dir: config.certs_dir.clone(),
|
||||||
config_sender: to_return.clone(),
|
config_sender: to_return.clone(),
|
||||||
config_api_enabled: config.config_api_enabled.clone(),
|
config_api_enabled: config.config_api_enabled),
|
||||||
current_upstreams: upstreams_curr,
|
current_upstreams: upstreams_curr,
|
||||||
full_upstreams: upstreams_full,
|
full_upstreams: upstreams_full,
|
||||||
};
|
};
|
||||||
@@ -136,7 +136,7 @@ async fn jwt_gen(State(state): State<AppState>, Json(payload): Json<Claims>) ->
|
|||||||
match encode(&Header::default(), &claim, &EncodingKey::from_secret(payload.master_key.as_ref())) {
|
match encode(&Header::default(), &claim, &EncodingKey::from_secret(payload.master_key.as_ref())) {
|
||||||
Ok(t) => {
|
Ok(t) => {
|
||||||
let tok = OutToken { token: t };
|
let tok = OutToken { token: t };
|
||||||
info!("Generating token: {:?}", tok.token);
|
debug!("Generating token: {:?}", tok.token);
|
||||||
(StatusCode::CREATED, Json(tok))
|
(StatusCode::CREATED, Json(tok))
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@@ -283,3 +283,5 @@ fn key_authorization(headers: &HeaderMap, params: &HashMap<String, String>, mast
|
|||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -- ⚝ by Dave -- in NeoVim ⚝ --
|
||||||
|
|||||||
Reference in New Issue
Block a user