Repository navigation
fix: survive broken D2L topics, honest body-state reporting, URL escaping, credential-leak fix #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9142ab8
fix(archive): percent-encode D2L file-body URLs before download
IamCoder18 94ff8bb
fix(archive): skip broken topics and survive per-topic fetch failures
IamCoder18 00fd5a3
fix(archive): report bodies missing from disk, not just missing pointers
IamCoder18 8a57080
fix(login): gate HTTP debug dumps behind --verbose, redact SAML and c…
IamCoder18 5008f78
fix(systemd): parse list-timers rows with placeholder LAST/PASSED col…
IamCoder18 ef3767e
chore(systemd): drop dead code, surface install warnings via Status
IamCoder18 9c5938e
docs: changelog entries for the robustness, body-state, and login-lea…
IamCoder18 b029da3
style(urlutil): use fmt.Fprintf on the builder (staticcheck QF1012)
IamCoder18 152e69a
fix(urlutil): clean absolute URLs too and treat ? as a path character
IamCoder18 8160d71
fix(archive): report expired sessions for course list, login pages, a…
IamCoder18 8f71f3e
test(archive): make the FileTopics HasBody test assert its fixture
IamCoder18 d1d1832
fix(login): redact SAML in every verbose URL/header, redact cookie va…
IamCoder18 db81ce1
fix(systemd): parse rows whose NEXT is a placeholder but LAST is real
IamCoder18 02d2db7
docs: changelog updates for review-fix round (URL cleaning, session-e…
IamCoder18 d2e378e
fix(archive): bound network outages, reject login-page bodies, fix re…
IamCoder18 a3adc67
fix(archive): only treat a stat ErrNotExist as a missing body blob
IamCoder18 86d33a6
fix(systemd): report real removal errors, parse the whole LEFT field
IamCoder18 2859c6d
test(login): panic-safe stderr capture, atomic request counter
IamCoder18 fd9217e
fix(cmd): say so when only broken topics remain, add the dry-run Brok…
IamCoder18 0dda22c
fix(archive): persist the course index when a course pass aborts
IamCoder18 cd7cbbc
fix(archive): report an unreadable blob in verify instead of passing it
IamCoder18 56c3a3e
fix(systemd): don't hide a failed removal behind the daemon-reload error
IamCoder18 70bc9c9
fix(urlutil): treat the scheme case-insensitively when detecting abso…
IamCoder18 ca4cf0b
test(systemd): cover both placeholder spellings in both row shapes
IamCoder18 2613bba
test(login): buffer the stderr capture channel
IamCoder18 04ff969
docs: changelog entries for the abort-persistence and verify-stat fixes
IamCoder18 ebbf46a
fix(archive): clear a stale body pointer when a modified topic's body…
IamCoder18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestResolveFileURL(t *testing.T) { | ||
| cases := []struct { | ||
| name string | ||
| in string | ||
| want string | ||
| wantErr bool | ||
| }{ | ||
| { | ||
| name: "relative enforced path with space and percent", | ||
| in: "/content/enforced/1522695-x/Acetic Acid, 5% (Vinegar).pdf", | ||
| want: "https://d2l.cbe.ab.ca/content/enforced/1522695-x/Acetic%20Acid,%205%25%20(Vinegar).pdf", | ||
| }, | ||
| { | ||
| name: "hash in filename becomes an escape, not a fragment", | ||
| in: "/content/enforced/1527886-x/Quiz #3 Chemistry.pdf", | ||
| want: "https://d2l.cbe.ab.ca/content/enforced/1527886-x/Quiz%20%233%20Chemistry.pdf", | ||
| }, | ||
| { | ||
| name: "existing escape preserved", | ||
| in: "/content/enforced/1522695-x/KEY%20Practice.pdf", | ||
| want: "https://d2l.cbe.ab.ca/content/enforced/1522695-x/KEY%20Practice.pdf", | ||
| }, | ||
| { | ||
| name: "relative reference with a colon in the first segment", | ||
| in: "Week 1: Intro/notes.pdf", | ||
| want: "https://d2l.cbe.ab.ca/Week%201:%20Intro/notes.pdf", | ||
| }, | ||
| { | ||
| name: "absolute URL is cleaned too", | ||
| in: "https://files.example.com/a b#c.pdf", | ||
| want: "https://files.example.com/a%20b%23c.pdf", | ||
| }, | ||
| { | ||
| name: "empty URL", | ||
| in: "", | ||
| wantErr: true, | ||
| }, | ||
| } | ||
| for _, tc := range cases { | ||
| got, err := resolveFileURL(tc.in) | ||
| if tc.wantErr { | ||
| if err == nil { | ||
| t.Errorf("%s: resolveFileURL(%q) = %q, want an error", tc.name, tc.in, got) | ||
| } | ||
| continue | ||
| } | ||
| if err != nil { | ||
| t.Errorf("%s: resolveFileURL(%q): %v", tc.name, tc.in, err) | ||
| continue | ||
| } | ||
| if got != tc.want { | ||
| t.Errorf("%s: resolveFileURL(%q) = %q, want %q", tc.name, tc.in, got, tc.want) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.