whitelist some custom url schemes for bc

pull/9286/head
Niklas Fiekas 2021-06-28 19:08:38 +02:00
parent d51f39fe84
commit 25ac2e1138
2 changed files with 22 additions and 3 deletions

View File

@ -30,6 +30,8 @@ object LegacyClientApi {
override def toString = "ClientSecret(***)"
}
case object MismatchingClientSecret extends Protocol.Error.InvalidGrant("fix mismatching client secret (or update to pkce)")
case object ClientSecretRequired extends Protocol.Error.InvalidRequest("client_secret required (or update to pkce)")
case object MismatchingClientSecret
extends Protocol.Error.InvalidGrant("fix mismatching client secret (or update to pkce)")
case object ClientSecretRequired
extends Protocol.Error.InvalidRequest("client_secret required (or update to pkce)")
}

View File

@ -90,7 +90,24 @@ object Protocol {
.parseOption(redirectUri)
.toValid(Error.RedirectUriInvalid)
.ensure(Error.RedirectSchemeNotAllowed)(url =>
List("http", "https", "ionic", "capacitor").has(url.scheme)
List(
// standard
"http",
"https",
"ionic",
"capacitor",
// bc
"squareoffapp",
"anichess",
"lichessmac",
"chessrtx",
"chesscomopse",
// whitelist (consider automating)
"no.rieck.chess.dgt",
"net.developerfluid.darkknight",
"com.guykn.chessboard3",
"com.georgdotorg.catur"
).has(url.scheme)
)
.map(RedirectUri.apply)