Skip to content
  1. Jan 10, 2019
    • Matt Spinler's avatar
      REST: Use status 400 for method arg problems · c0eb9bd9
      Matt Spinler authored
      
      
      Use 400, which is a client error, for errors when
      deciphering method call arguments as opposed to
      a server error, 500.  The robot testcases expect this
      and it also makes sense since the client must have
      passed in a bad argument.
      
      Only the error that results from a method call failing
      will be 500.
      
      Resolves openbmc/bmcweb#25
      
      Change-Id: I9504905992fee3bc0119ff7cae8512eba899daa4
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      c0eb9bd9
    • James Feist's avatar
      filesystem.hpp fix bad sed · 673eda6d
      James Feist authored
      
      
      sed replacing filesystem should not have happened in
      this file.
      
      Change-Id: I3411d655b563edd52cd980bd56277f16fa6f7ac5
      Signed-off-by: default avatarJames Feist <james.feist@linux.intel.com>
      673eda6d
    • Cheng C Yang's avatar
      Fix disconnection problem for HTML5 SOL · 81bfd119
      Cheng C Yang authored
      
      
      When using Legacy Boot Mode in Intel platforms, HTML5 SOL console will
      be disconnected when host start.
      When host start, BIOS will send some non UTF-8 data to SOL console,
      then SOL console will be disconnected. Changing to binary format can
      make WSS protocol work correctly with non UTF-8 data.
      
      Change-Id: I9a440220f16eb07d800dc291897ab3106cd40c32
      Signed-off-by: default avatarCheng C Yang <cheng.c.yang@linux.intel.com>
      81bfd119
    • Andrew Geissler's avatar
      Fix host state checking logic · 94732661
      Andrew Geissler authored
      
      
      Resolves openbmc/bmcweb#12
      
      Testing: Verified this with system booted against
      redfish/v1/Systems/motherboard:
        "PowerState": "On",
        "Status": {
          "State": "Enabled"
        },
      and this with system powered off:
        "PowerState": "Off",
        "Status": {
          "State": "Disabled"
        },
      
      Change-Id: I0acbf0992d730e4a5189d9af962370277f59eaaa
      Signed-off-by: default avatarAndrew Geissler <geissonator@yahoo.com>
      94732661
  2. Jan 09, 2019
    • Vernon Mauery's avatar
      bmcweb: remove boost::asio::local::stream_protocol::endpoint hack · a870486d
      Vernon Mauery authored
      
      
      With the obmc-console-server binding to the correct socket, this is not
      needed.
      
      Abstract unix sockets start with the nul-charater, but are not nul
      terminated. In fact, the nul-character has no meaning in the path.
      According to the man page unix(7),
      
      abstract:  an abstract socket address is distinguished (from a pathname
                 socket) by the fact that sun_path[0] is a null byte ('\0').
                 The socket's address in  this  namespace is  given by the
                 additional bytes in sun_path that are covered by the
                 specified length of the address structure.  (Null bytes in
                 the name have no special significance.)
      
      This means that when calling bind/connect, the size of the sockaddr
      structure is not sizeof(sockaddr_un), it is sizeof(sockaddr_un) -
      sizeof(sun_path) + (path_len)
      
      Change-Id: I2b19d0b9aa8e8ded9162890503c46cad95a6c7b6
      Signed-off-by: default avatarVernon Mauery <vernon.mauery@linux.intel.com>
      a870486d
  3. Jan 08, 2019
  4. Jan 07, 2019
  5. Jan 04, 2019
  6. Jan 03, 2019
  7. Jan 02, 2019
  8. Dec 29, 2018
  9. Dec 27, 2018
  10. Dec 21, 2018
    • Ed Tanous's avatar
      bmcweb: Fix content type for javascript files · 7e51389a
      Ed Tanous authored
      
      
      Somehow we got the content type wrong on javascript files, which became
      apparent when the content security patches were coming out.
      
      This patchset corrects the string.
      
      Tested By:
      Opened webui in chrome, and inspected the javascript files.  content
      type was correct.
      
      Change-Id: I9ba706d5b919bf4c6365d01853c978b1616913d4
      Signed-off-by: default avatarEd Tanous <ed.tanous@intel.com>
      7e51389a
  11. Dec 19, 2018
  12. Dec 18, 2018
  13. Dec 14, 2018
    • Gunnar Mills's avatar
      bmcweb: Redfish make MemorySizeInKB optional · aceb7fc8
      Gunnar Mills authored
      
      
      This commit makes Memory Size an optional parameter.
      On X86 platforms, MemorySizeInKB is coming from the MDR daemon.
      For other platforms it is undefined. Still some work to do here,
      but this commit fixes the internal error in
      /redfish/v1/Systems/{ComputerSystemId}/Memory/{MemoryId} on non-X86
      systems.
      
      Resolves: openbmc/bmcweb#19
      
      curl -k -H "X-Auth-Token: $bmc_token" -X GET \
      https://${bmc}/redfish/v1/Systems/motherboard/Memory/dimm9
      {
        "@odata.context": "/redfish/v1/$metadata#Memory.Memory",
        "@odata.id": "/redfish/v1/Systems/motherboard/Memory/dimm9",
        "@odata.type": "#Memory.v1_2_0.Memory",
        "Id": "dimm9",
        "Name": "DIMM Slot",
        "Status": {
          "Health": "OK",
          "State": "Enabled"
        }
      }
      
      Change-Id: Ib2b558ba2299674edab0132a21dc6109e4b81732
      Signed-off-by: default avatarGunnar Mills <gmills@us.ibm.com>
      aceb7fc8
  14. Dec 13, 2018
    • Matt Spinler's avatar
      REST: Add DELETE support · de81881f
      Matt Spinler authored
      
      
      Add support for the DELETE verb.  This verb will cause the
      Delete method on the xyz.openbmc_project.Object.Delete interface
      to be called on the specified object path.  An error will be
      returned if that interface/method doesn't exist on that path.
      
      The code is similar to the method handling code, except it
      doesn't need to parse any argument JSON, and it is looking only
      at a specific interface.  It does share the code path that
      introspects the object to find a method and call it.
      
      Tested:  Used it to delete error logs.
      
      Change-Id: Ica90b0d80049e6bc59fe2b8456948696054f4a8b
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      de81881f
    • Matt Spinler's avatar
      REST: For PUT, return errors in JSON · fbc19ea6
      Matt Spinler authored
      
      
      This handler is used for setting a D-Bus property.
      Return failures as a JSON response.
      
      Change-Id: Ie18abbc78d77d23d3194d76b60d42e877ac54bec
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      fbc19ea6
    • Matt Spinler's avatar
      REST: Add JSON error when no D-Bus handlers found · c4e8d21d
      Matt Spinler authored
      
      
      Add the full JSON error response for the case when
      the URL looks like it should correspond to a D-Bus
      operation, but doesn't.
      
      Change-Id: I63a2c05fd8ab3adcdd81d407f9359ebb0279cdc3
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      c4e8d21d
    • Matt Spinler's avatar
      REST: For /action/<method>, return errors in JSON · 6db06242
      Matt Spinler authored
      
      
      This route calls D-Bus methods.  Return any errors
      encountered in JSON.
      
      Change-Id: I84c6f4abb7092d86ecbc157c95d6343a0b27b7d0
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      6db06242
    • Matt Spinler's avatar
      REST: For list, return the error in JSON · d6091ddd
      Matt Spinler authored
      
      
      The only way list can fail is if the GetSubTreePaths call fails,
      and that will only happen if the path isn't a valid D-Bus object.
      
      In that case, return the standard REST error JSON response for
      org.freedesktop.DBus.Error.FileNotFound.
      
      Change-Id: I538d3132552590e51f9ede80762aee00c59cb3e9
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      d6091ddd
    • Matt Spinler's avatar
      REST: For GET, return errors in JSON · dc2f9f11
      Matt Spinler authored
      
      
      For the failure cases, return the error messages
      in JSON, the same as the python REST server does.
      
      Change-Id: I150fec3ade738d1bd5425a3ea7cceb6c5539f9f6
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      dc2f9f11
    • Matt Spinler's avatar
      REST: For enumerate, return the error in JSON · 2ae60096
      Matt Spinler authored
      
      
      The only way enumerate can fail is if the GetSubTree call fails,
      and that will only happen if the path isn't a valid D-Bus object.
      
      In that case, return the standard REST error JSON response for
      org.freedesktop.DBus.Error.FileNotFound.
      
      Change-Id: Ie68761c3ee67aa337761567b8a76bd9c9ebddc19
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      2ae60096
    • Matt Spinler's avatar
      REST: For enumerate, try GetAll as last resort · 2df1e7db
      Matt Spinler authored
      
      
      If there are no ObjectManager instances covering a
      path that came back from the GetSubTree call, the only
      other way to get that path's properties is by directly
      reading them.
      
      So, after all of the GetManagedObjects calls are done,
      on any of the paths that were in the GetSubTree results
      but not in the enumerate results, make a GetAll call to
      get the properties and add them to the output.
      
      The code knows when all of the asynchronous GetManagedObjects
      calls are done because it is called from the destructor of the
      InProgressEnumerateData struct which is passed to all of the
      other asio ops via a shared pointer.
      
      Tested:  Run on paths that weren't in object managers, such as
               the physical LED objects.
      
      Change-Id: I5a62b9a0ee27a68127e6f216625ce93c9ac58d08
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      2df1e7db
    • Matt Spinler's avatar
      REST: For enumerate, use GetObject for target path · 3ae4ba7b
      Matt Spinler authored
      
      
      Make a call to GetObject for the target path to get its
      connection names and interfaces to add to the GetSubTree
      results data before looking for object managers in the
      GetSubTree data.  This is the only way that the code can
      find an object manager interface on the target path.
      
      Tested: /enumerate works better
      
      Change-Id: I341b2f46ee7a20793b5f2db15bf4b57b0cbc6d01
      Signed-off-by: default avatarMatt Spinler <spinler@us.ibm.com>
      3ae4ba7b
  15. Dec 11, 2018
  16. Dec 10, 2018
    • Ed Tanous's avatar
      bmcweb: Move boost::optional to std::optional · a24526dc
      Ed Tanous authored
      
      
      This change is largely a sed replace, and gets us closer to standards
      compliance.
      
      Change-Id: Ie60437eff43de830ef19389344a55430dabd9d16
      Signed-off-by: default avatarEd Tanous <ed.tanous@intel.com>
      a24526dc
    • Ed Tanous's avatar
      bmcweb: Clean up security headers · 750ceaec
      Ed Tanous authored
      
      
      Inline strings make this patchset easier to read, and idenfity where
      we're adding headers.  Also, in the cases where we're using common keys,
      passing it by boost::beast::http::field helps us avoid some dict
      lookups.  These performance improvements are largely hypothetical, as it
      would be unlikely we'd ever measure a real difference.
      
      Change-Id: Ic931c4454a5f40c0d206bb4df09058f8f61fc0e2
      Signed-off-by: default avatarEd Tanous <ed.tanous@intel.com>
      750ceaec
    • Ed Tanous's avatar
      bmcweb: Redfish make CpuCoreCount optional · 883b311c
      Ed Tanous authored
      
      
      Fixes #18
      
      This commit makes CPU core count an optional parameter.  Previously it
      was used to determine if a slot was populated, which was a bad idea in
      the first place.  This just makes the implementation a little less bad.
      
      The best implementation would likely be to implement the state interface
      in all the processor daemons to tell if the processor is present or not.
      Because the processor not being present isn't very common, this is
      likely low priority.
      
      Change-Id: I42e49ef5ae7d6184d7f854069fd9a18c7c606dd3
      Signed-off-by: default avatarEd Tanous <ed.tanous@intel.com>
      883b311c
    • AppaRao Puli's avatar
      Redfish AccountService service modifications · 84e12cb7
      AppaRao Puli authored
      
      
       - Updated code to get "UserPrivilege" from DBUS
       - Updated Links->Role in AccountManager.
       - Added code for "RenameUser".
       - Added code to update Privilege over dbus.
      
      UnitTest:
       - Tested All methods(Get,Post,Delete,Patch) on
         AccountCollections and ManageAccount over redfish
         using postman tool.
      
      Change-Id: Ib9d8713908bad28d8d411f113af0d72d6c0fc40b
      Signed-off-by: default avatarAppaRao Puli <apparao.puli@linux.intel.com>
      84e12cb7
Loading