Skip to content

Commit eca40a6

Browse files
committed
feat: Remove deprecated routes and old API
Backwards compatibility should be and is now handled by the reverse proxy.
1 parent 0b66fc2 commit eca40a6

File tree

9 files changed

+12
-141
lines changed

9 files changed

+12
-141
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Some of the features ReVanced API include:
8181
and links of the hoster of ReVanced API
8282
- 🧩 **Patches**: Get the latest updates of ReVanced Patches, directly from ReVanced API
8383
- 👥 **Contributors**: List all contributors involved in the project
84-
- 🔄 **Backwards compatibility**: Proxy an old API for migration purposes and backwards compatibility
8584

8685
## 🚀 How to get started
8786

configuration.example.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ cors-allowed-hosts = [
44
"*.revanced.app"
55
]
66
endpoint = "https://api.revanced.app"
7-
old-api-endpoint = "https://old-api.revanced.app"
87
static-files-path = "static/root"
98
versioned-static-files-path = "static/versioned"
109
backend-service-name = "GitHub"

src/main/kotlin/app/revanced/api/configuration/Dependencies.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ fun Application.configureDependencies(
5151

5252
AuthenticationService(issuer, validityInMin, jwtSecret, authSHA256DigestString)
5353
}
54-
singleOf(::OldApiService)
5554
singleOf(::AnnouncementService)
5655
singleOf(::SignatureService)
5756
singleOf(::PatchesService)

src/main/kotlin/app/revanced/api/configuration/Routing.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import app.revanced.api.configuration.repository.ConfigurationRepository
44
import app.revanced.api.configuration.routes.*
55
import app.revanced.api.configuration.routes.announcementsRoute
66
import app.revanced.api.configuration.routes.apiRoute
7-
import app.revanced.api.configuration.routes.oldApiRoute
87
import app.revanced.api.configuration.routes.patchesRoute
98
import io.bkbn.kompendium.core.routes.redoc
109
import io.bkbn.kompendium.core.routes.swagger
@@ -55,7 +54,4 @@ internal fun Application.configureRouting() = routing {
5554

5655
swagger(pageTitle = "ReVanced API", path = "/")
5756
redoc(pageTitle = "ReVanced API", path = "/redoc")
58-
59-
// TODO: Remove, once migration period from v2 API is over (In 1-2 years).
60-
oldApiRoute()
6157
}

