Files
threshold/internal/servers/worker/proxy/options_test.go
T
Louis Ruch 425a56179f feat(worker): Implement egress credentials
Egress credentials Issued during AuthorizeSession are stored in the
session repo. These credentials are retrieved and stored in-memory on the
worker during the LookupSession call. Each proxy handler will need to
handle the credentials as required.
2021-12-17 11:27:10 -08:00

30 lines
706 B
Go

package proxy
import (
"testing"
serverpb "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
"github.com/stretchr/testify/assert"
)
func Test_GetOpts(t *testing.T) {
t.Parallel()
t.Run("WithEgressCredentials", func(t *testing.T) {
assert := assert.New(t)
c := &serverpb.Credential{
Credential: &serverpb.Credential_UserPassword{
UserPassword: &serverpb.UserPassword{
Username: "user",
Password: "pass",
},
},
}
opts := GetOpts(WithEgressCredentials([]*serverpb.Credential{c}))
testOpts := getDefaultOptions()
assert.NotEqual(opts, testOpts)
testOpts.WithEgressCredentials = []*serverpb.Credential{c}
assert.Equal(opts, testOpts)
})
}