Pyfa: Sync fittings with fleet-up

Created on 11 May 2018  ·  10Comments  ·  Source: pyfa-org/Pyfa

Probably a lot of work to get going (would need to implement fleet-up api), but the ability to sync fittings between the most used 3rd party doctrine manager and the most used 3rd party fittings manager would be a great help.

enhancement help wanted wontfix

Most helpful comment

@BoraVyvorant summarised the situation pretty well. Would love to support a PYFA integration. I'll implement the below to help plus anything else you might need.

  • Add new Fleet-Up API endpoints for adding/updating fittings
  • New API endpoints for managing doctrines(?)
  • Support ESI fitting format(?) for fitting data

PYFA / Fleet-Up integration would be great to see.

All 10 comments

I've often thought about this. It would be helpful if someone could kind of document what apis there are for fleet up, how authentication for them works, etc. Once I get a list of requirements, can start to think about how to implement it. :D

Main page describing the Fleet-Up API is here:

http://fleet-up.com/Api

AuthN/AuthZ looks a lot like the old EVE XML API system: as well as an "App Key", there is a "Userid"/"ApiCode" pair granting permissions to do various things. All three of these things go in the URI used to make a request.

List of available endpoints are here:

http://fleet-up.com/Api/Endpoints

There are endpoints to list all (visible) fittings and to retrieve an individual fitting. Same for Doctrines which in this context are just lists of fittings (but can overlap, i.e., a fitting can appear in multiple doctrines). All these endpoints are GET, i.e., read-only; there's no way to write a fitting back to Fleet-Up using its API, so you can't sync, just use Fleet-Up as a library.

Responses are JSON, but it doesn't look like they are in the same format as ESI returns:

http://fleet-up.com/Api/Endpoints#fittings_get

AuthN/AuthZ looks a lot like the old EVE XML API system: as well as an "App Key", there is a "Userid"/"ApiCode" pair granting permissions to do various things. All three of these things go in the URI used to make a request.

Well that makes it like 150% easier than oauth, that's for damn sure.

Doctrines are like tags I imagine (a feature that's been discussed on/off for pyfa as well)

there's no way to write a fitting back to Fleet-Up using its AP

This particularly is a bummer, and reduces the usefulness of any potential integration beyond "these are the fittings my corp provides, download them"

EDIT: I've messaged the fleet up guy in hope that maybe we can introduce POST for the possibility of future integrations. 💥

@BoraVyvorant summarised the situation pretty well. Would love to support a PYFA integration. I'll implement the below to help plus anything else you might need.

  • Add new Fleet-Up API endpoints for adding/updating fittings
  • New API endpoints for managing doctrines(?)
  • Support ESI fitting format(?) for fitting data

PYFA / Fleet-Up integration would be great to see.

To add more to this thread:

Pyfa Fleet-Up Service

I think basic workflow would look like this:

  1. Authentication:

    • As @BoraVyvorant mentioned, User would need to provide App Key/Userid/API KEY which User would generate on fleet-up at /Api/MyApps and /Api/MyKeys

    • Then Pyfa would need to make a call to:

      {AppKey}/{UserId}/{ApiCode}/MyGroupMemberships

    • This will provide us with a list of groups, User selects a group now we have the GroupID to fetch fits on.

  2. Fetching Fits

    • With the GroupID we can now list all fittings that the said Group has access to through the endpoints Fittings/{GroupID}



      • If we wanted server side filtering by Doctrines we could get fittings by doctrines with Doctrines/{GroupID} then DoctrineFittings/{DoctrineID}


      • (Doctrine ID is apart of a fitting object passed from fitting/{FittingID}, I doubt there will be a need for this, pyfa could sort them if needed.


      • From there grabbing a fit via Fitting/{FittingID} and parsing json into a pyfa fit object.



  3. Posting Fits

    • I see two paths here

      1. On export to fleet-up fetch doctrines and give the ability to select which doctrine(s?) to post to.

      2. On an existing fit, keeping track of fleet-up's FittingID, for the ability to update an existing fit.

      3. Thinking about (1) would the ability to create a Doctrine from pyfa be useful?

    • I see some gotchas might happen with different fittings from different groups and keeping track of which groupID credentials to use when wanting to post.

    UI

    • Will need to have a key management modal for fleet up keys, It seems you can be apart of more than one group with a key pair set. I'm not familiar with the various use cases people have but could it be possible that they would want to be able to have multiple key/pair sets? I suppose it won't really matter, Pyfa will just need to be aware of the GroupId for GETting
    • For viewing fits I imagine we can take over the "Browse Eve Fitting" view, that said for fleet up users, you can either view by Doctrine, or view all, does this separation make sense? What is the most logical way to view fleet up fits? I can imagine Browse Fitting view with a drop down above the fittings list to be able to select a doctrine.
    • I see some issues around where to show the properties that a certain fit is a fleet-up fit, not sure if this needs to be accounted for, but it might be an issue when wanting to update a fit back up to fleet-up

Fleet up questions

  1. What will the required information will be needed to post/update a fit/format
  2. @fleet-up does that seem like the reasonable flow of your api?

Will take a closer look at proposal when I can, but so far looks like a good start. 👍

Having never really used Fleetup personally, I'm a little confused with it's structure. Is it based soley on "groups" (generally corporations / alliance)? Can a user have their own fitting repositories without having to choose a "group"

Just want to make sure I'm clear on the requirements / general structure of the third party

Thinking about (1) would the ability to create a Doctrine from pyfa be useful?

I'm actually thinking about revisiting tagging support in pyfa fairly soon, which is a long-sought after feature. I have a lot of ideas about it, but I think we can basically call "doctrines" tags in pyfa

For viewing fits I imagine we can take over the "Browse Eve Fitting" view
Probably. Either directly integrated, or maybe just copied, depending on implementation.

There's definitely going to be questions about how to manage linked fits, use cases, general workflow, etc. We should aim for simple integration for now, and expand once we get a bit of feedback from users on what they may like to see in terms of integration support. I should probably reintroduce myself to fleet up as well to get my head wrapped around what folks might like to use it for. :)

Also, don't know if it was mentioned or not, but there's probably some form of user access permissions (for viewing / adding / deleting fits), would need to figure out how to store that information so that we can avoid showing the user options to post if they can't actually post. :)

Yeah there seems to be an enabled option in “my groups” but need better to understand what access control implications are

Any word from fleet-up on implementing the required endpoints? :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ErikKalkoken picture ErikKalkoken  ·  5Comments

Dawnkeeper picture Dawnkeeper  ·  5Comments

Altarus94 picture Altarus94  ·  4Comments

eliasmarobin picture eliasmarobin  ·  13Comments

Neugeniko picture Neugeniko  ·  11Comments