Skip to content

Commit

Permalink
Set cached token permissions to 600
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Jul 10, 2024
1 parent d6a111d commit 67ec89c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions meet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ library
tz >= 0.1.3 && < 0.2,
directory >= 1.3.8 && < 1.4,
filepath >= 1.4.200 && < 1.5,
unix >= 2.8.4 && < 2.9,

executable meet
main-is: Main.hs
Expand Down
2 changes: 2 additions & 0 deletions src/Azure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import System.Directory (XdgDirectory (..), createDirectoryIfMissing, doesFileEx
import System.Exit (ExitCode (..))
import System.FilePath (takeDirectory)
import System.Process (readProcessWithExitCode, spawnCommand)
import System.Posix.Files (setFileMode)

data Token = Token
{ accessToken :: Text,
Expand All @@ -56,6 +57,7 @@ serialiseToken token = do
fp <- getTokenJsonFilePath
createDirectoryIfMissing True (takeDirectory fp)
encodeFile fp token
setFileMode fp 0o600

deserialiseToken :: IO (Maybe Token)
deserialiseToken = do
Expand Down

0 comments on commit 67ec89c

Please sign in to comment.