Skip to content

Commit 4a7e898

Browse files
RaduWjan-auer
authored andcommitted
feat: Implement Security Report endpoint (#276)
1 parent c0f8995 commit 4a7e898

40 files changed

+3075
-327
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ style-rust:
125125

126126
style-python: setup-venv
127127
.venv/bin/pip install -U black
128-
.venv/bin/black --check py --exclude '\.eggs|semaphore/_lowlevel.*'
128+
.venv/bin/black --check py tests --exclude '\.eggs|semaphore/_lowlevel.*'
129129
.PHONY: style-python
130130

131131
# Linting
@@ -155,7 +155,7 @@ format-rust:
155155

156156
format-python: setup-venv
157157
.venv/bin/pip install -U black
158-
.venv/bin/black py --exclude '\.eggs|semaphore/_lowlevel.*'
158+
.venv/bin/black py tests --exclude '\.eggs|semaphore/_lowlevel.*'
159159
.PHONY: format-python
160160

161161
# Development

general/src/protocol/logentry.rs

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ pub struct LogEntry {
2525
pub other: Object<Value>,
2626
}
2727

28+
impl From<String> for LogEntry {
29+
fn from(formatted_msg: String) -> Self {
30+
LogEntry {
31+
formatted: Annotated::new(formatted_msg),
32+
..Self::default()
33+
}
34+
}
35+
}
36+
2837
impl FromValue for LogEntry {
2938
fn from_value(value: Annotated<Value>) -> Annotated<Self> {
3039
// raw 'message' is coerced to the Message interface, as its used for pure index of

general/src/protocol/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ pub use self::exception::Exception;
3737
pub use self::fingerprint::Fingerprint;
3838
pub use self::logentry::LogEntry;
3939
pub use self::mechanism::{CError, MachException, Mechanism, MechanismMeta, PosixSignal};
40-
pub use self::request::{Cookies, HeaderName, Headers, Query, Request};
41-
pub use self::security_report::{Csp, ExpectCt, ExpectStaple, Hpkp};
40+
pub use self::request::{Cookies, HeaderName, HeaderValue, Headers, Query, Request};
41+
pub use self::security_report::{Csp, ExpectCt, ExpectStaple, Hpkp, SecurityReportType};
4242
pub use self::span::Span;
4343
pub use self::stacktrace::{Frame, FrameData, FrameVars, RawStacktrace, Stacktrace};
4444
pub use self::tags::{TagEntry, Tags};

general/src/protocol/request.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl FromValue for Cookies {
8585
/// A "into-string" type that normalizes header names.
8686
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Empty, ToValue, ProcessValue)]
8787
#[metastructure(process_func = "process_header_name")]
88-
pub struct HeaderName(pub String);
88+
pub struct HeaderName(String);
8989

9090
impl HeaderName {
9191
/// Creates a normalized header name.

0 commit comments

Comments
 (0)