{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EKS.Types.OidcIdentityProviderConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EKS.Types.OidcIdentityProviderConfig where

import qualified Amazonka.Core as Core
import Amazonka.EKS.Types.ConfigStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that represents the configuration for an OpenID Connect (OIDC)
-- identity provider.
--
-- /See:/ 'newOidcIdentityProviderConfig' smart constructor.
data OidcIdentityProviderConfig = OidcIdentityProviderConfig'
  { -- | The prefix that is prepended to group claims to prevent clashes with
    -- existing names (such as @system:@ groups). For example, the
    -- value@ oidc:@ creates group names like @oidc:engineering@ and
    -- @oidc:infra@. The prefix can\'t contain @system:@
    OidcIdentityProviderConfig -> Maybe Text
groupsPrefix :: Prelude.Maybe Prelude.Text,
    -- | The JSON Web token (JWT) claim that is used as the username.
    OidcIdentityProviderConfig -> Maybe Text
usernameClaim :: Prelude.Maybe Prelude.Text,
    -- | This is also known as /audience/. The ID of the client application that
    -- makes authentication requests to the OIDC identity provider.
    OidcIdentityProviderConfig -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
    -- | The status of the OIDC identity provider.
    OidcIdentityProviderConfig -> Maybe ConfigStatus
status :: Prelude.Maybe ConfigStatus,
    -- | The name of the configuration.
    OidcIdentityProviderConfig -> Maybe Text
identityProviderConfigName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the configuration.
    OidcIdentityProviderConfig -> Maybe Text
identityProviderConfigArn :: Prelude.Maybe Prelude.Text,
    -- | The URL of the OIDC identity provider that allows the API server to
    -- discover public signing keys for verifying tokens.
    OidcIdentityProviderConfig -> Maybe Text
issuerUrl :: Prelude.Maybe Prelude.Text,
    -- | The key-value pairs that describe required claims in the identity token.
    -- If set, each claim is verified to be present in the token with a
    -- matching value.
    OidcIdentityProviderConfig -> Maybe (HashMap Text Text)
requiredClaims :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The prefix that is prepended to username claims to prevent clashes with
    -- existing names. The prefix can\'t contain @system:@
    OidcIdentityProviderConfig -> Maybe Text
usernamePrefix :: Prelude.Maybe Prelude.Text,
    -- | The JSON web token (JWT) claim that the provider uses to return your
    -- groups.
    OidcIdentityProviderConfig -> Maybe Text
groupsClaim :: Prelude.Maybe Prelude.Text,
    -- | The cluster that the configuration is associated to.
    OidcIdentityProviderConfig -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
    -- | The metadata to apply to the provider configuration to assist with
    -- categorization and organization. Each tag consists of a key and an
    -- optional value, both of which you defined.
    OidcIdentityProviderConfig -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool
(OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool)
-> (OidcIdentityProviderConfig
    -> OidcIdentityProviderConfig -> Bool)
-> Eq OidcIdentityProviderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool
$c/= :: OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool
== :: OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool
$c== :: OidcIdentityProviderConfig -> OidcIdentityProviderConfig -> Bool
Prelude.Eq, ReadPrec [OidcIdentityProviderConfig]
ReadPrec OidcIdentityProviderConfig
Int -> ReadS OidcIdentityProviderConfig
ReadS [OidcIdentityProviderConfig]
(Int -> ReadS OidcIdentityProviderConfig)
-> ReadS [OidcIdentityProviderConfig]
-> ReadPrec OidcIdentityProviderConfig
-> ReadPrec [OidcIdentityProviderConfig]
-> Read OidcIdentityProviderConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OidcIdentityProviderConfig]
$creadListPrec :: ReadPrec [OidcIdentityProviderConfig]
readPrec :: ReadPrec OidcIdentityProviderConfig
$creadPrec :: ReadPrec OidcIdentityProviderConfig
readList :: ReadS [OidcIdentityProviderConfig]
$creadList :: ReadS [OidcIdentityProviderConfig]
readsPrec :: Int -> ReadS OidcIdentityProviderConfig
$creadsPrec :: Int -> ReadS OidcIdentityProviderConfig
Prelude.Read, Int -> OidcIdentityProviderConfig -> ShowS
[OidcIdentityProviderConfig] -> ShowS
OidcIdentityProviderConfig -> String
(Int -> OidcIdentityProviderConfig -> ShowS)
-> (OidcIdentityProviderConfig -> String)
-> ([OidcIdentityProviderConfig] -> ShowS)
-> Show OidcIdentityProviderConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OidcIdentityProviderConfig] -> ShowS
$cshowList :: [OidcIdentityProviderConfig] -> ShowS
show :: OidcIdentityProviderConfig -> String
$cshow :: OidcIdentityProviderConfig -> String
showsPrec :: Int -> OidcIdentityProviderConfig -> ShowS
$cshowsPrec :: Int -> OidcIdentityProviderConfig -> ShowS
Prelude.Show, (forall x.
 OidcIdentityProviderConfig -> Rep OidcIdentityProviderConfig x)
