Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Kotlin: make Transport class open for extension to allow custom… #1520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kotlin/src/main/com/looker/rtl/Transport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ fun customInitializer(
}
}

class Transport(val options: TransportOptions) {
open class Transport(val options: TransportOptions) {

private val apiPath = "${options.baseUrl}/api/${options.apiVersion}"

Expand Down Expand Up @@ -240,7 +240,7 @@ class Transport(val options: TransportOptions) {
} + addQueryParams(path, queryParams)
}

private fun getAllTrustingVerifiers(): Pair<SSLSocketFactory, HostnameVerifier> {
open fun getAllTrustingVerifiers(): Pair<SSLSocketFactory, HostnameVerifier> {
// NOTE! This is completely insecure and should ONLY be used with local server instance
// testing for development purposes
val tm: X509TrustManager = object : X509TrustManager {
Expand Down Expand Up @@ -276,7 +276,7 @@ class Transport(val options: TransportOptions) {
*
* Will disable SSL certificate verification iff [TransportOptions.verifySSL] is false.
*/
fun initTransport(options: TransportOptions): HttpTransport {
open fun initTransport(options: TransportOptions): HttpTransport {
return when (HttpTransports.valueOf(options.httpTransport.uppercase())) {
HttpTransports.APACHE -> {
// TODO: fix bug upstream that does not pass client context to requests.
Expand Down