mirror of
https://github.com/revanced/revanced-api.git
synced 2025-05-02 15:44:33 +02:00
refactor: Lint & code cleanup
This commit is contained in:
parent
39f54bbb32
commit
0904390481
@ -1,12 +1,12 @@
|
|||||||
package app.revanced.api.command
|
package app.revanced.api.command
|
||||||
|
|
||||||
import app.revanced.api.configuration.*
|
import app.revanced.api.configuration.configureDependencies
|
||||||
|
import app.revanced.api.configuration.configureHTTP
|
||||||
|
import app.revanced.api.configuration.configureSecurity
|
||||||
|
import app.revanced.api.configuration.configureSerialization
|
||||||
import app.revanced.api.configuration.routing.configureRouting
|
import app.revanced.api.configuration.routing.configureRouting
|
||||||
import io.ktor.server.application.*
|
|
||||||
import io.ktor.server.engine.*
|
import io.ktor.server.engine.*
|
||||||
import io.ktor.server.netty.*
|
import io.ktor.server.netty.*
|
||||||
import io.ktor.server.response.*
|
|
||||||
import io.ktor.server.routing.*
|
|
||||||
import picocli.CommandLine
|
import picocli.CommandLine
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
|
@ -28,10 +28,12 @@ internal class OldApiService(private val client: HttpClient) {
|
|||||||
!key.equals(
|
!key.equals(
|
||||||
HttpHeaders.ContentType,
|
HttpHeaders.ContentType,
|
||||||
ignoreCase = true,
|
ignoreCase = true,
|
||||||
) && !key.equals(
|
) &&
|
||||||
HttpHeaders.ContentLength,
|
!key.equals(
|
||||||
ignoreCase = true,
|
HttpHeaders.ContentLength,
|
||||||
) && !key.equals(HttpHeaders.Host, ignoreCase = true)
|
ignoreCase = true,
|
||||||
|
) &&
|
||||||
|
!key.equals(HttpHeaders.Host, ignoreCase = true)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -51,7 +53,8 @@ internal class OldApiService(private val client: HttpClient) {
|
|||||||
!key.equals(
|
!key.equals(
|
||||||
HttpHeaders.ContentType,
|
HttpHeaders.ContentType,
|
||||||
ignoreCase = true,
|
ignoreCase = true,
|
||||||
) && !key.equals(HttpHeaders.ContentLength, ignoreCase = true)
|
) &&
|
||||||
|
!key.equals(HttpHeaders.ContentLength, ignoreCase = true)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,8 @@ internal class AuthService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun newToken(): String {
|
fun newToken(): String = JWT.create()
|
||||||
return JWT.create()
|
.withIssuer(issuer)
|
||||||
.withIssuer(issuer)
|
.withExpiresAt(Date(System.currentTimeMillis() + validityInMin.minutes.inWholeMilliseconds))
|
||||||
.withExpiresAt(Date(System.currentTimeMillis() + validityInMin.minutes.inWholeMilliseconds))
|
.sign(Algorithm.HMAC256(jwtSecret))
|
||||||
.sign(Algorithm.HMAC256(jwtSecret))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user