当前位置: 首页>>代码示例>>Golang>>正文


Golang fake_ssh.FakeConnMetadata类代码示例

本文整理汇总了Golang中github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh.FakeConnMetadata的典型用法代码示例。如果您正苦于以下问题:Golang FakeConnMetadata类的具体用法?Golang FakeConnMetadata怎么用?Golang FakeConnMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FakeConnMetadata类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

	"github.com/onsi/gomega/ghttp"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"
)

var _ = Describe("CFAuthenticator", func() {
	var (
		authenticator      *authenticators.CFAuthenticator
		logger             *lagertest.TestLogger
		httpClient         *http.Client
		httpClientTimeout  time.Duration
		permissionsBuilder *fake_authenticators.FakePermissionsBuilder

		permissions *ssh.Permissions
		authenErr   error

		metadata *fake_ssh.FakeConnMetadata
		password []byte

		fakeCC      *ghttp.Server
		fakeUAA     *ghttp.Server
		ccURL       string
		uaaTokenURL string
		uaaUsername string
		uaaPassword string
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")

		httpClientTimeout = time.Second
		httpClient = &http.Client{Timeout: httpClientTimeout}
开发者ID:benjaminharnett,项目名称:diego-ssh,代码行数:32,代码来源:cf_authenticator_test.go

示例2:

	"github.com/cloudfoundry-incubator/diego-ssh/authenticators"
	"github.com/cloudfoundry-incubator/diego-ssh/authenticators/fake_authenticators"
	"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DiegoProxyAuthenticator", func() {
	var (
		logger             *lagertest.TestLogger
		credentials        []byte
		permissionsBuilder *fake_authenticators.FakePermissionsBuilder
		authenticator      *authenticators.DiegoProxyAuthenticator
		metadata           *fake_ssh.FakeConnMetadata
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")
		credentials = []byte("some-user:some-password")
		permissionsBuilder = &fake_authenticators.FakePermissionsBuilder{}
		permissionsBuilder.BuildReturns(&ssh.Permissions{}, nil)
		authenticator = authenticators.NewDiegoProxyAuthenticator(logger, credentials, permissionsBuilder)

		metadata = &fake_ssh.FakeConnMetadata{}
	})

	Describe("Authenticate", func() {
开发者ID:swisscom,项目名称:diego-ssh,代码行数:30,代码来源:diego_proxy_authenticator_test.go

示例3:

import (
	"errors"

	"github.com/cloudfoundry-incubator/diego-ssh/authenticators"
	"github.com/cloudfoundry-incubator/diego-ssh/authenticators/fake_authenticators"
	"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"golang.org/x/crypto/ssh"
)

var _ = Describe("CompositeAuthenticator", func() {
	Describe("Authenticate", func() {
		var (
			authenticator    *authenticators.CompositeAuthenticator
			authenticatorMap map[string]authenticators.PasswordAuthenticator
			metadata         *fake_ssh.FakeConnMetadata
			password         []byte
		)

		BeforeEach(func() {
			authenticatorMap = map[string]authenticators.PasswordAuthenticator{}
			metadata = &fake_ssh.FakeConnMetadata{}
			password = []byte{}
		})

		JustBeforeEach(func() {
			authenticator = authenticators.NewCompositeAuthenticator(authenticatorMap)
		})

		Context("when no authenticators are specified", func() {
			It("fails to authenticate", func() {
开发者ID:sykesm,项目名称:diego-ssh,代码行数:32,代码来源:composite_authenticator_test.go

示例4:

	"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DiegoProxyAuthenticator", func() {
	var (
		receptorClient     *fake_receptor.FakeClient
		expectedRoute      routes.SSHRoute
		desiredLRPResponse receptor.DesiredLRPResponse
		actualLrpResponse  receptor.ActualLRPResponse
		authenticator      *authenticators.DiegoProxyAuthenticator
		logger             *lagertest.TestLogger
		receptorCreds      []byte
		metadata           *fake_ssh.FakeConnMetadata
	)

	BeforeEach(func() {
		receptorClient = new(fake_receptor.FakeClient)

		expectedRoute = routes.SSHRoute{
			ContainerPort:   1111,
			PrivateKey:      "pem-encoded-key",
			HostFingerprint: "host-fingerprint",
			User:            "user",
			Password:        "password",
		}
开发者ID:sykesm,项目名称:diego-ssh,代码行数:32,代码来源:diego_proxy_authenticator_test.go

示例5:

	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("PermissionsBuilder", func() {
	Describe("Build", func() {
		var (
			logger         *lagertest.TestLogger
			expectedRoute  routes.SSHRoute
			desiredLRP     *models.DesiredLRP
			actualLRPGroup *models.ActualLRPGroup
			bbsClient      *fake_bbs.FakeClient
			credentials    []byte
			metadata       *fake_ssh.FakeConnMetadata

			permissionsBuilder authenticators.PermissionsBuilder
			permissions        *ssh.Permissions
			buildErr           error
			processGuid        string
			index              int
		)

		BeforeEach(func() {
			logger = lagertest.NewTestLogger("test")

			expectedRoute = routes.SSHRoute{
				ContainerPort:   1111,
				PrivateKey:      "pem-encoded-key",
				HostFingerprint: "host-fingerprint",
开发者ID:benjaminharnett,项目名称:diego-ssh,代码行数:31,代码来源:permissions_builder_test.go

示例6:

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/ghttp"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"
)

var _ = Describe("CFAuthenticator", func() {
	var (
		authenticator   *authenticators.CFAuthenticator
		logger          *lagertest.TestLogger
		ccClient        *http.Client
		ccClientTimeout time.Duration
		receptorClient  *fake_receptor.FakeClient

		permissions *ssh.Permissions
		err         error

		metadata *fake_ssh.FakeConnMetadata
		password []byte

		fakeCC *ghttp.Server
		ccURL  string
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")
		ccClientTimeout = time.Second
		ccClient = &http.Client{Timeout: ccClientTimeout}
		receptorClient = new(fake_receptor.FakeClient)

		metadata = &fake_ssh.FakeConnMetadata{}
开发者ID:sykesm,项目名称:diego-ssh,代码行数:32,代码来源:cf_authenticator_test.go


注:本文中的github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh.FakeConnMetadata类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。