Documentation ¶
Index ¶
- Constants
- func CheckIfCertIsSigned(t *testing.T, certificates []*x509.Certificate)
- func CheckIfSubjectEquals(t *testing.T, expectedSubject string, certificate *x509.Certificate)
- func CreateCsr(t *testing.T, certInfo CertInfo, keys *rsa.PrivateKey) []byte
- func CreateKey(t *testing.T) *rsa.PrivateKey
- func EncodeBase64(src []byte) string
- func EncodedCertChainToPemBytes(t *testing.T, encodedChain string) []byte
- func EncodedCertToPemBytes(t *testing.T, encodedCert string) []byte
- func NewHttpClient(skipVerify bool) *http.Client
- func NewTLSClientWithCert(skipVerify bool, key *rsa.PrivateKey, certificate ...[]byte) *http.Client
- type ApiInfo
- type ApplicationClientIdentity
- type CertInfo
- type ClusterClientIdentity
- type ConnectorClient
- type CrtResponse
- type CsrRequest
- type DecodedCrtResponse
- type Error
- type ErrorResponse
- type InfoResponse
- type K8sResourcesClient
- type ManagementInfoResponse
- type ManagementInfoURLs
- type RuntimeURLs
- type SecuredConnectorClient
- type TestConfig
- type TokenResponse
Constants ¶
View Source
const ( ApplicationHeader = "Application" GroupHeader = "Group" TenantHeader = "Tenant" EventsHostHeader = "EventsHost" MetadataHostHeader = "MetadataHost" Tenant = "testkit-tenant" Group = "testkit-group" )
Variables ¶
This section is empty.
Functions ¶
func CheckIfCertIsSigned ¶
func CheckIfCertIsSigned(t *testing.T, certificates []*x509.Certificate)
CheckIfCertIsSigned verifies that client certificate is signed by server certificate
func CheckIfSubjectEquals ¶
func CheckIfSubjectEquals(t *testing.T, expectedSubject string, certificate *x509.Certificate)
CheckIfSubjectEquals verifies that specified subject is equal to this in certificate
func EncodeBase64 ¶
func EncodedCertChainToPemBytes ¶
EncodedCertChainToPemBytes decodes certificates chain and return pemBlock's bytes for client cert and ca cert
func EncodedCertToPemBytes ¶
EncodedCertToPemBytes decodes certificate and return pemBlock's bytes for it
func NewHttpClient ¶
func NewTLSClientWithCert ¶
Types ¶
type ApiInfo ¶
type ApiInfo struct { *RuntimeURLs ManagementInfoURL string `json:"infoUrl"` CertificatesUrl string `json:"certificatesUrl"` }
type ApplicationClientIdentity ¶
type ApplicationClientIdentity struct { Application string `json:"application,omitempty"` ClusterClientIdentity }
type ClusterClientIdentity ¶
type ConnectorClient ¶
type ConnectorClient interface { CreateToken(t *testing.T) TokenResponse GetInfo(t *testing.T, url string, headers map[string]string) (*InfoResponse, *Error) CreateCertChain(t *testing.T, csr, url string) (*CrtResponse, *Error) }
func NewConnectorClient ¶
func NewConnectorClient(tokenRequest *http.Request, skipVerify bool) ConnectorClient
type CrtResponse ¶
type CsrRequest ¶
type CsrRequest struct {
Csr string `json:"csr"`
}
type DecodedCrtResponse ¶
type DecodedCrtResponse struct { CRTChain []*x509.Certificate ClientCRT *x509.Certificate CaCRT *x509.Certificate }
func DecodeAndParseCerts ¶
func DecodeAndParseCerts(t *testing.T, crtResponse *CrtResponse) DecodedCrtResponse
DecodeAndParseCerts decodes base64 encoded certificates chain and parses it
type Error ¶
type Error struct { StatusCode int ErrorResponse ErrorResponse }
type ErrorResponse ¶
type InfoResponse ¶
type K8sResourcesClient ¶
type K8sResourcesClient interface { CreateDummyApplication(namePrefix string, spec v1alpha1.ApplicationSpec) (*v1alpha1.Application, error) DeleteApplication(name string, options *v1.DeleteOptions) error }
func NewK8sResourcesClient ¶
func NewK8sResourcesClient() (K8sResourcesClient, error)
type ManagementInfoResponse ¶
type ManagementInfoResponse struct { URLs ManagementInfoURLs `json:"urls"` ClientIdentity ApplicationClientIdentity `json:"clientIdentity"` }
type ManagementInfoURLs ¶
type ManagementInfoURLs struct { *RuntimeURLs RenewCertUrl string `json:"renewCertUrl"` }
type RuntimeURLs ¶
type SecuredConnectorClient ¶
type SecuredConnectorClient interface { GetMgmInfo(t *testing.T, url string, headers map[string]string) (*ManagementInfoResponse, *Error) RenewCertificate(t *testing.T, url string, csr string) (*CrtResponse, *Error) }
func NewSecuredConnectorClient ¶
func NewSecuredConnectorClient(skipVerify bool, key *rsa.PrivateKey, certs []byte) SecuredConnectorClient
type TestConfig ¶
type TestConfig struct { InternalAPIUrl string ExternalAPIUrl string GatewayUrl string SkipSslVerify bool Central bool }
func ReadConfig ¶
func ReadConfig() (TestConfig, error)
type TokenResponse ¶
Click to show internal directories.
Click to hide internal directories.