27 IN REDFISH_SERVICE RedfishService,
28 OUT CHAR8 **ServiceVersionStr
35 if ((RedfishService ==
NULL) || (ServiceVersionStr ==
NULL)) {
36 return EFI_INVALID_PARAMETER;
40 if (Redfish->versions ==
NULL) {
41 return EFI_INVALID_PARAMETER;
45 if ((KeysNum == 0) || (KeysArray ==
NULL)) {
49 *ServiceVersionStr = *KeysArray;
86 Auth.authType = REDFISH_AUTH_BASIC;
88 Auth.authType = REDFISH_AUTH_SESSION;
91 Auth.authCodes.userPass.username = UserId;
92 Auth.authCodes.userPass.password = Password;
94 Flags = REDFISH_FLAG_SERVICE_NO_VERSION_DOC;
97 Redfish = createServiceEnumerator (RedfishConfigServiceInfo,
NULL, &Auth, (
unsigned int)Flags);
99 Redfish = createServiceEnumerator (RedfishConfigServiceInfo,
NULL,
NULL, (
unsigned int)Flags);
105 if (Password !=
NULL) {
109 return (REDFISH_SERVICE)Redfish;
144 if ((AuthMethod ==
NULL) || (UserId ==
NULL) || (Password ==
NULL)) {
145 return EFI_INVALID_PARAMETER;
151 if (mCredentialProtocol ==
NULL) {
152 Status =
gBS->LocateProtocol (&gEdkIIRedfishCredentialProtocolGuid,
NULL, (VOID **)&mCredentialProtocol);
153 if (EFI_ERROR (Status)) {
154 return EFI_UNSUPPORTED;
158 ASSERT (mCredentialProtocol !=
NULL);
160 Status = mCredentialProtocol->GetAuthInfo (mCredentialProtocol, AuthMethod, UserId, Password);
161 if (EFI_ERROR (Status)) {
162 DEBUG ((DEBUG_ERROR,
"RedfishGetAuthInfo: failed to retrieve Redfish credential - %r\n", Status));
183 IN CHAR8 *ServiceVersionStr,
191 if ((Redpath ==
NULL) || (ServiceVersionStr ==
NULL) || (Url ==
NULL) || (Id ==
NULL)) {
192 return EFI_INVALID_PARAMETER;
201 if (*Redpath ==
NULL) {
202 return EFI_OUT_OF_RESOURCES;
205 AsciiSPrint (*Redpath, RedpathSize,
"/%a%a[Id=%a]", ServiceVersionStr, Url, Id);
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EDKII_REDFISH_AUTH_METHOD
@ AuthMethodHttpBasic
Basic authentication is required.
@ AuthMethodNone
No authentication is required.
@ AuthMethodRedfishSession
Session authentication is required.
CHAR8 ** JsonObjectGetKeys(IN EDKII_JSON_OBJECT JsonObj, OUT UINTN *KeyCount)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define DEBUG(Expression)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS RedfishBuildRedpathUseId(IN CHAR8 *ServiceVersionStr, IN CHAR8 *Url, IN CHAR8 *Id, OUT CHAR8 **Redpath)
EFI_STATUS RedfishGetAuthInfo(OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod, OUT CHAR8 **UserId, OUT CHAR8 **Password)
REDFISH_SERVICE RedfishCreateLibredfishService(IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo, IN EDKII_REDFISH_AUTH_METHOD AuthMethod, IN CHAR8 *UserId, IN CHAR8 *Password)
EFI_STATUS RedfishGetServiceVersion(IN REDFISH_SERVICE RedfishService, OUT CHAR8 **ServiceVersionStr)