Skip to content

Commit a314ac8

Browse files
committed
chore: upgrade linter and style
1 parent b2aae63 commit a314ac8

File tree

11 files changed

+18
-11
lines changed

11 files changed

+18
-11
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
val kotlinVersion = "1.9.23"
99
kotlin("jvm") version kotlinVersion
1010
id("com.diffplug.spotless") version "6.25.0"
11-
id("org.springframework.boot") version "3.3.6" apply false
11+
id("org.springframework.boot") version "3.4.0" apply false
1212
id("io.gitlab.arturbosch.detekt") version "1.23.7"
1313
id("pl.allegro.tech.build.axion-release") version "1.15.5"
1414
id("org.jetbrains.kotlinx.kover") version "0.7.6"
@@ -84,12 +84,12 @@ configure<SpotlessExtension> {
8484
licenseHeader(licenseHeaderComment)
8585
}
8686
kotlin {
87-
ktfmt("0.41")
87+
ktfmt("0.50")
8888
target("**/*.kt")
8989
licenseHeader(licenseHeaderComment)
9090
}
9191
kotlinGradle {
92-
ktfmt("0.41")
92+
ktfmt("0.50")
9393
target("**/*.kts")
9494
// licenseHeader(licenseHeaderComment, "import")
9595
}

src/main/kotlin/com/cosmotech/api/config/CsmApiConfiguration.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ open class CsmApiConfiguration {
4545
@Order(Ordered.HIGHEST_PRECEDENCE)
4646
open class CsmPlatformEnvironmentPostProcessor : EnvironmentPostProcessor {
4747
private val log = DeferredLog()
48+
4849
override fun postProcessEnvironment(
4950
environment: ConfigurableEnvironment,
5051
application: SpringApplication

src/main/kotlin/com/cosmotech/api/config/CsmPlatformProperties.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ data class CsmPlatformProperties(
114114
) {
115115
data class CsmStorageUser(val username: String, val password: String)
116116
}
117+
117118
data class CsmEventBus(
118119
/** Define if current API use event bus within internal result data service or not */
119120
val enabled: Boolean = true,
@@ -236,6 +237,7 @@ data class CsmPlatformProperties(
236237
/** Base Loki url */
237238
val baseUrl: String = "http://loki.default.svc.cluster.local:3100",
238239
)
240+
239241
data class Argo(
240242
/** Argo service base Uri */
241243
val baseUri: String,

src/main/kotlin/com/cosmotech/api/rbac/CsmRbac.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ open class CsmRbac(
244244
internal fun getUserRole(rbacSecurity: RbacSecurity, user: String): String {
245245
return rbacSecurity.accessControlList
246246
.firstOrNull { it.id.lowercase() == user.lowercase() }
247-
?.role
248-
?: rbacSecurity.default
247+
?.role ?: rbacSecurity.default
249248
}
250249

251250
internal fun getAdminCount(rbacSecurity: RbacSecurity, rolesDefinition: RolesDefinition): Int {

src/main/kotlin/com/cosmotech/api/security/filters/ApiKeyAuthenticationFilter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class ApiKeyAuthentication(
112112
init {
113113
this.isAuthenticated = true
114114
}
115+
115116
override fun getCredentials(): Any? {
116117
return null
117118
}

src/main/kotlin/com/cosmotech/api/security/keycloak/KeycloakSecurityConfiguration.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class KeycloakJwtGrantedAuthoritiesConverter(
146146
) : Converter<Jwt, Collection<GrantedAuthority>> {
147147

148148
private val logger = LoggerFactory.getLogger(KeycloakJwtGrantedAuthoritiesConverter::class.java)
149+
149150
override fun convert(jwt: Jwt): Collection<GrantedAuthority> {
150151
val extractAuthorities = mutableListOf<GrantedAuthority>()
151152
extractAuthorities.addAll(

src/main/kotlin/com/cosmotech/api/security/okta/OktaSecurityConfiguration.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class OktaJwtGrantedAuthoritiesConverter(private val csmPlatformProperties: CsmP
141141
Converter<Jwt, Collection<GrantedAuthority>> {
142142

143143
private val logger = LoggerFactory.getLogger(OktaJwtGrantedAuthoritiesConverter::class.java)
144+
144145
override fun convert(jwt: Jwt): Collection<GrantedAuthority> {
145146
val extractAuthorities = mutableListOf<GrantedAuthority>()
146147
extractAuthorities.addAll(

src/main/kotlin/com/cosmotech/api/utils/AnyExtensions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ fun <T> T.convertToMap(): Map<String, Any> =
4141
* @param new the new object against which comparison is performed
4242
* @param mutateIfChanged whether to mutate the current object if for fields that have changed
4343
* @param excludedFields an array of fields to exlude from comparison. Note that fields named 'id´
44-
* are automatically excluded, by convention.
44+
* are automatically excluded, by convention.
4545
* @throws UnsupportedOperationException if the object being compared are not instances of a data
46-
* class
46+
* class
4747
* @throws IllegalArgumentException if changes were detected and {@code mutateIfChanged = true}, but
48-
* the field is not mutable
48+
* the field is not mutable
4949
*/
5050
@Suppress("NestedBlockDepth")
5151
inline fun <reified T> T.compareToAndMutateIfNeeded(

src/main/kotlin/com/cosmotech/api/utils/SecurityUtils.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fun getCurrentAuthenticatedUserName(configuration: CsmPlatformProperties): Strin
2626
val jwtClaimsSet = JWTParser.parse(it).jwtClaimsSet
2727
jwtClaimsSet.getStringClaim(configuration.authorization.principalJwtClaim)
2828
?: jwtClaimsSet.getStringClaim(configuration.authorization.applicationIdJwtClaim)
29-
?: throw IllegalStateException("User Authentication not found in Security Context")
29+
?: throw IllegalStateException("User Authentication not found in Security Context")
3030
} catch (e: ParseException) {
3131
JSONObjectUtils.parse(it)[configuration.authorization.principalJwtClaim] as String
3232
}
@@ -63,8 +63,7 @@ fun getCurrentAuthenticatedRoles(configuration: CsmPlatformProperties): List<Str
6363
} catch (e: ParseException) {
6464
JSONObjectUtils.parse(it)[configuration.authorization.rolesJwtClaim] as List<String>
6565
}
66-
}
67-
?: emptyList())
66+
} ?: emptyList())
6867
}
6968

7069
fun <T> getValueFromAuthenticatedToken(

src/main/kotlin/com/cosmotech/api/utils/StringExtensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fun String.formatQuery(map: Map<String, String>): String {
5858

5959
/**
6060
* Extract the file name from a path for example: /path/to/file.txt -> file
61+
*
6162
* @return the file name without the extension
6263
*/
6364
fun String.extractFileNameFromPath(): String {

0 commit comments

Comments
 (0)