Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add newtype Seconds to new Lib.Time module and refactor functions that need it so far issue #26 * Amend CI test problems issue #26 * Implement pattern matching in Lib.Core.Jwt.hs issue #26 * Refactor JwtSpec and PasswordSpec issue #26 * Remove JwtSpec.hs temporarily issue #26 * Add JwtSpec.hs back issue #26 * Add ekg issue #26 * Polish JwtSpec and Password issue #26 * Moving of import to hackage dependencies section issue #26 * Re-commit to get CI tests to work issue #26 * Add Date data type to protobuf issue #26 * Add Proto.Login_Fields to package.yaml issue #26 * Implement requested changes with Core.Jwt.hs, Time.hs and app.Main.hs files issue #26 * Amend requested changes issue #26 * Fix CI test errors - Amend requested changes issue #26 * Minor issue fix - Amend requested changes issue #26 * Amend CI tests on minor issue fix - Amend requested changes issue #26 * Move JwtToken ElmType instance to Lib.Core.Jwt.hs file issue #26
- Loading branch information
Showing
15 changed files
with
184 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module Main where | ||
|
||
import Lib | ||
import qualified Lib | ||
|
||
main :: IO () | ||
main = mkAppEnv >>= runServer | ||
main = Lib.main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
syntax = "proto2"; | ||
|
||
message Date { | ||
// Year of date. Must be from 1 to 9999, or 0 if specifying a date without | ||
// a year. | ||
required int32 year = 1; | ||
|
||
// Month of year. Must be from 1 to 12. | ||
required int32 month = 2; | ||
|
||
// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 | ||
// if specifying a year/month where the day is not significant. | ||
required int32 day = 3; | ||
} | ||
|
||
message Timestamp { | ||
// Represents the seconds elapsed in the day since 00:00 | ||
required int64 seconds = 1; | ||
// Number of nanoseconds elapsed that second | ||
required int32 nanos = 2 [default = 0]; | ||
} | ||
|
||
message Datetime { | ||
required Date date = 1; | ||
required Timestamp timestamp = 2; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
module Lib.App.Env | ||
( AppEnv (..) | ||
, JwtSecret (..) | ||
, Session (..) | ||
) where | ||
|
||
import Data.Pool (Pool) | ||
import Data.UUID.Types (UUID) | ||
import Database.PostgreSQL.Simple (Connection) | ||
|
||
import System.Metrics (Store) | ||
import System.Metrics.Distribution (Distribution) | ||
|
||
data AppEnv = AppEnv | ||
{ dbPool :: Pool Connection | ||
, sessions :: MVar (HashMap UUID Session) | ||
, jwtSecret :: Text | ||
, jwtSecret :: JwtSecret | ||
, timings :: IORef (HashMap Text Distribution) | ||
, ekgStore :: Store | ||
} | ||
|
||
newtype Session = Session { | ||
isLoggedIn :: Bool | ||
} | ||
|
||
newtype JwtSecret = JwtSecret { | ||
unJwtSecret :: Text | ||
} |
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.