mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: improve testing coverage on ExtractProvisionerDaemonAuthenticated middleware (#15622)
This one aims to resolve #15604 Created some table tests for the main cases - also preferred to create two isolated cases for the most complicated cases in order to keep table tests simple enough. Give us full coverage on the middleware logic, for both optional and non optional cases - PSK and ProvisionerKey.
This commit is contained in:
@@ -25,6 +25,9 @@ type ExtractProvisionerAuthConfig struct {
|
||||
PSK string
|
||||
}
|
||||
|
||||
// ExtractProvisionerDaemonAuthenticated authenticates a request as a provisioner daemon.
|
||||
// If the request is not authenticated, the next handler is called unless Optional is true.
|
||||
// This function currently is tested inside the enterprise package.
|
||||
func ExtractProvisionerDaemonAuthenticated(opts ExtractProvisionerAuthConfig) func(next http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user