-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Manuel Leduc
committed
May 4, 2016
1 parent
68a6f65
commit 2a754f3
Showing
5 changed files
with
62 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
module Kreg.Options.Whoami (whoami) where | ||
|
||
import qualified Kreg.TokenFileManager as TMF (read) | ||
import qualified Registry.Client as C (whoami) | ||
|
||
{- | ||
uri : /api/account | ||
prerequisites : | ||
* token stored in ~/.kregrch | ||
-} | ||
whoami :: IO () | ||
whoami = undefined | ||
whoami = do | ||
token <- TMF.read | ||
res <- C.whoami token | ||
putStrLn (show res) | ||
|
||
|
||
-- TODO : JWT libs too young to works on jhipster particular configuration. We'll need to query the json api to have more details. |
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,19 @@ | ||
module Kreg.TokenFileManager (save, Kreg.TokenFileManager.read) where | ||
|
||
import System.FilePath.Posix ((</>)) | ||
import System.Directory (getHomeDirectory) | ||
import qualified Registry.Client as C | ||
|
||
filePath = do | ||
homeDirectory <- getHomeDirectory | ||
return $ homeDirectory </> ".kregrch" | ||
|
||
--save :: String -> IO () | ||
save token = do | ||
fp <- filePath | ||
writeFile fp (C.id_token token) | ||
|
||
--read :: IO String | ||
read = do | ||
fp <- filePath | ||
readFile fp |
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 |
---|---|---|
|
@@ -21,6 +21,7 @@ library | |
, http-client | ||
, aeson | ||
, lens | ||
, bytestring | ||
default-language: Haskell2010 | ||
|
||
executable kreg-exe | ||
|
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