-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What's done: * Changed `/demo/api` -> `/api/demo` * Changed `/cpg/api` -> `/api/cpg` * Changed `/sandbox/api` -> `/api/sandbox` * Changed `/demo/internal` -> `/internal/demo` * Changed `/sandbox/internal` -> `/internal/sandbox` * Added BackendRoutes in order to forbid some high-level url path segments e.g. `api`, `sec`, `grafana` etc. * Reworked `App` to be `FC`
- Loading branch information
1 parent
af56acc
commit dd1d895
Showing
22 changed files
with
267 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
save-cloud-common/src/commonMain/kotlin/com/saveourtool/save/validation/BackendRoutes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Names that are used as endpoints in the frontend. | ||
* If you create a new view with new URL - add it here. | ||
*/ | ||
|
||
package com.saveourtool.save.validation | ||
|
||
import com.saveourtool.save.utils.URL_PATH_DELIMITER | ||
import kotlin.js.JsExport | ||
|
||
/** | ||
* It is required to forbid creating organizations and users with such names | ||
* | ||
* @property path substring of url that defines given route | ||
*/ | ||
@JsExport | ||
@Suppress("unused", "WRONG_DECLARATIONS_ORDER") | ||
enum class BackendRoutes(val path: String) { | ||
API("api"), | ||
INTERNAL("internal"), | ||
ACTUATOR("actuator"), | ||
GRAFANA("grafana"), | ||
ERROR("error"), | ||
LOGIN("login"), | ||
LOGOUT("logout"), | ||
SEC("sec"), | ||
NEO4J("neo4j"), | ||
; | ||
|
||
override fun toString(): String = path | ||
|
||
companion object { | ||
/** | ||
* Get forbidden words from [BackendRoutes]. | ||
* | ||
* @return list of forbidden words | ||
*/ | ||
fun getForbiddenWords() = BackendRoutes.values() | ||
.map { it.path.split(URL_PATH_DELIMITER) } | ||
.flatten() | ||
.toTypedArray() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.