Initial Commit

This commit is contained in:
digimint 2024-06-19 20:55:25 -05:00
commit d190beb7bf
Signed by: digimint
GPG key ID: 8DF1C6FD85ABF748
13 changed files with 382 additions and 0 deletions

View file

@ -0,0 +1,25 @@
package unit_ca5.twitch
import java.time.Instant
import unit_ca5.twitch.TokenScope
type TwitchUID = String
type AccessToken = String
type RefreshToken = String
case class UserAuthenticationCredential(
userId: TwitchUID,
accessToken: AccessToken,
refreshToken: RefreshToken,
expires: Instant,
scopes: List[TokenScope]
):
def is_expired(now: Instant): Boolean =
now.isAfter(expires)
def supports(scope: TokenScope): Boolean =
scopes.contains(scope)
def supportsAll(scopeList: List[TokenScope]): Boolean =