| 14:59 | mstenta[m] | munjoma: I fixed the consideration table issue |
| 15:00 | mstenta[m] | github.com/farmOS/farmOS/issues/123#issu |
| 15:00 | mstenta[m] | It will be included in the next official release of farmOS |
| 15:01 | mstenta[m] | If you want to use it before then, you will need to use the development version (maybe you are already) |
| 16:31 | * | JustTB has joined |
| 16:43 | * | JustTB has quit (Ping timeout: 250 seconds) |
| 16:45 | * | JustTB has joined |
| 16:51 | * | JustTB has quit (Ping timeout: 250 seconds) |
| 17:09 | * | emilyfarmer[m] has joined |
| 18:19 | * | JustTB has joined |
| 18:41 | paul121[m] | Okay, working with the API. I'm trying to pull information about Planting assets. I can get the assets, now I'm trying to get associated crops, seedings, and transplanting. I know I can do this in a series of requests to the api, but wondering if it would be possible in just one request? Can we define custom 'views' for the API? |
| 18:42 | * | JustTB has quit (Ping timeout: 252 seconds) |
| 18:47 | mstenta[m] | paul121: Unfortunately I don't think that's possible right now - farmOS relies on the RESTful Web Services module for Drupal, so we are limited to what it can do: www.drupal.org/project/restws |
| 18:47 | mstenta[m] | But... looking to the future... when farmOS is upgraded to Drupal 8 we will have a lot more API options available. |
| 18:47 | * | JustTB has joined |
| 18:47 | mstenta[m] | Including this: www.drupal.org/project/graphql |
| 18:49 | mstenta[m] | Drupal made "API first" a big priority in D8 |
| 18:49 | mstenta[m] | The restws module (which was a separate contrib module in D7) was pulled into Drupal core and greatly improved upon |
| 18:49 | mstenta[m] | And many more options are now being built in the D8 contrib space |
| 18:49 | mstenta[m] | like GraphQL |
| 18:50 | mstenta[m] | and JSON API |
| 18:50 | mstenta[m] | www.drupal.org/project/jsonapi |
| 18:51 | paul121[m] | Woah. GraphQL looks awesome. Yeah, looking forward to D8.... |
| 18:51 | mstenta[m] | Yea agreed! |
| 18:51 | mstenta[m] | So yea, we're just kind of in that in-between time now... really hoping for a chance to focus on the upgrade in 2019 |
| 18:52 | paul121[m] | What about authentication, I saw that OAuth is in the pipeline... before D8? |
| 18:52 | mstenta[m] | Yea maybe before D8... depends on if it's deemed necessary for any sponsored projects |
| 18:53 | mstenta[m] | Those are really what's driving priorities right now |
| 18:54 | mstenta[m] | But I would definitely welcome any help on the oauth front! If you wanted to start exploring it |
| 18:54 | mstenta[m] | There are some modules available for D7 that you could experiment with |
| 18:55 | mstenta[m] | You could pop one of those into your install and play around with it |
| 18:55 | mstenta[m] | (Doesn't necessarily need to be officially included in farmOS) |
| 18:56 | mstenta[m] | If we want to consider including it in farmOS in D7, we'll just need to think through the D8 upgrade path |
| 18:57 | paul121[m] | Makes sense. I may be interested in exploring it! I'm playing around with a decoupled-react based app. Trying to learn React and the farmOS ecosystem. I've been avoiding the current Auth... getting it setup in Postman was messy |
| 18:58 | mstenta[m] | So... there is another in-between option for auth... |
| 18:58 | paul121[m] | If it's as easy as installing the module and doing some configuration, will definitely try and share what I find. |
| 18:58 | paul121[m] | Oh! |
| 18:58 | mstenta[m] | The RESTws module comes with a "Basic authentication" sub-module, which allows you to skip the /user/login authentication and just pass credentials like you would with http basic authentication |
| 18:59 | mstenta[m] | That is actually included in farmOS (because restws is included) but the module is not enabled by default |
| 18:59 | mstenta[m] | So you could turn that on and experiment with it |
| 19:00 | mstenta[m] | I think there's some weird rules with it... like you need to create a user with a special username, or something... it's in the module's README |
| 19:00 | paul121[m] | I tried that, but didn't have any luck. I would just include credentials with every request? |
| 19:00 | mstenta[m] | cgit.drupalcode.org/restws/tree/restws_b |
| 19:00 | mstenta[m] | that's the readme |
| 19:01 | mstenta[m] | i haven't tried it myself |
| 19:01 | mstenta[m] | i forget why we decided against that as the recommended approach... |
| 19:02 | mstenta[m] | maybe you'll figure that out :-) |
| 19:02 | paul121[m] | Ahhh. Looks like an easy fix! Just using a restws_username as a 'service' account is easy enough... Thanks! |
| 19:03 | mstenta[m] | Cool! Let me know if you get that working - it would be a good thing to document |
| 19:04 | mstenta[m] | (if you get the urge, and want to add to the API doc page (farmos.org/development/api/), that code is here: github.com/farmOS/farmOS.org/blob/7.x-1.) |
| 19:23 | mstenta[m] | (I wonder if using the basic auth approach changes the need for the cookie/token?) |
| 19:27 | paul121[m] | Yeah, this works great. Testing in Postman was easy to setup using their Basic Authentication. It looks like it still returns a cookie, but the cookie isn't needed to authenticate |
| 19:27 | mstenta[m] | oh great! |
| 19:28 | paul121[m] | It's a little hidden how Postman does all of that, though. I'll test some with curl, its a bit more explicit |
| 19:28 | mstenta[m] | ok cool - if you can, document your findings in a github issue at the very least... then we can translate that into the docs later |
| 19:29 | paul121[m] | Will do! |
| 20:09 | * | JustTB has quit (Ping timeout: 250 seconds) |
| 20:25 | * | JustTB has joined |
| 20:44 | * | JustTB has quit (Ping timeout: 250 seconds) |