Skip to content

Instantly share code, notes, and snippets.

Created July 13, 2017 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/24dec1251821ff089ad4a6c7e542a3a5 to your computer and use it in GitHub Desktop.
Save anonymous/24dec1251821ff089ad4a6c7e542a3a5 to your computer and use it in GitHub Desktop.
the description for this gist
@free trait LoginDatabase {
def insertCredentialsUser(e: UserEmail, p: PasswordHash): FS[Attempt[UserId]]
def insertGitHubUser(d: GitHubData): FS[Attempt[UserId]]
def queryByLoginEmail(e: UserEmail): FS[Option[(UserId, PasswordHash)]]
def queryByGitHubId(id: GitHubId): FS[Option[UserId]]
}
@free trait GitHubClient {
def login(code: String): FS[GitHubDataResponse]
}
@free trait Log {
def info(msg: String): FS[Unit]
def warn(msg: String): FS[Unit]
def warnWithCause(msg: String, cause: Throwable): FS[Unit]
}
@free trait JwtService {
def issue(id: UserId): FS[JWT]
def validate(jwt: JWT): FS[Option[Claims]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment