Skip to content

Conversation

@briskt
Copy link
Contributor

@briskt briskt commented Sep 15, 2025

No description provided.

@briskt briskt requested a review from a team as a code owner September 15, 2025 11:53
@briskt briskt requested review from devon-sil, ethancanne and hobbitronics and removed request for a team September 15, 2025 11:53
@briskt briskt requested a review from a team as a code owner September 15, 2025 11:58
Base automatically changed from new-totp-endpoint to develop September 17, 2025 00:36
@sonarqubecloud
Copy link

Copy link
Contributor

@jason-jackson jason-jackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not verified everything, hence just comments.

Comment on lines +180 to 182
err := fmt.Errorf("%s path parameter not provided to DeleteCredential, path: %s", IDParam, r.URL.Path)
jsonResponse(w, err, http.StatusBadRequest)
log.Printf("%s\n", err)
Copy link
Contributor

@jason-jackson jason-jackson Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want/need the path as part of the bad request response, I'd suggest just adding it to the log. Also given that it's passing the path now, should it also be sanitized as well? Actually, since it is "" here the path will always be /webauthn/credential// (or whatever), probably not even worth logging.

Suggested change
err := fmt.Errorf("%s path parameter not provided to DeleteCredential, path: %s", IDParam, r.URL.Path)
jsonResponse(w, err, http.StatusBadRequest)
log.Printf("%s\n", err)
err := fmt.Errorf("%s path parameter not provided to DeleteCredential", IDParam)
jsonResponse(w, err, http.StatusBadRequest)
log.Println(err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you mean that the error check could be removed since (I assume) ServeMux guarantees a non-zero path param?

@briskt briskt merged commit 6ae2f21 into develop Sep 17, 2025
6 checks passed
@briskt briskt deleted the route-refactor branch September 17, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants