Skip to content

Commit

Permalink
Merge pull request #45 from OSGP/dependabot/gradle/com.diffplug.spotl…
Browse files Browse the repository at this point in the history
…ess-7.0.2

Bump com.diffplug.spotless from 6.25.0 to 7.0.2
  • Loading branch information
loesimmens authored Feb 17, 2025
2 parents 91b0823 + bcd3b61 commit 9a2ce59
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subprojects {
extensions.configure<SpotlessExtension> {
kotlin {
// by default the target is every '.kt' and '.kts' file in the java source sets
ktfmt().dropboxStyle().configure {
ktfmt().kotlinlangStyle().configure {
it.setMaxWidth(120)
}
licenseHeaderFile(
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mockitoKotlin = "5.4.0"
mockServer = "5.15.0"
msal4j = "1.17.2"
sonarqube = "6.0.1.5171"
spotless = "6.25.0"
spotless = "7.0.2"

[libraries]
assertJ = { group = "org.assertj", name = "assertj-core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class OAuthAuthenticateCallbackHandler : AuthenticateCallbackHandler {
override fun configure(
configs: Map<String?, *>?,
saslMechanism: String,
jaasConfigEntries: List<AppConfigurationEntry>
jaasConfigEntries: List<AppConfigurationEntry>,
) {
getOptions(saslMechanism, jaasConfigEntries).let { setFields(it) }
}
Expand Down Expand Up @@ -101,7 +101,8 @@ class OAuthAuthenticateCallbackHandler : AuthenticateCallbackHandler {
aadParameters.scopes(),
authResult.expiresOnDate().toInstant().toEpochMilli(),
aadClient.clientId(),
System.currentTimeMillis())
System.currentTimeMillis(),
)
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw KafkaOAuthException("Retrieving JWT token was interrupted", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class OAuthAuthenticateCallbackHandlerTest {

val appConfig =
AppConfigurationEntry(
"org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule", REQUIRED, options())
"org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule",
REQUIRED,
options(),
)
handler.configure(emptyMap<String?, Any>(), OAuthBearerLoginModule.OAUTHBEARER_MECHANISM, listOf(appConfig))

assertEquals(clientId, handler.clientId)
Expand Down Expand Up @@ -69,5 +72,6 @@ class OAuthAuthenticateCallbackHandlerTest {
CLIENT_ID_CONFIG to clientId,
TOKEN_ENDPOINT_CONFIG to tokenEndpoint,
SCOPE_CONFIG to scopes,
TOKEN_FILE_CONFIG to tokenFilePath)
TOKEN_FILE_CONFIG to tokenFilePath,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ class MessageSigner(properties: MessageSigningProperties) {
this.keyAlgorithm,
this.signatureProvider,
this.canSignMessages(),
this.canVerifyMessageSignatures())
this.canVerifyMessageSignatures(),
)
}

companion object {
Expand All @@ -299,7 +300,7 @@ class MessageSigner(properties: MessageSigningProperties) {
private fun signatureInstance(
signatureAlgorithm: String,
signatureProvider: String?,
signingKey: PrivateKey
signingKey: PrivateKey,
): Signature {
val signature = signatureInstance(signatureAlgorithm, signatureProvider)
try {
Expand All @@ -314,7 +315,7 @@ class MessageSigner(properties: MessageSigningProperties) {
private fun signatureInstance(
signatureAlgorithm: String,
signatureProvider: String?,
verificationKey: PublicKey
verificationKey: PublicKey,
): Signature {
val signature = signatureInstance(signatureAlgorithm, signatureProvider)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ open class MessageSigningProperties(
/** PEM file containing the private key */
var privateKeyFile: Resource? = null,
/** PEM file containing the public key */
var publicKeyFile: Resource? = null
var publicKeyFile: Resource? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class MessageSignerTest {
signatureProvider = "SunRsaSign",
keyAlgorithm = "RSA",
privateKeyFile = ClassPathResource("/rsa-private.pem"),
publicKeyFile = ClassPathResource("/rsa-public.pem"))
publicKeyFile = ClassPathResource("/rsa-public.pem"),
)

private val messageSigner = MessageSigner(messageSignerProperties)

Expand Down Expand Up @@ -213,7 +214,8 @@ class MessageSignerTest {
override fun getSchema(): Schema {
return Schema.Parser()
.parse(
"""{"type":"record","name":"Message","namespace":"com.alliander.osgp.kafka.message.signing","fields":[{"name":"message","type":{"type":"string","avro.java.string":"String"}}]}""")
"""{"type":"record","name":"Message","namespace":"com.alliander.osgp.kafka.message.signing","fields":[{"name":"message","type":{"type":"string","avro.java.string":"String"}}]}"""
)
}

override fun get(field: Int): Any {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class OAuthClientConfig {
val credential: IClientCredential =
ClientCredentialFactory.createFromCertificate(
getPrivateKey(Objects.requireNonNull(clientData.privateKey)),
getCertificate(Objects.requireNonNull(clientData.certificate)))
getCertificate(Objects.requireNonNull(clientData.certificate)),
)
return try {
ConfidentialClientApplication.builder(clientData.clientId, credential)
.authority(clientData.tokenEndpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class OAuthClientProperties(
@Value("\${oauth.client.scope}") val scope: String,
@Value("\${oauth.client.token-endpoint}") val tokenEndpoint: String,
@Value("\${oauth.client.private-key}") val privateKey: Resource,
@Value("\${oauth.client.certificate}") val certificate: Resource
@Value("\${oauth.client.certificate}") val certificate: Resource,
)

0 comments on commit 9a2ce59

Please sign in to comment.