-
Notifications
You must be signed in to change notification settings - Fork 246
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
addresses server panic when malformed authorization header is sent #573
Conversation
internal/auth/presharedkey_test.go
Outdated
"google.golang.org/grpc/metadata" | ||
) | ||
|
||
func TestMultiplePresharedKeys(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use a table-driven test here?
{"valid request with the second key", []string{"one", "two"}, true, "two", codes.OK}, | ||
{"denied due to unknown key", []string{"one", "two"}, true, "three", codes.PermissionDenied}, | ||
{"unauthenticated due to missing key", []string{"one", "two"}, true, "", codes.Unauthenticated}, | ||
{"unauthenticated due to missing metadata", []string{"one", "two"}, false, "", codes.Unauthenticated}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test with sending a header, but an empty one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ff19a64
to
bc41842
Compare
馃憢馃徎 Good day good people of the land of authorization, a quick fix!
What
addresses a server panic when a request with a malformed authorization header is received
How
presharedkey.go
file, including one that reproduces the problemstatus.Errorf
call that panics