mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: Remove interface from coderd and lift API surface (#1772)
Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`.
This commit is contained in:
@ -40,7 +40,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
authorizer := &fakeAuthorizer{}
|
||||
srv, client, _ := coderdtest.NewWithServer(t, &coderdtest.Options{
|
||||
client, api := coderdtest.NewWithAPI(t, &coderdtest.Options{
|
||||
Authorizer: authorizer,
|
||||
IncludeProvisionerD: true,
|
||||
})
|
||||
@ -267,8 +267,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
|
||||
assertRoute[noTrailSlash] = v
|
||||
}
|
||||
|
||||
c, _ := srv.Config.Handler.(*chi.Mux)
|
||||
err = chi.Walk(c, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error {
|
||||
err = chi.Walk(api.Handler, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error {
|
||||
name := method + ":" + route
|
||||
t.Run(name, func(t *testing.T) {
|
||||
authorizer.reset()
|
||||
|
Reference in New Issue
Block a user