Documentation ¶
Index ¶
- Constants
- Variables
- func GetDestinationPrefixNameIdentifier(name string) string
- type BaseDestinationRequestBody
- type BasicDestRequestBody
- type CertificateAPIConfig
- type CertificateRequestBody
- type CertificateResponseBody
- type ClientCertificateAuthDestRequestBody
- type Config
- type DeleteResponse
- type DeleteStatus
- type DesignTimeDestRequestBody
- type DestinationAPIConfig
- type DestinationRequestBody
- type Handler
- func (h *Handler) CleanupDestinationCertificates(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) CleanupDestinations(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateCertificate(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateDestinations(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteCertificate(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteDestination(writer http.ResponseWriter, req *http.Request)
- func (h *Handler) DeleteDestinations(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) FindDestinationByNameFromDestinationSvc(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) GetDestinationCertificateByNameFromDestinationSvc(writer http.ResponseWriter, r *http.Request)
- func (h *Handler) GetSensitiveData(writer http.ResponseWriter, req *http.Request)
- func (h *Handler) GetSubaccountDestinationsPage(writer http.ResponseWriter, req *http.Request)
- func (h *Handler) PostDestination(writer http.ResponseWriter, req *http.Request)
- type OAuth2ClientCredsDestRequestBody
- type PostResponse
- type SAMLAssertionDestRequestBody
Constants ¶
const (
CertChain = "e2e-test-destination-cert-mock-cert-chain"
)
Variables ¶
var ( UniqueEntityNameIdentifier = "name_%s_subacc_%s_instance_%s" NameIdentifier = "name_%s" )
var FindAPIBasicDestResponseTemplate = `` /* 525-byte string literal not displayed */
var FindAPIClientCertDestResponseTemplate = `` /* 353-byte string literal not displayed */
var FindAPINoAuthDestResponseTemplate = `` /* 239-byte string literal not displayed */
var FindAPIOAuth2ClientCredsDestResponseTemplate = `` /* 556-byte string literal not displayed */
var FindAPIOAuth2mTLSDestResponseTemplate = `` /* 723-byte string literal not displayed */
var FindAPISAMLAssertionDestResponseTemplate = `` /* 557-byte string literal not displayed */
Functions ¶
Types ¶
type BaseDestinationRequestBody ¶
type BaseDestinationRequestBody struct { Name string `json:"name"` URL string `json:"url"` Type destinationcreatorpkg.Type `json:"type"` ProxyType destinationcreatorpkg.ProxyType `json:"proxyType"` AuthenticationType destinationcreatorpkg.AuthType `json:"authenticationType"` XCorrelationID string `json:"x-correlation-id"` // old format CorrelationIds string `json:"correlationIds"` // new format XSystemTenantID string `json:"x-system-id"` // local tenant id XSystemTenantName string `json:"x-system-name"` // random or application name XSystemType string `json:"x-system-type"` // application type }
BaseDestinationRequestBody contains the base fields needed in the destination request body
func (*BaseDestinationRequestBody) GetDestinationUniqueIdentifier ¶
func (b *BaseDestinationRequestBody) GetDestinationUniqueIdentifier(subaccountID, instanceID string) string
type BasicDestRequestBody ¶
type BasicDestRequestBody struct { BaseDestinationRequestBody User string `json:"user"` Password string `json:"password"` }
BasicDestRequestBody contains the necessary fields for the destination request body with authentication type AuthTypeBasic
func (*BasicDestRequestBody) GetDestinationType ¶
func (b *BasicDestRequestBody) GetDestinationType() string
func (*BasicDestRequestBody) ToDestination ¶
func (b *BasicDestRequestBody) ToDestination() destinationcreator.Destination
func (*BasicDestRequestBody) Validate ¶
func (b *BasicDestRequestBody) Validate() error
Validate validates that the AuthTypeBasic request body contains the required fields, and they are valid
type CertificateAPIConfig ¶
type CertificateAPIConfig struct { SubaccountLevelPath string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_PATH"` InstanceLevelPath string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_INSTANCE_LEVEL_PATH"` RegionParam string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_REGION_PARAMETER"` InstanceIDParam string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_INSTANCE_ID_PARAMETER"` SubaccountIDParam string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_SUBACCOUNT_ID_PARAMETER"` CertificateNameParam string `envconfig:"APP_DESTINATION_CREATOR_CERTIFICATE_NAME_PARAMETER"` }
CertificateAPIConfig holds a test configuration specific for the certificate API of the destination creator service
type CertificateRequestBody ¶
type CertificateRequestBody struct {
FileName string `json:"fileName"`
}
CertificateRequestBody contains the necessary fields for the destination creator certificate request body
func (*CertificateRequestBody) Validate ¶
func (c *CertificateRequestBody) Validate() error
Validate validates that the SAML assertion certificate request body contains the required fields, and they are valid
type CertificateResponseBody ¶
type CertificateResponseBody struct { FileName string `json:"fileName"` CommonName string `json:"commonName"` CertificateChain string `json:"certificateChain"` }
CertificateResponseBody contains the response data from the destination creator certificate request
type ClientCertificateAuthDestRequestBody ¶
type ClientCertificateAuthDestRequestBody struct { BaseDestinationRequestBody KeyStoreLocation string `json:"keyStoreLocation"` }
ClientCertificateAuthDestRequestBody contains the necessary fields for the destination request body with authentication type AuthTypeClientCertificate
func (*ClientCertificateAuthDestRequestBody) GetDestinationType ¶
func (s *ClientCertificateAuthDestRequestBody) GetDestinationType() string
func (*ClientCertificateAuthDestRequestBody) ToDestination ¶
func (s *ClientCertificateAuthDestRequestBody) ToDestination() destinationcreator.Destination
func (*ClientCertificateAuthDestRequestBody) Validate ¶
func (s *ClientCertificateAuthDestRequestBody) Validate() error
Validate validates that the AuthTypeClientCertificate request body contains the required fields, and they are valid
type Config ¶
type Config struct { CorrelationIDsKey string `envconfig:"APP_DESTINATION_CREATOR_CORRELATION_IDS_KEY"` *DestinationAPIConfig *CertificateAPIConfig }
Config holds destination creator service API test configuration
type DeleteResponse ¶
type DeleteResponse struct { Count int Summary []DeleteStatus }
type DeleteStatus ¶
type DesignTimeDestRequestBody ¶
type DesignTimeDestRequestBody struct {
BaseDestinationRequestBody
}
DesignTimeDestRequestBody contains the necessary fields for the destination request body with authentication type AuthTypeNoAuth
func (*DesignTimeDestRequestBody) GetDestinationType ¶
func (n *DesignTimeDestRequestBody) GetDestinationType() string
func (*DesignTimeDestRequestBody) ToDestination ¶
func (n *DesignTimeDestRequestBody) ToDestination() destinationcreator.Destination
func (*DesignTimeDestRequestBody) Validate ¶
func (n *DesignTimeDestRequestBody) Validate() error
Validate validates that the AuthTypeNoAuth request body contains the required fields, and they are valid
type DestinationAPIConfig ¶
type DestinationAPIConfig struct { SubaccountLevelPath string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_PATH"` InstanceLevelPath string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_INSTANCE_LEVEL_PATH"` RegionParam string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_REGION_PARAMETER"` InstanceIDParam string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_INSTANCE_ID_PARAMETER"` SubaccountIDParam string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_SUBACCOUNT_ID_PARAMETER"` DestinationNameParam string `envconfig:"APP_DESTINATION_CREATOR_DESTINATION_NAME_PARAMETER"` }
DestinationAPIConfig holds a test configuration specific for the destination API of the destination creator service
type DestinationRequestBody ¶
type DestinationRequestBody interface { ToDestination() destinationcreator.Destination Validate() error GetDestinationType() string GetDestinationUniqueIdentifier(subaccountID, instanceID string) string }
type Handler ¶
type Handler struct { Config *Config DestinationSvcDestinations map[string]destinationcreator.Destination DestinationSvcCertificates map[string]json.RawMessage DestinationsSensitive map[string][]byte }
Handler is responsible to mock and handle any Destination Service requests
func (*Handler) CleanupDestinationCertificates ¶
func (h *Handler) CleanupDestinationCertificates(writer http.ResponseWriter, r *http.Request)
CleanupDestinationCertificates is "internal/technical" handler for deleting in-memory certificates mappings
func (*Handler) CleanupDestinations ¶
func (h *Handler) CleanupDestinations(writer http.ResponseWriter, r *http.Request)
CleanupDestinations is "internal/technical" handler for deleting in-memory destinations mappings
func (*Handler) CreateCertificate ¶
func (h *Handler) CreateCertificate(writer http.ResponseWriter, r *http.Request)
CreateCertificate mocks creation of certificate in both Destination Creator Service and Destination Service using the APIs in the Destination Creator component
func (*Handler) CreateDestinations ¶
func (h *Handler) CreateDestinations(writer http.ResponseWriter, r *http.Request)
CreateDestinations mocks creation of all types of destinations in both Destination Creator Service and Destination Service using the APIs in the Destination Creator component
func (*Handler) DeleteCertificate ¶
func (h *Handler) DeleteCertificate(writer http.ResponseWriter, r *http.Request)
DeleteCertificate mocks deletion of certificate from both Destination Creator Service and Destination Service using the APIs in the Destination Creator component
func (*Handler) DeleteDestination ¶
func (h *Handler) DeleteDestination(writer http.ResponseWriter, req *http.Request)
DeleteDestination is an "internal/technical" handler for deleting Destinations from E2E tests
func (*Handler) DeleteDestinations ¶
func (h *Handler) DeleteDestinations(writer http.ResponseWriter, r *http.Request)
DeleteDestinations mocks deletion of destinations from both Destination Creator Service and Destination Service using the APIs in the Destination Creator component
func (*Handler) FindDestinationByNameFromDestinationSvc ¶
func (h *Handler) FindDestinationByNameFromDestinationSvc(writer http.ResponseWriter, r *http.Request)
FindDestinationByNameFromDestinationSvc finds a destination by name
func (*Handler) GetDestinationCertificateByNameFromDestinationSvc ¶
func (h *Handler) GetDestinationCertificateByNameFromDestinationSvc(writer http.ResponseWriter, r *http.Request)
GetDestinationCertificateByNameFromDestinationSvc mocks getting a single certificate by its name from Destination Service
func (*Handler) GetSensitiveData ¶
func (h *Handler) GetSensitiveData(writer http.ResponseWriter, req *http.Request)
GetSensitiveData mocks getting a sensitive data by destination name from Destination Service
func (*Handler) GetSubaccountDestinationsPage ¶
func (h *Handler) GetSubaccountDestinationsPage(writer http.ResponseWriter, req *http.Request)
GetSubaccountDestinationsPage gets a page of destinations
func (*Handler) PostDestination ¶
func (h *Handler) PostDestination(writer http.ResponseWriter, req *http.Request)
PostDestination is an "internal/technical" handler for creating Destinations from E2E tests
type OAuth2ClientCredsDestRequestBody ¶
type OAuth2ClientCredsDestRequestBody struct { BaseDestinationRequestBody TokenServiceURL string `json:"tokenServiceURL"` TokenServiceURLType string `json:"tokenServiceURLType"` ClientID string `json:"clientId"` KeyStoreLocation string `json:"tokenServiceKeystoreLocation"` ClientSecret string `json:"clientSecret"` }
OAuth2ClientCredsDestRequestBody contains the necessary fields for the destination request body with authentication type OAuth2ClientCredentials
func (*OAuth2ClientCredsDestRequestBody) GetDestinationType ¶
func (b *OAuth2ClientCredsDestRequestBody) GetDestinationType() string
func (*OAuth2ClientCredsDestRequestBody) ToDestination ¶
func (b *OAuth2ClientCredsDestRequestBody) ToDestination() destinationcreator.Destination
func (*OAuth2ClientCredsDestRequestBody) Validate ¶
func (b *OAuth2ClientCredsDestRequestBody) Validate() error
Validate validates that the AuthTypeBasic request body contains the required fields, and they are valid
type PostResponse ¶
type SAMLAssertionDestRequestBody ¶
type SAMLAssertionDestRequestBody struct { BaseDestinationRequestBody Audience string `json:"audience"` KeyStoreLocation string `json:"keyStoreLocation"` }
SAMLAssertionDestRequestBody contains the necessary fields for the destination request body with authentication type AuthTypeSAMLAssertion
func (*SAMLAssertionDestRequestBody) GetDestinationType ¶
func (s *SAMLAssertionDestRequestBody) GetDestinationType() string
func (*SAMLAssertionDestRequestBody) ToDestination ¶
func (s *SAMLAssertionDestRequestBody) ToDestination() destinationcreator.Destination
func (*SAMLAssertionDestRequestBody) Validate ¶
func (s *SAMLAssertionDestRequestBody) Validate() error
Validate validates that the AuthTypeSAMLAssertion request body contains the required fields, and they are valid