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