1 | /** @file
|
---|
2 | Definition of Redfish Credential DXE 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 EDKII_REDFISH_CREDENTIAL_DXE_H_
|
---|
10 | #define EDKII_REDFISH_CREDENTIAL_DXE_H_
|
---|
11 |
|
---|
12 | #include <Protocol/EdkIIRedfishCredential.h>
|
---|
13 |
|
---|
14 | #include <Library/BaseLib.h>
|
---|
15 | #include <Library/DebugLib.h>
|
---|
16 | #include <Library/PrintLib.h>
|
---|
17 | #include <Library/RedfishCredentialLib.h>
|
---|
18 | #include <Library/UefiLib.h>
|
---|
19 | #include <Library/UefiBootServicesTableLib.h>
|
---|
20 |
|
---|
21 | /**
|
---|
22 | Retrieve platform's Redfish authentication information.
|
---|
23 |
|
---|
24 | This functions returns the Redfish authentication method together with the user Id and
|
---|
25 | password.
|
---|
26 | - For AuthMethodNone, the UserId and Password could be used for HTTP header authentication
|
---|
27 | as defined by RFC7235.
|
---|
28 | - For AuthMethodRedfishSession, the UserId and Password could be used for Redfish
|
---|
29 | session login as defined by Redfish API specification (DSP0266).
|
---|
30 |
|
---|
31 | Callers are responsible for and freeing the returned string storage.
|
---|
32 |
|
---|
33 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
|
---|
34 | @param[out] AuthMethod Type of Redfish authentication method.
|
---|
35 | @param[out] UserId The pointer to store the returned UserId string.
|
---|
36 | @param[out] Password The pointer to store the returned Password string.
|
---|
37 |
|
---|
38 | @retval EFI_SUCCESS Get the authentication information successfully.
|
---|
39 | @retval EFI_ACCESS_DENIED SecureBoot is disabled after EndOfDxe.
|
---|
40 | @retval EFI_INVALID_PARAMETER This or AuthMethod or UserId or Password is NULL.
|
---|
41 | @retval EFI_OUT_OF_RESOURCES There are not enough memory resources.
|
---|
42 | @retval EFI_UNSUPPORTED Unsupported authentication method is found.
|
---|
43 |
|
---|
44 | **/
|
---|
45 | EFI_STATUS
|
---|
46 | EFIAPI
|
---|
47 | RedfishCredentialGetAuthInfo (
|
---|
48 | IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
|
---|
49 | OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
|
---|
50 | OUT CHAR8 **UserId,
|
---|
51 | OUT CHAR8 **Password
|
---|
52 | );
|
---|
53 |
|
---|
54 | /**
|
---|
55 | Notify the Redfish service provide to stop provide configuration service to this platform.
|
---|
56 |
|
---|
57 | This function should be called when the platfrom is about to leave the safe environment.
|
---|
58 | It will notify the Redfish service provider to abort all logined session, and prohibit
|
---|
59 | further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this
|
---|
60 | function is returned.
|
---|
61 |
|
---|
62 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
|
---|
63 |
|
---|
64 | @retval EFI_SUCCESS Service has been stoped successfully.
|
---|
65 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
66 | @retval Others Some error happened.
|
---|
67 |
|
---|
68 | **/
|
---|
69 | EFI_STATUS
|
---|
70 | EFIAPI
|
---|
71 | RedfishCredentialStopService (
|
---|
72 | IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
|
---|
73 | IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
|
---|
74 | );
|
---|
75 | #endif
|
---|