-> (forall x.
    Rep OidcIdentityProviderConfig x -> OidcIdentityProviderConfig)
-> Generic OidcIdentityProviderConfig
forall x.
Rep OidcIdentityProviderConfig x -> OidcIdentityProviderConfig
forall x.
OidcIdentityProviderConfig -> Rep OidcIdentityProviderConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OidcIdentityProviderConfig x -> OidcIdentityProviderConfig
$cfrom :: forall x.
OidcIdentityProviderConfig -> Rep OidcIdentityProviderConfig x
Prelude.Generic)

-- |
-- Create a value of 'OidcIdentityProviderConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'groupsPrefix', 'oidcIdentityProviderConfig_groupsPrefix' - The prefix that is prepended to group claims to prevent clashes with
-- existing names (such as @system:@ groups). For example, the
-- value@ oidc:@ creates group names like @oidc:engineering@ and
-- @oidc:infra@. The prefix can\'t contain @system:@
--
-- 'usernameClaim', 'oidcIdentityProviderConfig_usernameClaim' - The JSON Web token (JWT) claim that is used as the username.
--
-- 'clientId', 'oidcIdentityProviderConfig_clientId' - This is also known as /audience/. The ID of the client application that
-- makes authentication requests to the OIDC identity provider.
--
-- 'status', 'oidcIdentityProviderConfig_status' - The status of the OIDC identity provider.
--
-- 'identityProviderConfigName', 'oidcIdentityProviderConfig_identityProviderConfigName' - The name of the configuration.
--
-- 'identityProviderConfigArn', 'oidcIdentityProviderConfig_identityProviderConfigArn' - The ARN of the configuration.
--
-- 'issuerUrl', 'oidcIdentityProviderConfig_issuerUrl' - The URL of the OIDC identity provider that allows the API server to
-- discover public signing keys for verifying tokens.
--
-- 'requiredClaims', 'oidcIdentityProviderConfig_requiredClaims' - The key-value pairs that describe required claims in the identity token.
-- If set, each claim is verified to be present in the token with a
-- matching value.
--
-- 'usernamePrefix', 'oidcIdentityProviderConfig_usernamePrefix' - The prefix that is prepended to username claims to prevent clashes with
-- existing names. The prefix can\'t contain @system:@
--
-- 'groupsClaim', 'oidcIdentityProviderConfig_groupsClaim' - The JSON web token (JWT) claim that the provider uses to return your
-- groups.
--
-- 'clusterName', 'oidcIdentityProviderConfig_clusterName' - The cluster that the configuration is associated to.
--
-- 'tags', 'oidcIdentityProviderConfig_tags' - The metadata to apply to the provider configuration to assist with
-- categorization and organization. Each tag consists of a key and an
-- optional value, both of which you defined.
newOidcIdentityProviderConfig ::
  OidcIdentityProviderConfig
newOidcIdentityProviderConfig :: OidcIdentityProviderConfig
newOidcIdentityProviderConfig =
  OidcIdentityProviderConfig' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConfigStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> OidcIdentityProviderConfig
