Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tasks.withType<KotlinCompile> {
"-Xjvm-default=all",
"-Xexpect-actual-classes",
)
optIn.add("okhttp3.internal.OkHttpInternalApi")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ configure<MavenPublishBaseExtension> {
}

configure<ApiValidationExtension> {
ignoredPackages += "okhttp3.logging.internal"
ignoredPackages += "mockwebserver3.internal"
ignoredPackages += "okhttp3.internal"
ignoredPackages += "mockwebserver3.junit5.internal"
ignoredPackages += "okhttp3.brotli.internal"
ignoredPackages += "okhttp3.dnsoverhttps.internal"
ignoredPackages += "okhttp3.internal"
ignoredPackages += "okhttp3.logging.internal"
ignoredPackages += "okhttp3.sse.internal"
ignoredPackages += "okhttp3.tls.internal"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.dnsoverhttps.internal.DnsMessage
import okhttp3.dnsoverhttps.internal.DnsOverHttpsCall
import okhttp3.dnsoverhttps.internal.QueryRequestBody
import okhttp3.dnsoverhttps.internal.ResourceRecord
import okhttp3.dnsoverhttps.internal.TYPE_A
import okhttp3.dnsoverhttps.internal.TYPE_AAAA
import okhttp3.dnsoverhttps.internal.TYPE_HTTPS
import okhttp3.dnsoverhttps.internal.asQueryParameter
import okhttp3.dnsoverhttps.internal.decodeResponse
import okhttp3.internal.publicsuffix.PublicSuffixDatabase

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
@file:Suppress("ktlint:standard:filename")

package okhttp3.dnsoverhttps
package okhttp3.dnsoverhttps.internal

import java.io.IOException
import java.net.InetAddress
Expand All @@ -26,12 +26,14 @@ import okhttp3.RequestBody
import okhttp3.Response
import okhttp3.dnsoverhttps.DnsOverHttps.Companion.DNS_MESSAGE
import okhttp3.dnsoverhttps.DnsOverHttps.Companion.MAX_RESPONSE_SIZE
import okhttp3.internal.OkHttpInternalApi
import okhttp3.internal.platform.Platform
import okio.Buffer
import okio.BufferedSink
import okio.ByteString

internal data class DnsMessage(
@OkHttpInternalApi
data class DnsMessage(
val id: Short,
val flags: Int,
val questions: List<Question>,
Expand Down Expand Up @@ -79,7 +81,7 @@ internal data class DnsMessage(
}
}

internal data class Question(
data class Question(
val name: String,
val type: Int,
val `class`: Int = CLASS_IN,
Expand All @@ -94,7 +96,7 @@ internal data class Question(
}
}

internal sealed interface ResourceRecord {
sealed interface ResourceRecord {
val name: String
val timeToLive: Int

Expand Down Expand Up @@ -140,12 +142,18 @@ internal sealed interface ResourceRecord {
}

/** https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4 */
internal const val TYPE_A = 1
internal const val TYPE_AAAA = 28
internal const val TYPE_HTTPS = 65
@OkHttpInternalApi
const val TYPE_A = 1

@OkHttpInternalApi
const val TYPE_AAAA = 28

@OkHttpInternalApi
const val TYPE_HTTPS = 65

/** https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2 */
internal const val CLASS_IN = 1
@OkHttpInternalApi
const val CLASS_IN = 1

/** https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 */
internal const val RESPONSE_CODE_SUCCESS = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
*/
@file:Suppress("ktlint:standard:filename")

package okhttp3.dnsoverhttps
package okhttp3.dnsoverhttps.internal

import java.net.InetAddress
import okhttp3.Protocol
import okhttp3.internal.OkHttpInternalApi
import okio.Buffer
import okio.BufferedSource
import okio.ByteString
Expand All @@ -33,7 +34,8 @@ import okio.buffer
*
* https://datatracker.ietf.org/doc/html/rfc1035
*/
internal class DnsMessageReader(
@OkHttpInternalApi
class DnsMessageReader(
source: BufferedSource,
) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
*/
@file:Suppress("ktlint:standard:filename")

package okhttp3.dnsoverhttps
package okhttp3.dnsoverhttps.internal

import java.net.Inet4Address
import java.net.Inet6Address
import okhttp3.Protocol
import okhttp3.internal.OkHttpInternalApi
import okio.Buffer
import okio.ByteString
import okio.ByteString.Companion.encodeUtf8
Expand All @@ -30,7 +31,8 @@ import okio.utf8Size
*
* https://datatracker.ietf.org/doc/html/rfc1035
*/
internal class DnsMessageWriter(
@OkHttpInternalApi
class DnsMessageWriter(
private val sink: Buffer,
) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
* limitations under the License.
*/
@file:Suppress("ktlint:standard:filename")
@file:OptIn(OkHttpInternalApi::class)

package okhttp3.dnsoverhttps
package okhttp3.dnsoverhttps.internal

import java.io.IOException
import java.util.concurrent.atomic.AtomicReference
Expand All @@ -35,6 +34,7 @@ import okhttp3.internal.testAndSet
/**
* Implements [Dns.Call] by making multiple HTTPS calls.
*/
@OkHttpInternalApi
internal class DnsOverHttpsCall(
override val request: Dns.Request,
private val calls: List<Call>,
Expand Down

This file was deleted.

Loading
Loading