-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support farmOS aggregator #55
Comments
Preliminary testing of this is looking quite good! I'm actually able to use farmOS.py to make requests to the aggregator using This is the script I'm using for testing the new aggregator This works by creating a custom
Next, with this custom session created you can manually instantiate any of the client classes (resources, log, asset, etc): hostname = 'http://localhost'
session = AggregatorSession(hostname)
session.authorize()
resources = ResourceBase(session) And request logs from the logs = resources.get('log', 'activity', {'farm_id': 1}) |
The only thing that does not work with this approach is the Line 47 in 086e30a
This is also using what is supposed to be the "private" That way subsequent ** Fixed: f13afa0 |
More generally, this gives me some ideas on ways to improve this client library, especially thinking back to #31 and ideas about supporting different session and/or sync/async libraries. The great thing is that, as demonstrated above, this is all largely possible right now by manually instantiating the client Thinking forward to a 1.0, 1.1 or maybe 2.0 release (I'm not sure how "breaking" we can be....) I'd like to explore further decoupling of the session and client classes. The client classes could really be tossed out to require uses instantiate separate "resource API" classes themselves - having separate I'm particularly interested in the httpx library which is compatible with the existing But anyways, as it pertains to this issue and aggregator support, none of this is required now. I'm glad our current abstractions will enable us to explore these ideas further without making changes now. |
Just want to flag this while it is fresh - these It might be possible to extend the parent |
It would be great if this library could also be used to communicate with the aggregator.
I am planning to add an additional "relay" endpoint on the aggregator that can be used to send a request at any given path (not limited to JSONAPI) to an individual farmOS server. In theory, this means farmOS.py just needs to send requests to a different api base path (
api/v2/relay
instead ofapi
) and be able to include additional query params to identify which farmOS server it intends to communicate with. The aggregator will authenticate these requests accordingly.farmOS.py will also need to support the
api-key
authentication that the aggregator uses. The aggregator is also its own OAuth provider (only supporting the password credentials grant), so perhaps farmOS.py could support that (if it doesn't already), but this is less of a priority.The text was updated successfully, but these errors were encountered: