Skip to main content

FCAT Connector

An Alliance Auth plugin that serves doctrines and structures as read-only JSON, so FCAT can read them instead of having them typed in by hand.

What it does

Two endpoints, both GET:

Endpoint Serves Needs
/fcat/api/doctrines/ Doctrines and fits, with modules as type ids and slots the fittings app
/fcat/api/structures/ Friendly structures: name, system, type, state, fuel the structures app
/fcat/api/fat/ The caller's own recent FAT links, and who has clicked each fleetactivitytracking
/fcat/api/srp/ Recent SRP fleets: code, status, pending count, running total srp

/fcat/api/ returns the connector version and which of these this auth can actually serve.

Every source app is optional. If an auth doesn't run one, its endpoint returns 501 and everything else keeps working. fleetactivitytracking and srp ship with Alliance Auth itself, so they are normally present; fittings and structures are separate installs.

FAT and SRP are read-only here too, which is the point of including them: an FC can see who has clicked and what is still owed without leaving the fleet, while creating links, approving requests and setting payouts stay on the website where they belong.

What it does not do

  • No write endpoints. Every view is a GET and nothing in this app calls .save() on anything but its own key records.
  • No outbound traffic. It reads tables Alliance Auth already has. It never calls ESI, zKillboard, Discord or anything else, so it adds nothing to your server's rate limits or its IP reputation. FCAT does hit ESI and zKill, but from each FC's own machine.
  • No background tasks, no Celery jobs, no scheduled anything.
  • No menu entry for members. The FCAT Connector page only appears for people who hold fcatconnector.basic_access.

How access works

FCAT sends an API key in an X-FCAT-Key header. The key does not grant access to anything. It only says which Alliance Auth user is asking. Every request is then answered as that user:

  1. The key resolves to a user, or the request is rejected.
  2. That user must have fcatconnector.basic_access, so an admin can lock the whole thing to one group.
  3. The endpoint re-checks the source app's own permission: fittings.access_fittings, structures.basic_access, auth.fleetactivitytracking or srp.access_srp.
  4. The query uses the source app's own visibility rules. Structures go through Structure.objects.visible_for_user(user), which is the same call the structures app's own pages make, so view_corporation_structures / view_alliance_structures / view_all_structures behave identically. Doctrines mirror the category-group filtering in the fittings app's views.py.

Nothing can come back through FCAT that the same person could not open in their browser. Pull someone from a group in auth and they lose it on their next request, with no change needed at the FCAT end.

Keys are stored hashed. The plaintext is shown once when the key is created and cannot be recovered, so a database dump does not hand anyone a working key.

Install

pip install aa-fcat-connector

Add both of these to local.py. There is a copy in local.py.example next to this file:

INSTALLED_APPS += ["fcatconnector"]
APPS_WITH_PUBLIC_VIEWS = ["fcatconnector"]

Without the second line FCAT gets a login page instead of data. Auth wraps every plugin URL in main_character_required, which is login_required underneath, so a request with a key and no browser session is redirected. A plugin can't waive that for itself; auth only honours UrlHook(excluded_views=...) for apps named in this setting.

It covers the three /fcat/api/ views and nothing else. The page FCs generate keys on keeps the normal login gate. "Public" here means auth stops checking for a session, not that the endpoints are unauthenticated: each one still resolves the key to a user and answers as that user, or 401s.

Already have entries in APPS_WITH_PUBLIC_VIEWS? Append, don't replace.

Then:

python manage.py migrate

Restart auth. Grant fcatconnector.basic_access to whichever group should have it, usually FCs.

Getting a key

FCs do this themselves. There is nothing for an admin to hand out.

An FC with the permission gets a FCAT Connector entry in the sidebar. They open it, name the machine, and click Generate. The key is shown once and stored hashed, so it cannot be recovered or read out of a database dump. They paste it into FCAT and that is the last time they think about it.

They can revoke their own keys from the same page. Admins can see every key and revoke any of them from the Django admin, but cannot create one for somebody else.

Reviewing it

models.py is the key store; views.py holds the FC's page and every endpoint. The security-relevant lines are the two querysets in views.py that decide what a user can see, and ApiKey.resolve. Those are the ones worth your attention.

Licence

MIT, same as FCAT.

Metadata

Release files for aa-fcat-connector 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aa-fcat-connector 0.2.0
File Size Uploaded Provenance Actions
aa_fcat_connector-0.2.0.tar.gz 14.3 kB Without provenance Details for aa_fcat_connector-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aa-fcat-connector 0.2.0
File Interpreter ABI Platform Actions
aa_fcat_connector-0.2.0-py3-none-any.whl Python 3 none any Details for aa_fcat_connector-0.2.0-py3-none-any.whl

Total release size: 30.3 kB

Release files / aa_fcat_connector-0.2.0.tar.gz

Download URL aa_fcat_connector-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1d46c79fef507b3cfc427038f8163a9efab31e7b677d49efe88c75305233feb
BLAKE2b-256 checksum
How to use checksums
1c267941c13b26035b4cdfe28c292d675230cb6d013f8fdfcc7ccbd26a73c4c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / aa_fcat_connector-0.2.0-py3-none-any.whl

Download URL aa_fcat_connector-0.2.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b44f07c22e8f626e41ae2d600eb70e16adfc8c439213cf6b6bdf6dafab9331dc
BLAKE2b-256 checksum
How to use checksums
73363457badfc01c3150c019f581ca651ca48962e6318d7f6a9e762449aff472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for aa-fcat-connector 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page