OidcIdentityProviderConfig'
    { $sel:groupsPrefix:OidcIdentityProviderConfig' :: Maybe Text
groupsPrefix =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usernameClaim:OidcIdentityProviderConfig' :: Maybe Text
usernameClaim = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientId:OidcIdentityProviderConfig' :: Maybe Text
clientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:OidcIdentityProviderConfig' :: Maybe ConfigStatus
status = Maybe ConfigStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:identityProviderConfigName:OidcIdentityProviderConfig' :: Maybe Text
identityProviderConfigName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityProviderConfigArn:OidcIdentityProviderConfig' :: Maybe Text
identityProviderConfigArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:issuerUrl:OidcIdentityProviderConfig' :: Maybe Text
issuerUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requiredClaims:OidcIdentityProviderConfig' :: Maybe (HashMap Text Text)
requiredClaims = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:usernamePrefix:OidcIdentityProviderConfig' :: Maybe Text
usernamePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupsClaim:OidcIdentityProviderConfig' :: Maybe Text
groupsClaim = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:OidcIdentityProviderConfig' :: Maybe Text
clusterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:OidcIdentityProviderConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The prefix that is prepended to group claims to prevent clashes with
-- existing names (such as @system:@ groups). For example, the
-- value@ oidc:@ creates group names like @oidc:engineering@ and
-- @oidc:infra@. The prefix can\'t contain @system:@
oidcIdentityProviderConfig_groupsPrefix :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_groupsPrefix :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_groupsPrefix = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
groupsPrefix :: Maybe Text
$sel:groupsPrefix:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
groupsPrefix} -> Maybe Text
groupsPrefix) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:groupsPrefix:OidcIdentityProviderConfig' :: Maybe Text
groupsPrefix = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The JSON Web token (JWT) claim that is used as the username.
oidcIdentityProviderConfig_usernameClaim :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_usernameClaim :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_usernameClaim = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
usernameClaim :: Maybe Text
$sel:usernameClaim:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
usernameClaim} -> Maybe Text
usernameClaim) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:usernameClaim:OidcIdentityProviderConfig' :: Maybe Text
usernameClaim = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | This is also known as /audience/. The ID of the client application that
-- makes authentication requests to the OIDC identity provider.
oidcIdentityProviderConfig_clientId :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_clientId :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_clientId = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
clientId :: Maybe Text
$sel:clientId:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:clientId:OidcIdentityProviderConfig' :: Maybe Text
clientId = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The status of the OIDC identity provider.
oidcIdentityProviderConfig_status :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe ConfigStatus)
oidcIdentityProviderConfig_status :: (Maybe ConfigStatus -> f (Maybe ConfigStatus))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_status = (OidcIdentityProviderConfig -> Maybe ConfigStatus)
-> (OidcIdentityProviderConfig
    -> Maybe ConfigStatus -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe ConfigStatus)
     (Maybe ConfigStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe ConfigStatus
status :: Maybe ConfigStatus
$sel:status:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe ConfigStatus
status} -> Maybe ConfigStatus
status) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe ConfigStatus
a -> OidcIdentityProviderConfig
s {$sel:status:OidcIdentityProviderConfig' :: Maybe ConfigStatus
status = Maybe ConfigStatus
a} :: OidcIdentityProviderConfig)

