mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* feat: Add authentication and personal user endpoint This contribution adds a lot of scaffolding for the database fake and testability of coderd. A new endpoint "/user" is added to return the currently authenticated user to the requester. * Use TestMain to catch leak instead * Add userpassword package * Add WIP * Add user auth * Fix test * Add comments * Fix login response * Fix order * Fix generated code * Update httpapi/httpapi.go Co-authored-by: Bryan <bryan@coder.com> Co-authored-by: Bryan <bryan@coder.com>
18 lines
322 B
Go
18 lines
322 B
Go
package cmd_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/coderd/cmd"
|
|
)
|
|
|
|
func TestRoot(t *testing.T) {
|
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
|
go cancelFunc()
|
|
err := cmd.Root().ExecuteContext(ctx)
|
|
require.ErrorIs(t, err, context.Canceled)
|
|
}
|