mirror of
https://github.com/coder/coder.git
synced 2025-06-28 04:33:02 +00:00
* feat: Add agent authentication based on instance ID Each cloud has it's own unique instance identity signatures, which can be used for zero-token authentication. This change adds support for tracking by "instance_id", and automatically authenticating with Google Cloud. * Add test for CLI * Fix workspace agent request name * Fix race with adding to wait group * Fix name of instance identity token
29 lines
663 B
Go
29 lines
663 B
Go
package codersdk_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/coderd/coderdtest"
|
|
"github.com/coder/coder/codersdk"
|
|
)
|
|
|
|
func TestUpload(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("Error", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t, nil)
|
|
_, err := client.UploadFile(context.Background(), "wow", []byte{})
|
|
require.Error(t, err)
|
|
})
|
|
t.Run("Upload", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t, nil)
|
|
_ = coderdtest.CreateInitialUser(t, client)
|
|
_, err := client.UploadFile(context.Background(), codersdk.ContentTypeTar, []byte{'a'})
|
|
require.NoError(t, err)
|
|
})
|
|
}
|