RedfishCredentialLib.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /** @file
  2. Definitinos of RedfishHostInterfaceDxe driver.
  3. (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef REDFISH_CREDENTIAL_LIB_H_
  7. #define REDFISH_CREDENTIAL_LIB_H_
  8. #include <Uefi.h>
  9. /**
  10. Notification of Exit Boot Service.
  11. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
  12. **/
  13. VOID
  14. EFIAPI
  15. LibCredentialExitBootServicesNotify (
  16. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
  17. );
  18. /**
  19. Notification of End of DXe.
  20. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
  21. **/
  22. VOID
  23. EFIAPI
  24. LibCredentialEndOfDxeNotify (
  25. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
  26. );
  27. /**
  28. Retrieve platform's Redfish authentication information.
  29. This functions returns the Redfish authentication method together with the user Id and
  30. password.
  31. - For AuthMethodNone, the UserId and Password could be used for HTTP header authentication
  32. as defined by RFC7235.
  33. - For AuthMethodRedfishSession, the UserId and Password could be used for Redfish
  34. session login as defined by Redfish API specification (DSP0266).
  35. Callers are responsible for and freeing the returned string storage.
  36. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
  37. @param[out] AuthMethod Type of Redfish authentication method.
  38. @param[out] UserId The pointer to store the returned UserId string.
  39. @param[out] Password The pointer to store the returned Password string.
  40. @retval EFI_SUCCESS Get the authentication information successfully.
  41. @retval EFI_ACCESS_DENIED SecureBoot is disabled after EndOfDxe.
  42. @retval EFI_INVALID_PARAMETER This or AuthMethod or UserId or Password is NULL.
  43. @retval EFI_OUT_OF_RESOURCES There are not enough memory resources.
  44. @retval EFI_UNSUPPORTED Unsupported authentication method is found.
  45. **/
  46. EFI_STATUS
  47. EFIAPI
  48. LibCredentialGetAuthInfo (
  49. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
  50. OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
  51. OUT CHAR8 **UserId,
  52. OUT CHAR8 **Password
  53. );
  54. /**
  55. Notify the Redfish service provide to stop provide configuration service to this platform.
  56. This function should be called when the platfrom is about to leave the safe environment.
  57. It will notify the Redfish service provider to abort all logined session, and prohibit
  58. further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this
  59. function is returned.
  60. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
  61. @param[in] ServiceStopType Reason of stopping Redfish service.
  62. @retval EFI_SUCCESS Service has been stoped successfully.
  63. @retval EFI_INVALID_PARAMETER This is NULL.
  64. @retval Others Some error happened.
  65. **/
  66. EFI_STATUS
  67. EFIAPI
  68. LibStopRedfishService (
  69. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
  70. IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
  71. );
  72. #endif