1 | /** @file
|
---|
2 | This file defines the EDKII_REDFISH_CREDENTIAL2_PROTOCOL interface.
|
---|
3 |
|
---|
4 | Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
---|
5 | (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
|
---|
6 | (C) Copyright 2024 American Megatrends International LLC<BR>
|
---|
7 |
|
---|
8 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
9 |
|
---|
10 | **/
|
---|
11 |
|
---|
12 | #ifndef EDKII_REDFISH_CREDENTIAL2_H_
|
---|
13 | #define EDKII_REDFISH_CREDENTIAL2_H_
|
---|
14 |
|
---|
15 | #include <Protocol/EdkIIRedfishCredential.h>
|
---|
16 | #include <RedfishServiceData.h>
|
---|
17 |
|
---|
18 | typedef struct _EDKII_REDFISH_CREDENTIAL2_PROTOCOL EDKII_REDFISH_CREDENTIAL2_PROTOCOL;
|
---|
19 |
|
---|
20 | #define REDFISH_CREDENTIAL_PROTOCOL_REVISION 0x00010000
|
---|
21 |
|
---|
22 | #define EDKII_REDFISH_CREDENTIAL2_PROTOCOL_GUID \
|
---|
23 | { \
|
---|
24 | 0x936b81dc, 0x348c, 0x42e3, { 0x9e, 0x82, 0x2, 0x91, 0x4f, 0xd3, 0x48, 0x86 } \
|
---|
25 | }
|
---|
26 |
|
---|
27 | /**
|
---|
28 | Retrieve platform's Redfish authentication information.
|
---|
29 |
|
---|
30 | This functions returns the Redfish authentication method together with the user Id and
|
---|
31 | password.
|
---|
32 | - For AuthMethodNone, the UserId and Password could be used for HTTP header authentication
|
---|
33 | as defined by RFC7235.
|
---|
34 | - For AuthMethodRedfishSession, the UserId and Password could be used for Redfish
|
---|
35 | session login as defined by Redfish API specification (DSP0266).
|
---|
36 |
|
---|
37 | Callers are responsible for and freeing the returned string storage.
|
---|
38 |
|
---|
39 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance.
|
---|
40 | @param[out] AuthMethod Type of Redfish authentication method.
|
---|
41 | @param[out] UserId The pointer to store the returned UserId string.
|
---|
42 | @param[out] Password The pointer to store the returned Password string.
|
---|
43 |
|
---|
44 | @retval EFI_SUCCESS Get the authentication information successfully.
|
---|
45 | @retval EFI_ACCESS_DENIED SecureBoot is disabled after EndOfDxe.
|
---|
46 | @retval EFI_INVALID_PARAMETER This or AuthMethod or UserId or Password is NULL.
|
---|
47 | @retval EFI_OUT_OF_RESOURCES There are not enough memory resources.
|
---|
48 | @retval EFI_UNSUPPORTED Unsupported authentication method is found.
|
---|
49 |
|
---|
50 | **/
|
---|
51 | typedef
|
---|
52 | EFI_STATUS
|
---|
53 | (EFIAPI *EDKII_REDFISH_CREDENTIAL2_PROTOCOL_GET_AUTH_INFO)(
|
---|
54 | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL *This,
|
---|
55 | OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
|
---|
56 | OUT CHAR8 **UserId,
|
---|
57 | OUT CHAR8 **Password
|
---|
58 | );
|
---|
59 |
|
---|
60 | /**
|
---|
61 | Notifies the Redfish service provider to stop providing configuration service to this platform.
|
---|
62 | Deletes the bootstrap account on BMC side, so it will not be used by any other driver.
|
---|
63 |
|
---|
64 | This function should be called when the platfrom is about to leave the safe environment.
|
---|
65 | It will delete the bootstrap account sending DELETE request to BMC.
|
---|
66 | It will notify the Redfish service provider to abort all logined session, and prohibit
|
---|
67 | further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this
|
---|
68 | function is returned.
|
---|
69 |
|
---|
70 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance.
|
---|
71 | @param[in] ServiceStopType Reason of stopping Redfish service.
|
---|
72 |
|
---|
73 | @retval EFI_SUCCESS Service has been stopped successfully.
|
---|
74 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
75 | @retval Others Some error happened.
|
---|
76 |
|
---|
77 | **/
|
---|
78 | typedef
|
---|
79 | EFI_STATUS
|
---|
80 | (EFIAPI *EDKII_REDFISH_CREDENTIAL2_PROTOCOL_STOP_SERVICE)(
|
---|
81 | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL *This,
|
---|
82 | IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
|
---|
83 | );
|
---|
84 |
|
---|
85 | /**
|
---|
86 | Register Redfish service instance so protocol knows that some module uses bootstrap account .
|
---|
87 |
|
---|
88 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance.
|
---|
89 | @param[in] RedfishService Redfish service instance to register.
|
---|
90 |
|
---|
91 | @retval EFI_SUCCESS This Redfish service instance has been registered successfully.
|
---|
92 |
|
---|
93 | **/
|
---|
94 | typedef
|
---|
95 | EFI_STATUS
|
---|
96 | (EFIAPI *EDKII_REDFISH_CREDENTIAL2_PROTOCOL_REGISTER_REDFISH_SERVICE)(
|
---|
97 | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL *This,
|
---|
98 | IN REDFISH_SERVICE RedfishService
|
---|
99 | );
|
---|
100 |
|
---|
101 | /**
|
---|
102 | Unregister Redfish service instance and delete the bootstrap account
|
---|
103 | when all registered services unregistered.
|
---|
104 |
|
---|
105 | @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance.
|
---|
106 | @param[in] RedfishService Redfish service instance to unregister.
|
---|
107 |
|
---|
108 | @retval EFI_SUCCESS This Redfish service instance has been unregistered successfully.
|
---|
109 |
|
---|
110 | **/
|
---|
111 | typedef
|
---|
112 | EFI_STATUS
|
---|
113 | (EFIAPI *EDKII_REDFISH_CREDENTIAL2_PROTOCOL_UNREGISTER_REDFISH_SERVICE)(
|
---|
114 | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL *This,
|
---|
115 | IN REDFISH_SERVICE RedfishService
|
---|
116 | );
|
---|
117 |
|
---|
118 | struct _EDKII_REDFISH_CREDENTIAL2_PROTOCOL {
|
---|
119 | UINT64 Revision;
|
---|
120 | EDKII_REDFISH_CREDENTIAL2_PROTOCOL_GET_AUTH_INFO GetAuthInfo;
|
---|
121 | EDKII_REDFISH_CREDENTIAL2_PROTOCOL_STOP_SERVICE StopService;
|
---|
122 | EDKII_REDFISH_CREDENTIAL2_PROTOCOL_REGISTER_REDFISH_SERVICE RegisterRedfishService;
|
---|
123 | EDKII_REDFISH_CREDENTIAL2_PROTOCOL_UNREGISTER_REDFISH_SERVICE UnregisterRedfishService;
|
---|
124 | };
|
---|
125 |
|
---|
126 | extern EFI_GUID gEdkIIRedfishCredential2ProtocolGuid;
|
---|
127 |
|
---|
128 | #endif
|
---|