Replace raw JSON config in activity log streams with a typed struct
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by reading the ActivityLogStream and ActivityLogStreamConfig definitions and the conversion shown in the issue; trace where the manual password removal happens. Done means config uses the typed config with the password wrapped as SecretStringWrapper and skipped during serialization, while validation remains in place and manual removal is dropped.
Written by the indexing model from the issue text.
Description
ActivityLogStream.config is stored and returned as raw serde_json::Value. The typed ActivityLogStreamConfig is only used for validation and its result is thrown away.
We should make config a typed struct with the password as SecretStringWrapper and skip_serializing, just like Settings, and drop the manual removal.
pub struct ActivityLogStream<I = NoId> {
pub id: I,
pub name: String,
#[model(enum)]
pub stream_type: ActivityLogStreamType,
pub config: serde_json::Value,
}
// validate config
let _ = ActivityLogStreamConfig::from_serde_value(&data.stream_type, &data.stream_config)?;
let stream_model = ActivityLogStream {
id: NoId,
name: data.name,
stream_type: data.stream_type,
config: data.stream_config,
};
- Dominant language
- Rust
- Stars
- 2.9k
- Forks
- 119
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 59
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DefGuard/defguard
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
DefGuard/defguard#3851 · 2 comments ·
Maintainers usually reply within 1 day
-
Incorrect "Edit workflow" label for MFA flow formPossibly taken @j-chmielewski claimed this 1 day ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
DefGuard/defguard#3844 · 1 assignee ·
Maintainers usually reply within 1 day
-
Invalid hover on the OS delete in posture check edit formPossibly taken @jakub-tldr claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
DefGuard/defguard#3842 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DefGuard/defguard#3751 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in DefGuard/defguard
Similar issues
-
state:triage-needed
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
docs(skills): issue-first should reference an existing Linear ticket instead of filing a duplicateOpendocumentation
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
area: tui good first issue help wanted type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
srothgan/claude-code-rust#473 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
storytold/photocraft#5260 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day