Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ default-members = [
]

[workspace.package]
version = "0.14.0"
version = "0.15.0"
authors = [
"Thorrester <[email protected]>",
"russellkemmit <[email protected]>",
Expand All @@ -20,25 +20,25 @@ repository = "https://github.com/demml/scouter"


[workspace.dependencies]
scouter-auth = { path = "crates/scouter_auth", version = "0.14.0" }
scouter-client = { path = "crates/scouter_client", version = "0.14.0" }
scouter-dispatch = { path = "crates/scouter_dispatch", version = "0.14.0" }
scouter-drift = { path = "crates/scouter_drift", version = "0.14.0", default-features = false }
scouter-evaluate = { path = "crates/scouter_evaluate", version = "0.14.0" }
scouter-events = { path = "crates/scouter_events", version = "0.14.0", default-features = false }
scouter-http = { path = "crates/scouter_http", version = "0.14.0" }
scouter-observability = { path = "crates/scouter_observability", version = "0.14.0" }
scouter-profile = { path = "crates/scouter_profile", version = "0.14.0" }
scouter-server = { path = "crates/scouter_server", version = "0.14.0" }
scouter-semver = { path = "crates/scouter_semver", version = "0.14.0" }
scouter-settings = { path = "crates/scouter_settings", version = "0.14.0" }
scouter-dataframe = { path = "crates/scouter_dataframe", version = "0.14.0" }
scouter-macro = { path = "crates/scouter_macro", version = "0.14.0" }
scouter-state = { path = "crates/scouter_state", version = "0.14.0" }
scouter-sql = { path = "crates/scouter_sql", version = "0.14.0" }
scouter-tonic = { path = "crates/scouter_tonic", version = "0.14.0" }
scouter-tracing = { path = "crates/scouter_tracing", version = "0.14.0" }
scouter-types = { path = "crates/scouter_types", version = "0.14.0" }
scouter-auth = { path = "crates/scouter_auth", version = "0.15.0" }
scouter-client = { path = "crates/scouter_client", version = "0.15.0" }
scouter-dispatch = { path = "crates/scouter_dispatch", version = "0.15.0" }
scouter-drift = { path = "crates/scouter_drift", version = "0.15.0", default-features = false }
scouter-evaluate = { path = "crates/scouter_evaluate", version = "0.15.0" }
scouter-events = { path = "crates/scouter_events", version = "0.15.0", default-features = false }
scouter-http = { path = "crates/scouter_http", version = "0.15.0" }
scouter-observability = { path = "crates/scouter_observability", version = "0.15.0" }
scouter-profile = { path = "crates/scouter_profile", version = "0.15.0" }
scouter-server = { path = "crates/scouter_server", version = "0.15.0" }
scouter-semver = { path = "crates/scouter_semver", version = "0.15.0" }
scouter-settings = { path = "crates/scouter_settings", version = "0.15.0" }
scouter-dataframe = { path = "crates/scouter_dataframe", version = "0.15.0" }
scouter-macro = { path = "crates/scouter_macro", version = "0.15.0" }
scouter-state = { path = "crates/scouter_state", version = "0.15.0" }
scouter-sql = { path = "crates/scouter_sql", version = "0.15.0" }
scouter-tonic = { path = "crates/scouter_tonic", version = "0.15.0" }
scouter-tracing = { path = "crates/scouter_tracing", version = "0.15.0" }
scouter-types = { path = "crates/scouter_types", version = "0.15.0" }
scouter-mocks = { path = "crates/scouter_mocks" }
test-utils = { path = "crates/test_utils" }

Expand Down
1 change: 1 addition & 0 deletions crates/scouter_auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rand = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }

scouter-sql = { workspace = true }

10 changes: 7 additions & 3 deletions crates/scouter_auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use rand::Rng;
use scouter_sql::sql::schema::User;
use serde::{Deserialize, Serialize};
use std::time::{SystemTime, UNIX_EPOCH};
use tracing::error;

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Claims {
Expand Down Expand Up @@ -87,7 +88,8 @@ impl AuthManager {
token,
&DecodingKey::from_secret(self.jwt_secret.as_ref()),
&Validation::default(),
)?;
)
.inspect_err(|e| error!("failed to validate JWT: {:?}", e))?;
Ok(token_data.claims)
}

Expand All @@ -96,12 +98,14 @@ impl AuthManager {
token: &str,
) -> Result<Claims, jsonwebtoken::errors::Error> {
let mut validation = Validation::default();
validation.insecure_disable_signature_validation();
// Disable expiration validation ( we just want to decode the claims )
validation.validate_exp = false;
let token_data = decode::<Claims>(
token,
&DecodingKey::from_secret(self.jwt_secret.as_ref()),
&validation,
)?;
)
.inspect_err(|e| error!("failed to decode JWT without validation: {:?}", e))?;

Ok(token_data.claims)
}
Expand Down
6 changes: 5 additions & 1 deletion crates/scouter_events/src/producer/grpc/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ impl GrpcProducer {

pub async fn publish(&self, message: MessageRecord) -> Result<(), EventError> {
let msg_bytes = serde_json::to_vec(&message)?;
let msg_type = message.record_type();
let response = self.client.insert_message(msg_bytes).await?;

debug!("Published message to drift with response: {:?}", response);
debug!(
"Published message to drift with response: {:?}, message type: {:?}",
response, msg_type
);

Ok(())
}
Expand Down
11 changes: 9 additions & 2 deletions crates/scouter_events/src/queue/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub struct QueueBus {
impl QueueBus {
#[instrument(skip_all)]
pub fn new(task_state: TaskState, identifier: String) -> Self {
debug!("Creating unbounded QueueBus");
debug!("Creating unbounded QueueBus for identifier: {}", identifier);

Self {
task_state,
Expand All @@ -218,6 +218,10 @@ impl QueueBus {

#[instrument(skip_all)]
pub fn publish(&self, event: Event) -> Result<(), EventError> {
debug!(
"Publishing event to QueueBus for identifier: {}",
self.identifier
);
Ok(self.task_state.event_tx.send(event)?)
}
}
Expand All @@ -231,7 +235,10 @@ impl QueueBus {
pub fn insert(&self, item: &Bound<'_, PyAny>) -> Result<(), PyEventError> {
let item = QueueItem::from_py_entity(item)
.inspect_err(|e| error!("Failed to convert entity to QueueItem: {}", e))?;
debug!("Inserting event into QueueBus: {:?}", item);
debug!(
"Inserting event into QueueBus for identifier: {}: {:?}",
self.identifier, item
);
let event = Event::Task(item);
self.publish(event)?;
Ok(())
Expand Down
Loading