summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* rest_dbus: Add content_typeDeepak Kodihalli2017-04-111-3/+6
| | | | | | | | | | Add the content_type property to indicate the content-type header for routes. As of now, POST and PUT expect 'application/json'. Change-Id: Id7641189c818a2b38382edff37b204c40fb15874 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Change Delete interfaceDeepak Kodihalli2017-04-041-1/+1
| | | | | | | | | To support the 'DELETE' REST verb, the d-bus interface to be implemented is now xyz.openbmc_project.Object.Delete, instead of org.openbmc.Object.Delete. Change-Id: I7ddc139d6e7e5dde04127130ea1749d9a73d34c0 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix error response status regressionBrad Bishop2017-03-071-0/+1
| | | | | | | | | | 080a48e introduces a regression where the status field is missing from the response for non 2xx responses. Resolves openbmc/openbmc#1246 Change-Id: Idb18b100c9ebb34275b5c24f7609748603749d58 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Make the attr endpoint case insensitiveBrad Bishop2017-02-261-9/+12
| | | | | | | | This patch makes the attribute after the attr endpoint case insensitive. Change-Id: I1c8a634bffc2eed4c63c8b89b7b5ea281c06a1bc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix attr PUT after empty interfaceBrad Bishop2017-02-261-1/+1
| | | | | | | | Fix an issue that occurs when doing a PUT using the attr endpoint when an object has an interface without properties. Change-Id: Ib3b2bb81dd287365851e6a67fec0c33479fdc543 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add CORS supportBrad Bishop2017-02-261-0/+51
| | | | | | | | | Enable cross domain applications. https://en.wikipedia.org/wiki/Cross-origin_resource_sharing Change-Id: Id628ae387bb422fbfc4f319ce0847966ca8cbebf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add HTTP OPTIONS supportBrad Bishop2017-02-261-11/+32
| | | | | | | | The OPTIONS HTTP method allows clients to query the allowed methods on a given path. Change-Id: I762e85a6dbe2df3473dfa79c252c51ebe49c3ecb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Allow clients to call HEADBrad Bishop2017-02-261-4/+13
| | | | | | | | The HEAD method allows clients to get page response headers without actually downloading the content. Change-Id: Id69db83a74015df3a9f84d36f91a4a12e11ea7b6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for error response pluginsBrad Bishop2017-02-211-45/+52
| | | | | | | | | | | | | | The Bottle plugin framework only applies to normal responses. Build on that by monkey-patching the Bottle error handler with a new one that makes a series of callbacks. Update the existing plugins such that where appropriate they can apply their logic to error responses in addition to normal responses as they already do. Change-Id: Ifc2bac0e5120a3b0475f3b78f8bd822711f9c736 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Return HTTP 503 when mapper is busyBrad Bishop2016-11-281-0/+3
| | | | | | | | | Suppress traceback and provide an informative error message when the mapper cannot respond to a query. Resolves openbmc/openbmc#812 Change-Id: I85d4e59c5a25dc8a19fbdb1d1cf8c2a0f4350991
* fix a pep8 errorBrad Bishop2016-11-281-1/+2
| | | | | Change-Id: I173aed206b4da49ca83261e4853426947f07f1f5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Raise 401 for invalid credentialsBrad Bishop2016-09-081-2/+2
| | | | | | Change-Id: Ie41b568aa45b1f09b0940e5ee1b3472a46b08db1 Resolves: openbmc/phosphor-rest-server#25 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add python-gevent startup scriptBrad Bishop2016-08-304-0/+57
| | | | | | | | Add a python-gevent startup script that takes a WSGI application as a parameter. Change-Id: I4c637538a1c6d4aa92563d548a2d8673299a23bb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Split server and applicationBrad Bishop2016-08-309-31/+63
| | | | | | | | | | Provide the REST server as a python module, enabling it to be hosted by any WSGI provider. Provide a Rocket startup script with configurable WSGI application. Change-Id: I1a9c25b10c33b08dfb8f60dc6c33aaf727562a9f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Rename obmc-rest to phosphor-restBrad Bishop2016-08-302-3/+3
| | | | | Change-Id: I34dba229f66b9e6dbf38d7f3f10dff27e3a59130 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Minor refactoringBrad Bishop2016-08-301-5/+4
| | | | | | | | | | Make the Bottle part of the application get its own DBus connection rather than passing it in. This partially enables generic WSGI app hosting. Change-Id: I75334f83320bf6c1cad1a6bf5f2d1d82ca8dc470 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Merge pull request #19 from bradbishop/refactorPatrick Williams2016-04-291-106/+14
|\ | | | | Refactoring and fixes.
| * Remove redundant makelist and search functionsBrad Bishop2016-04-241-17/+4
| | | | | | | | Use the functions in the new pyphosphor library.
| * Handle differing dbus exception implementationsBrad Bishop2016-04-151-0/+4
| | | | | | | | | | sdbus and python-dbus don't report the unknown interface exception the same way, so add a workaround.
| * Moved functions to pyobmc libraryBrad Bishop2016-04-151-89/+6
|/ | | | | | The functions here for enumerating a tree of objects have utility elsewhere and were added to pyobmc so removing the duplicated code.
* Merge pull request #17 from bradbishop/jsonpPatrick Williams2016-04-011-2/+28
|\ | | | | Add support for serving jsonp
| * Add support for serving jsonpBrad Bishop2016-03-291-2/+28
|/ | | | | | | | | | | Jsonp adds a javascript wrapper to json responses. It allows client applications to work around cross domain restrictions imposed by some browsers. For more information on jsonp: https://en.wikipedia.org/wiki/JSONP To get a jsonp response, an application adds a callback url parameter with the desired name of the wrapper: https://192.168.252.1/list?callback=my_callback
* Merge pull request #16 from bradbishop/masternkskjames2016-03-221-701/+753
|\ | | | | pep8, miscellaneous rest server updates
| * Enumerate with org.freedesktop.DBus.ObjectManagerBrad Bishop2016-03-181-39/+54
| | | | | | | | | | | | | | | | | | | | | | | | Previously using a custom enumerate interface. This is the standard interface. Also, try to find OM implementing objects higher up in the tree. This improves performance for sub-tree enumerate calls. Don't try to get properties for ObjectManager interfaces. For whatever reason sd-bus chokes on this, but it doesn't have any properties so it isn't needed anyway.
| * Added a license to obmc-rest fileBrad Bishop2016-03-181-0/+16
| | | | | | | | Apache2
| * Use pyobmc packageBrad Bishop2016-03-181-9/+11
| | | | | | | | | | No functional changes here. Just module/package namespace updates to use the pyobmc library.
| * Run through pep8Brad Bishop2016-03-181-699/+718
|/ | | | This is all whitespace changes flagged by pep8.
* Merge pull request #14 from bradbishop/schemaPatrick Williams2016-01-081-0/+32
|\ | | | | Add schema endpoint
| * Add schema endpointBrad Bishop2015-12-161-0/+32
| | | | | | | | | | Navigate to /<obj>/schema to get a dbus introspection dump of <obj>.
* | Merge pull request #11 from bradbishop/typeerrorsPatrick Williams2016-01-081-0/+3
|\ \ | | | | | | Handle type errors for method call parameters.
| * | Handle type errors for method call parametersBrad Bishop2015-12-021-0/+3
| |/ | | | | | | Raise a 400 rather than internal server error for type errors.
* | Merge pull request #12 from bradbishop/threadsPatrick Williams2016-01-081-1/+3
|\ \ | | | | | | Drop number of Rocket threads to 1
| * | Drop number of Rocket threads to 1Brad Bishop2015-12-021-1/+3
| |/ | | | | | | | | | | By default Rocket creates a threadpool 8 deep which uses a fair amount of memory. We don't need a multi-threaded server so this patch drops the min/max to 1.
* | Merge pull request #10 from bradbishop/authPatrick Williams2016-01-081-0/+156
|\ \ | |/ |/| Add authentication and authorization
| * Add authentication and authorizationBrad Bishop2015-12-021-0/+156
|/ | | | | | | | Use session cookie plus in-memory server sessions scheme. Add /login /logout POST routes: {"data": ["username", "password"]}. Add authorization plugin with arbitrary authorization callbacks. Add valid user and user in group authorization callbacks. Require valid user authorization for all routes (besides login/logout).
* Merge pull request #9 from bradbishop/deletePatrick Williams2015-11-301-1/+1
|\ | | | | Fix lower case Delete interface element
| * Fix lower case Delete interface elementBrad Bishop2015-11-251-1/+1
|/
* Merge pull request #7 from bradbishop/errorsPatrick Williams2015-11-171-1/+1
|\ | | | | Set response type correctly for errors
| * Set response type correctly for errorsBrad Bishop2015-11-171-1/+1
|/ | | | | Error response type was 'text/html' but should be 'application/json'
* Merge pull request #6 from bradbishop/restPatrick Williams2015-11-163-371/+594
|\ | | | | port rest server to bottle wsgi framework
| * setuptools name updateBrad Bishop2015-11-132-1/+1
| | | | | | | | Change script, datafile, names to match package name
| * Remove old rest serverBrad Bishop2015-11-132-892/+522
| |
| * Rest server rewrite using Bottle microframeworkBrad Bishop2015-11-131-0/+593
|/ | | | | | | | Feature parity with the old version. Numerous bug-fixes. Improved error responses. Add support for delete method. Run server on port 443.
* Merge pull request #4 from bradbishop/certPatrick Williams2015-11-132-2/+52
|\ | | | | Add self-signed cert
| * Add self-signed certBrad Bishop2015-11-132-2/+52
|/ | | | Eventually will be running with SSL.
* Merge pull request #3 from bradbishop/enumeratePatrick Williams2015-11-091-29/+57
|\ | | | | Support for org.openbmc.Object.Enumerate
| * Make use of org.openbmc.Object.EnumerateBrad Bishop2015-11-031-2/+38
| | | | | | | | | | | | This interface greatly speeds up the enumerate action by cutting the number of dbus calls to fetch objects for a subtree down to one.
| * Check for path component lengthBrad Bishop2015-11-031-2/+2
| | | | | | | | | | | | If someone makes a call against '/org' for instance we die checking for the attr action because there is only path one component to the URL.
| * React to mapper API changes.Brad Bishop2015-11-031-18/+10
| | | | | | | | | | The DBUS API of the mapper had some minor changes. React to those. Also pick up the new mapper binding.
| * Whitespace fixesBrad Bishop2015-11-031-5/+5
| |
OpenPOWER on IntegriCloud