src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import kotlin.io.path.createDirectories
3030
* @property apiVersion The version to use for the API.
3131
* @property corsAllowedHosts The hosts allowed to make requests to the API.
3232
* @property endpoint The endpoint of the API.
33-
* @property oldApiEndpoint The endpoint of the old API to proxy requests to.
3433
* @property staticFilesPath The path to the static files to be served under the root path.
3534
* @property versionedStaticFilesPath The path to the static files to be served under a versioned path.
3635
* @property about The path to the json file deserialized to [APIAbout]
@@ -50,8 +49,6 @@ internal class ConfigurationRepository(
5049
@SerialName("cors-allowed-hosts")
5150
val corsAllowedHosts: Set<String>,
5251
val endpoint: String,
53-
@SerialName("old-api-endpoint")
54-
val oldApiEndpoint: String,
5552
@Serializable(with = PathSerializer::class)
5653
@SerialName("static-files-path")
5754
val staticFilesPath: Path,

src/main/kotlin/app/revanced/api/configuration/routes/ManagerRoute.kt

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,17 @@ import io.ktor.server.routing.*
1313
import org.koin.ktor.ext.get as koinGet
1414

1515
internal fun Route.managerRoute() = route("manager") {
16-
configure()
17-
18-
// TODO: Remove this deprecated route eventually.
19-
route("latest") {
20-
configure(deprecated = true)
21-
}
22-
}
23-
24-
private fun Route.configure(deprecated: Boolean = false) {
2516
val managerService = koinGet<ManagerService>()
2617

27-
installManagerRouteDocumentation(deprecated)
18+
installManagerRouteDocumentation()
2819

2920
rateLimit(RateLimitName("weak")) {
3021
get {
3122
call.respond(managerService.latestRelease())
3223
}
3324

3425
route("version") {
35-
installManagerVersionRouteDocumentation(deprecated)
26+
installManagerVersionRouteDocumentation()
3627

3728
get {
3829
call.respond(managerService.latestVersion())
@@ -41,11 +32,10 @@ private fun Route.configure(deprecated: Boolean = false) {
4132
}
4233
}
4334

44-
private fun Route.installManagerRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
35+
private fun Route.installManagerRouteDocumentation() = installNotarizedRoute {
4536
tags = setOf("Manager")
4637

4738
get = GetInfo.builder {
48-
if (deprecated) isDeprecated()
4939
description("Get the current manager release")
5040
summary("Get current manager release")
5141
response {
@@ -57,11 +47,10 @@ private fun Route.installManagerRouteDocumentation(deprecated: Boolean) = instal
5747
}
5848
}
5949

60-
private fun Route.installManagerVersionRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
50+
private fun Route.installManagerVersionRouteDocumentation() = installNotarizedRoute {
6151
tags = setOf("Manager")
6252

6353
get = GetInfo.builder {
64-
if (deprecated) isDeprecated()
6554
description("Get the current manager release version")
6655
summary("Get current manager release version")
6756
response {

src/main/kotlin/app/revanced/api/configuration/routes/OldApi.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/main/kotlin/app/revanced/api/configuration/routes/PatchesRoute.kt

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,17 @@ import kotlin.time.Duration.Companion.days
1616
import org.koin.ktor.ext.get as koinGet
1717

1818
internal fun Route.patchesRoute() = route("patches") {
19-
configure()
20-
21-
// TODO: Remove this deprecated route eventually.
22-
route("latest") {
23-
configure(deprecated = true)
24-
}
25-
}
26-
27-
private fun Route.configure(deprecated: Boolean = false) {
2819
val patchesService = koinGet<PatchesService>()
2920

30-
installPatchesRouteDocumentation(deprecated)
21+
installPatchesRouteDocumentation()
3122

3223
rateLimit(RateLimitName("weak")) {
3324
get {
3425
call.respond(patchesService.latestRelease())
3526
}
3627

3728
route("version") {
38-
installPatchesVersionRouteDocumentation(deprecated)
29+
installPatchesVersionRouteDocumentation()
3930

4031
get {
4132
call.respond(patchesService.latestVersion())
@@ -45,7 +36,7 @@ private fun Route.configure(deprecated: Boolean = false) {
4536

4637
rateLimit(RateLimitName("strong")) {
4738
route("list") {
48-
installPatchesListRouteDocumentation(deprecated)
39+
installPatchesListRouteDocumentation()
4940

5041
get {
5142
call.respondBytes(ContentType.Application.Json) { patchesService.list() }
@@ -57,7 +48,7 @@ private fun Route.configure(deprecated: Boolean = false) {
5748
route("keys") {
5849
installCache(356.days)
5950

60-
installPatchesPublicKeyRouteDocumentation(deprecated)
51+
installPatchesPublicKeyRouteDocumentation()
6152

6253
get {
6354
call.respond(patchesService.publicKey())
@@ -66,11 +57,10 @@ private fun Route.configure(deprecated: Boolean = false) {
6657
}
6758
}
6859

69-
private fun Route.installPatchesRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
60+
private fun Route.installPatchesRouteDocumentation() = installNotarizedRoute {
7061
tags = setOf("Patches")
7162

7263
get = GetInfo.builder {
73-
if (deprecated) isDeprecated()
7464
description("Get the current patches release")
7565
summary("Get current patches release")
7666
response {
@@ -82,11 +72,10 @@ private fun Route.installPatchesRouteDocumentation(deprecated: Boolean) = instal
8272
}
8373
}
8474

85-
private fun Route.installPatchesVersionRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
75+
private fun Route.installPatchesVersionRouteDocumentation() = installNotarizedRoute {
8676
tags = setOf("Patches")
8777

8878
get = GetInfo.builder {
89-
if (deprecated) isDeprecated()
9079
description("Get the current patches release version")
9180
summary("Get current patches release version")
9281
response {
@@ -98,11 +87,10 @@ private fun Route.installPatchesVersionRouteDocumentation(deprecated: Boolean) =
9887
}
9988
}
10089

101-
private fun Route.installPatchesListRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
90+
private fun Route.installPatchesListRouteDocumentation() = installNotarizedRoute {
10291
tags = setOf("Patches")
10392

10493
get = GetInfo.builder {
105-
if (deprecated) isDeprecated()
10694
description("Get the list of patches from the current patches release")
10795
summary("Get list of patches from current patches release")
10896
response {
@@ -114,11 +102,10 @@ private fun Route.installPatchesListRouteDocumentation(deprecated: Boolean) = in
114102
}
115103
}
116104

117-
private fun Route.installPatchesPublicKeyRouteDocumentation(deprecated: Boolean) = installNotarizedRoute {
105+
private fun Route.installPatchesPublicKeyRouteDocumentation() = installNotarizedRoute {
118106
tags = setOf("Patches")
119107

120108
get = GetInfo.builder {
121-
if (deprecated) isDeprecated()
122109
description("Get the public keys for verifying patches assets")
123110
summary("Get patches public keys")
124111
response {

src/main/kotlin/app/revanced/api/configuration/services/OldApiService.kt

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)