-
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.
Add top level APIs for fetching secrets
- Loading branch information
1 parent
8042284
commit 87247c5
Showing
3 changed files
with
75 additions
and
29 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Azure.Secret.Types | ||
( KeyVaultResponse (..) | ||
, SecretName (..) | ||
, KeyVaultHost (..) | ||
) where | ||
|
||
import Data.Aeson (FromJSON (..), withObject, (.:)) | ||
import Data.Text (Text) | ||
import GHC.Generics (Generic) | ||
|
||
newtype KeyVaultResponse = KeyVaultResponse | ||
{ unKeyValueReponse :: Text | ||
} | ||
deriving stock (Eq, Show, Generic) | ||
|
||
instance FromJSON KeyVaultResponse where | ||
parseJSON = withObject "KeyVaultResponse" $ \o -> do | ||
unKeyValueReponse <- o .: "value" | ||
pure KeyVaultResponse{..} | ||
|
||
newtype SecretName = SecretName {unSecretName :: Text} deriving stock (Eq, Show) | ||
|
||
newtype KeyVaultHost = KeyVaultHost {unKeyVaultHost :: Text} deriving stock (Eq, Show) |
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