クラス VaultPropertySource


public class VaultPropertySource extends EnumerablePropertySource<VaultOperations>
VaultTemplate および path からキーと値を読み取る PropertySourcePropertyTransformer を使用して Vault からプロパティを取得した後、プロパティを変換します。
作成者:
Mark Paluch
関連事項:
  • コンストラクターの詳細

    • VaultPropertySource

      public VaultPropertySource(VaultOperations vaultOperations, StringSE path)
      Vault 内に VaultTemplate と path を指定して、新しい VaultPropertySource を作成します。このプロパティソースは、構築時にプロパティを読み込みます。
      パラメーター:
      vaultOperations - null であってはなりません。
      path - Vault 内のパス (例: secret/myapp/myproperties。空または null であってはなりません)。
    • VaultPropertySource

      public VaultPropertySource(StringSE name, VaultOperations vaultOperations, StringSE path)
      Vault 内に nameVaultTemplatepath を指定して新しい VaultPropertySource を作成します。このプロパティソースは、構築時にプロパティを読み込みます。
      パラメーター:
      name - プロパティソースの名前。null であってはなりません。
      vaultOperations - null であってはなりません。
      path - Vault 内のパス (例: secret/myapp/myproperties。空または null であってはなりません)。
    • VaultPropertySource

      public VaultPropertySource(StringSE name, VaultOperations vaultOperations, StringSE path, PropertyTransformer propertyTransformer)
      Vault 内に nameVaultTemplatepath を指定して新しい VaultPropertySource を作成します。このプロパティソースは構築時にプロパティをロードし、PropertyTransformer を適用することでこれらを変換します。
      パラメーター:
      name - プロパティソースの名前。null であってはなりません。
      vaultOperations - null であってはなりません。
      path - Vault 内のパス (例: secret/myapp/myproperties。空または null であってはなりません)。
      propertyTransformer - プロパティを変換するオブジェクト。
      関連事項:
    • VaultPropertySource

      public VaultPropertySource(StringSE name, VaultOperations vaultOperations, StringSE path, PropertyTransformer propertyTransformer, boolean ignoreSecretNotFound)
      Vault 内に nameVaultTemplatepath を指定して新しい VaultPropertySource を作成します。このプロパティソースは構築時にプロパティをロードし、PropertyTransformer を適用することでこれらを変換します。
      パラメーター:
      name - プロパティソースの名前。null であってはなりません。
      vaultOperations - null であってはなりません。
      path - Vault 内のパス (例: secret/myapp/myproperties。空または null であってはなりません)。
      propertyTransformer - プロパティを変換するオブジェクト。
      ignoreSecretNotFound - path でシークレットを見つけられなかった場合を無視する必要があるかどうかを示します。
      導入:
      2.2
      関連事項:
  • メソッドの詳細

    • loadProperties

      protected void loadProperties()
      プロパティソースを初期化し、Vault からプロパティを読み取ります。
    • getProperty

      public ObjectSE getProperty(StringSE name)
      次で指定:
      クラス PropertySource<VaultOperations>getProperty 
    • getPropertyNames

      public StringSE[] getPropertyNames()
      次で指定:
      クラス EnumerablePropertySource<VaultOperations>getPropertyNames 
    • doGetProperties

      @Nullable protected MapSE<StringSE,ObjectSE> doGetProperties(StringSE path) throws VaultException
      Vault からプロパティを取得するフックメソッド。
      パラメーター:
      path - パスは空または null であってはなりません。
      戻り値:
      結果の MapSE、またはプロパティが見つからなかった場合は null。
      例外:
      VaultException - プロパティの取得の問題について
    • doTransformProperties

      protected MapSE<StringSE,ObjectSE> doTransformProperties(MapSE<StringSE,ObjectSE> properties)
      PropertyTransformer を使用してプロパティを変換するフックメソッド。
      パラメーター:
      properties - null であってはなりません。
      戻り値:
      変換されたプロパティ。
    • flattenMap

      protected MapSE<StringSE,ObjectSE> flattenMap(MapSE<StringSE,ObjectSE> data)
      String/Object マップをフラット String/Object マップに変換するユーティリティメソッド。ネストされたオブジェクトは、プロパティパスキーで表されます。
      パラメーター:
      data - 地図
      戻り値:
      フラット化されたマップ。
      導入:
      2.0