Add SecretKeyRequired D-bus method

This commit adds SecretKeyRequired D-bus method to Manager
interface.
bmcweb codes needs to query generate secret key required for a given
user, local users on BMC have d-bus objects for each user but LDAP
users does not have D-bus objects, so this d-bus method helps identify
whether generate secret key required for user local and remote LDAP
users

Change-Id: Ib522802c395d61f0c3e9fbf84fc6a399a66a3afa
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
diff --git a/gen/xyz/openbmc_project/User/TOTPState/meson.build b/gen/xyz/openbmc_project/User/TOTPState/meson.build
new file mode 100644
index 0000000..376a8b0
--- /dev/null
+++ b/gen/xyz/openbmc_project/User/TOTPState/meson.build
@@ -0,0 +1,35 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'xyz/openbmc_project/User/TOTPState'
+
+generated_sources += custom_target(
+    'xyz/openbmc_project/User/TOTPState__cpp'.underscorify(),
+    input: [
+        '../../../../../yaml/xyz/openbmc_project/User/TOTPState.interface.yaml',
+    ],
+    output: [
+        'common.hpp',
+        'server.hpp',
+        'server.cpp',
+        'aserver.hpp',
+        'client.hpp',
+    ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../yaml',
+        'xyz/openbmc_project/User/TOTPState',
+    ],
+    install: should_generate_cpp,
+    install_dir: [
+        get_option('includedir') / sdbusplus_current_path,
+        get_option('includedir') / sdbusplus_current_path,
+        false,
+        get_option('includedir') / sdbusplus_current_path,
+        get_option('includedir') / sdbusplus_current_path,
+    ],
+    build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/xyz/openbmc_project/User/meson.build b/gen/xyz/openbmc_project/User/meson.build
index 3b290d6..020a65f 100644
--- a/gen/xyz/openbmc_project/User/meson.build
+++ b/gen/xyz/openbmc_project/User/meson.build
@@ -8,6 +8,7 @@
 subdir('PrivilegeMapper')
 subdir('PrivilegeMapperEntry')
 subdir('TOTPAuthenticator')
+subdir('TOTPState')
 
 sdbusplus_current_path = 'xyz/openbmc_project/User'
 
@@ -147,3 +148,20 @@
     build_by_default: should_generate_markdown,
 )
 
+generated_markdown += custom_target(
+    'xyz/openbmc_project/User/TOTPState__markdown'.underscorify(),
+    input: [ '../../../../yaml/xyz/openbmc_project/User/TOTPState.interface.yaml',  ],
+    output: [ 'TOTPState.md' ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../yaml',
+        'xyz/openbmc_project/User/TOTPState',
+    ],
+    install: should_generate_markdown,
+    install_dir: [inst_markdown_dir / sdbusplus_current_path],
+    build_by_default: should_generate_markdown,
+)
+
diff --git a/yaml/xyz/openbmc_project/User/TOTPState.interface.yaml b/yaml/xyz/openbmc_project/User/TOTPState.interface.yaml
new file mode 100644
index 0000000..ddd6274
--- /dev/null
+++ b/yaml/xyz/openbmc_project/User/TOTPState.interface.yaml
@@ -0,0 +1,25 @@
+description: >
+    This interface defines methods and properties required for Time-based
+    One-time Password (TOTP) multi-factor authentication at user manager level
+    to support multi-factor authentication. This interface implemented by each
+    user manager object to support TOTP based authenticators like google,
+    microsoft, etc.
+
+methods:
+    - name: SecretKeyRequired
+      description: >
+          This method checks whether google-authenticator secret key setup
+          required for the given user
+      parameters:
+          - name: UserName
+            type: string
+            description: >
+                This parameter shall be the valid user name
+      returns:
+          - name: Status
+            type: boolean
+            description: >
+                Returns true if given user needs to setup TOTP authenticator
+                secret key otherwise returns false.
+      errors:
+          - xyz.openbmc_project.User.Common.Error.UserNameDoesNotExist