* feat(credentials): Refactor credential purposes * Application credentials have been refactored to Brokered credentials * Egress credentials have been refactored to Injected Application credentials Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
30 lines
757 B
Go
30 lines
757 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("WithInjectedApplicationCredentials", func(t *testing.T) {
|
|
assert := assert.New(t)
|
|
c := &serverpb.Credential{
|
|
Credential: &serverpb.Credential_UsernamePassword{
|
|
UsernamePassword: &serverpb.UsernamePassword{
|
|
Username: "user",
|
|
Password: "pass",
|
|
},
|
|
},
|
|
}
|
|
opts := GetOpts(WithInjectedApplicationCredentials([]*serverpb.Credential{c}))
|
|
testOpts := getDefaultOptions()
|
|
assert.NotEqual(opts, testOpts)
|
|
testOpts.WithInjectedApplicationCredentials = []*serverpb.Credential{c}
|
|
assert.Equal(opts, testOpts)
|
|
})
|
|
}
|