Skip to content

Commit a32f486

Browse files
Dependencies sweep (#376)
1 parent e9e1d33 commit a32f486

File tree

15 files changed

+49
-30
lines changed

15 files changed

+49
-30
lines changed

build.gradle.kts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ plugins {
1313

1414
id("org.jetbrains.kotlin.jvm") version kotlinVersion apply false
1515

16-
id("com.github.ben-manes.versions").version("0.48.0")
16+
id("com.github.ben-manes.versions").version("0.51.0")
1717
id("idea")
1818
id("io.gitlab.arturbosch.detekt").version("1.22.0")
1919
id("java")
2020
id("maven-publish")
2121
id("org.jetbrains.dokka").version("1.9.20")
22-
id("com.diffplug.spotless").version("6.21.0")
22+
id("com.diffplug.spotless").version("6.25.0")
2323
id("java-test-fixtures")
24-
id("io.spring.dependency-management").version("1.1.3")
24+
id("io.spring.dependency-management").version("1.1.6")
2525

2626
id("org.jetbrains.kotlin.android") version kotlinVersion apply false
2727
id("com.android.application") version "7.4.2" apply false
@@ -115,7 +115,11 @@ configure(
115115
"ktlint_standard_no-wildcard-imports" to "disabled",
116116
"ktlint_standard_enum-entry-name-case" to "disabled",
117117
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
118-
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled"
118+
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
119+
"ktlint_standard_value-parameter-comment" to "disabled",
120+
"ktlint_standard_value-argument-comment" to "disabled",
121+
"ktlint_standard_property-naming" to "disabled",
122+
"ktlint_standard_function-naming" to "disabled"
119123
)
120124
)
121125
}

examples/android-chatter/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ android {
2424
packagingOptions {
2525
exclude 'META-INF/io.netty.versions.properties'
2626
exclude 'META-INF/INDEX.LIST'
27+
exclude 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
2728
}
2829
kotlinOptions {
2930
jvmTarget = "11"

examples/chatter/src/main/kotlin/io/libp2p/example/chat/ChatProtocol.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ typealias OnChatMessage = (PeerId, String) -> Unit
1919

2020
class Chat(chatCallback: OnChatMessage) : ChatBinding(ChatProtocol(chatCallback))
2121

22-
const val protocolId: ProtocolId = "/example/chat/0.1.0"
22+
const val PROTOCOL_ID: ProtocolId = "/example/chat/0.1.0"
2323

24-
open class ChatBinding(echo: ChatProtocol) : StrictProtocolBinding<ChatController>(protocolId, echo)
24+
open class ChatBinding(echo: ChatProtocol) : StrictProtocolBinding<ChatController>(PROTOCOL_ID, echo)
2525

2626
open class ChatProtocol(
2727
private val chatCallback: OnChatMessage

libp2p/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("com.google.protobuf").version("0.9.4")
3-
id("me.champeau.jmh").version("0.7.1")
3+
id("me.champeau.jmh").version("0.7.2")
44
}
55

66
// https://docs.gradle.org/current/userguide/java_testing.html#ex-disable-publishing-of-test-fixtures-variants

libp2p/src/main/kotlin/io/libp2p/core/multistream/NegotiatedProtocol.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.util.concurrent.CompletableFuture
66
/**
77
* Represents [ProtocolBinding] with exact protocol version which was agreed on
88
*/
9-
open class NegotiatedProtocol<TController, TBinding : ProtocolBinding<TController>> (
9+
open class NegotiatedProtocol<TController, TBinding : ProtocolBinding<TController>>(
1010
val binding: TBinding,
1111
val protocol: ProtocolId
1212
) {

libp2p/src/main/kotlin/io/libp2p/crypto/Libp2pCrypto.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import org.bouncycastle.crypto.macs.HMac
1919
import org.bouncycastle.crypto.params.KeyParameter
2020

2121
/**
22-
* ErrRsaKeyTooSmall is returned when trying to generate or parse an RSA key
22+
* ERR_RSA_KEY_TOO_SMALL is returned when trying to generate or parse an RSA key
2323
* that's smaller than 512 bits. Keys need to be larger enough to sign a 256bit
2424
* hash so this is a reasonable absolute minimum.
2525
*/
26-
const val ErrRsaKeyTooSmall = "rsa keys must be >= 512 bits to be useful"
26+
const val ERR_RSA_KEY_TOO_SMALL = "rsa keys must be >= 512 bits to be useful"
2727

2828
const val RSA_ALGORITHM = "RSA"
2929
const val SHA_ALGORITHM = "SHA-256"

libp2p/src/main/kotlin/io/libp2p/crypto/keys/Rsa.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import crypto.pb.Crypto
1616
import io.libp2p.core.Libp2pException
1717
import io.libp2p.core.crypto.PrivKey
1818
import io.libp2p.core.crypto.PubKey
19-
import io.libp2p.crypto.ErrRsaKeyTooSmall
19+
import io.libp2p.crypto.ERR_RSA_KEY_TOO_SMALL
2020
import io.libp2p.crypto.KEY_PKCS8
2121
import io.libp2p.crypto.Libp2pCrypto
2222
import io.libp2p.crypto.RSA_ALGORITHM
@@ -100,7 +100,7 @@ class RsaPublicKey(private val k: JavaPublicKey) : PubKey(Crypto.KeyType.RSA) {
100100
@JvmOverloads
101101
fun generateRsaKeyPair(bits: Int, random: SecureRandom = SecureRandom()): Pair<PrivKey, PubKey> {
102102
if (bits < 2048) {
103-
throw Libp2pException(ErrRsaKeyTooSmall)
103+
throw Libp2pException(ERR_RSA_KEY_TOO_SMALL)
104104
}
105105

106106
val kp: KeyPair = with(

libp2p/src/main/kotlin/io/libp2p/etc/util/netty/AbstractChildChannel.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import java.net.SocketAddress
2020
*/
2121
abstract class AbstractChildChannel(parent: Channel, id: ChannelId?) : AbstractChannel(parent, id) {
2222
private enum class State {
23-
OPEN, ACTIVE, INACTIVE, CLOSED
23+
OPEN,
24+
ACTIVE,
25+
INACTIVE,
26+
CLOSED
2427
}
2528

2629
private val parentCloseFuture = parent.closeFuture()

libp2p/src/main/kotlin/io/libp2p/pubsub/SeenCache.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class SimpleSeenCache<TValue> : SeenCache<TValue> {
5151
override fun put(msg: PubsubMessage, value: TValue) {
5252
map[msg.messageId] = value
5353
}
54-
override fun remove(messageId: MessageId) { map -= messageId }
54+
override fun remove(messageId: MessageId) {
55+
map -= messageId
56+
}
5557
}
5658

5759
class LRUSeenCache<TValue>(val delegate: SeenCache<TValue>, private val maxSize: Int) : SeenCache<TValue> by delegate {

libp2p/src/main/kotlin/io/libp2p/transport/implementation/ConnectionOverNetty.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ open class ConnectionOverNetty(
3030
ch.attr(CONNECTION).set(this)
3131
}
3232

33-
fun setMuxerSession(ms: StreamMuxer.Session) { muxerSession = ms }
34-
fun setSecureSession(ss: SecureChannel.Session) { secureSession = ss }
33+
fun setMuxerSession(ms: StreamMuxer.Session) {
34+
muxerSession = ms
35+
}
36+
fun setSecureSession(ss: SecureChannel.Session) {
37+
secureSession = ss
38+
}
3539

3640
override fun muxerSession() = muxerSession
3741
override fun secureSession() = secureSession

0 commit comments

Comments
 (0)