-- | The name of the configuration.
oidcIdentityProviderConfig_identityProviderConfigName :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_identityProviderConfigName :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_identityProviderConfigName = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
identityProviderConfigName :: Maybe Text
$sel:identityProviderConfigName:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
identityProviderConfigName} -> Maybe Text
identityProviderConfigName) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:identityProviderConfigName:OidcIdentityProviderConfig' :: Maybe Text
identityProviderConfigName = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The ARN of the configuration.
oidcIdentityProviderConfig_identityProviderConfigArn :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_identityProviderConfigArn :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_identityProviderConfigArn = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
identityProviderConfigArn :: Maybe Text
$sel:identityProviderConfigArn:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
identityProviderConfigArn} -> Maybe Text
identityProviderConfigArn) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:identityProviderConfigArn:OidcIdentityProviderConfig' :: Maybe Text
identityProviderConfigArn = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The URL of the OIDC identity provider that allows the API server to
-- discover public signing keys for verifying tokens.
oidcIdentityProviderConfig_issuerUrl :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_issuerUrl :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_issuerUrl = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
issuerUrl :: Maybe Text
$sel:issuerUrl:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
issuerUrl} -> Maybe Text
issuerUrl) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:issuerUrl:OidcIdentityProviderConfig' :: Maybe Text
issuerUrl = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The key-value pairs that describe required claims in the identity token.
-- If set, each claim is verified to be present in the token with a
-- matching value.
oidcIdentityProviderConfig_requiredClaims :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
oidcIdentityProviderConfig_requiredClaims :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_requiredClaims = (OidcIdentityProviderConfig -> Maybe (HashMap Text Text))
-> (OidcIdentityProviderConfig
    -> Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe (HashMap Text Text)
requiredClaims :: Maybe (HashMap Text Text)
$sel:requiredClaims:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe (HashMap Text Text)
requiredClaims} -> Maybe (HashMap Text Text)
requiredClaims) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe (HashMap Text Text)
a -> OidcIdentityProviderConfig
s {$sel:requiredClaims:OidcIdentityProviderConfig' :: Maybe (HashMap Text Text)
requiredClaims = Maybe (HashMap Text Text)
a} :: OidcIdentityProviderConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OidcIdentityProviderConfig
-> f OidcIdentityProviderConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The prefix that is prepended to username claims to prevent clashes with
-- existing names. The prefix can\'t contain @system:@
oidcIdentityProviderConfig_usernamePrefix :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_usernamePrefix :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_usernamePrefix = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
usernamePrefix :: Maybe Text
$sel:usernamePrefix:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
usernamePrefix} -> Maybe Text
usernamePrefix) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:usernamePrefix:OidcIdentityProviderConfig' :: Maybe Text
usernamePrefix = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The JSON web token (JWT) claim that the provider uses to return your
-- groups.
oidcIdentityProviderConfig_groupsClaim :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_groupsClaim :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_groupsClaim = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
groupsClaim :: Maybe Text
$sel:groupsClaim:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
groupsClaim} -> Maybe Text
groupsClaim) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:groupsClaim:OidcIdentityProviderConfig' :: Maybe Text
groupsClaim = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The cluster that the configuration is associated to.
oidcIdentityProviderConfig_clusterName :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe Prelude.Text)
oidcIdentityProviderConfig_clusterName :: (Maybe Text -> f (Maybe Text))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_clusterName = (OidcIdentityProviderConfig -> Maybe Text)
-> (OidcIdentityProviderConfig
    -> Maybe Text -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe Text
clusterName :: Maybe Text
$sel:clusterName:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe Text
clusterName} -> Maybe Text
clusterName) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe Text
a -> OidcIdentityProviderConfig
s {$sel:clusterName:OidcIdentityProviderConfig' :: Maybe Text
clusterName = Maybe Text
a} :: OidcIdentityProviderConfig)

-- | The metadata to apply to the provider configuration to assist with
-- categorization and organization. Each tag consists of a key and an
-- optional value, both of which you defined.
oidcIdentityProviderConfig_tags :: Lens.Lens' OidcIdentityProviderConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
oidcIdentityProviderConfig_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig
oidcIdentityProviderConfig_tags = (OidcIdentityProviderConfig -> Maybe (HashMap Text Text))
-> (OidcIdentityProviderConfig
    -> Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
-> Lens
     OidcIdentityProviderConfig
     OidcIdentityProviderConfig
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcIdentityProviderConfig' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:OidcIdentityProviderConfig' :: OidcIdentityProviderConfig -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: OidcIdentityProviderConfig
s@OidcIdentityProviderConfig' {} Maybe (HashMap Text Text)
a -> OidcIdentityProviderConfig
s {$sel:tags:OidcIdentityProviderConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: OidcIdentityProviderConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> OidcIdentityProviderConfig -> f OidcIdentityProviderConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OidcIdentityProviderConfig
-> f OidcIdentityProviderConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON OidcIdentityProviderConfig where
  parseJSON :: Value -> Parser OidcIdentityProviderConfig
parseJSON =
    String
-> (Object -> Parser OidcIdentityProviderConfig)
-> Value
-> Parser OidcIdentityProviderConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OidcIdentityProviderConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConfigStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> OidcIdentityProviderConfig
OidcIdentityProviderConfig'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ConfigStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ConfigStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groupsPrefix")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ConfigStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ConfigStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"usernameClaim")
            Parser
  (Maybe Text
   -> Maybe ConfigStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe ConfigStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clientId")
            Parser
  (Maybe ConfigStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe ConfigStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"identityProviderConfigName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"identityProviderConfigArn")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"issuerUrl")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"requiredClaims" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"usernamePrefix")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groupsClaim")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clusterName")
            Parser (Maybe (HashMap Text Text) -> OidcIdentityProviderConfig)
-> Parser (Maybe (HashMap Text Text))
-> Parser OidcIdentityProviderConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable OidcIdentityProviderConfig

instance Prelude.NFData OidcIdentityProviderConfig