fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

[FAS3] Add routes to receive group/users contact info as json #197

Closed skrzepto closed 3 years ago

skrzepto commented 8 years ago

In hubs we would like to query fas3 to retrieve group/user info. We can scrape the web page but it might make more sense to retrieve the info as json.

There is a privacy concern but I noticed groups has a bool private column and people has bool privacy column. We can return empty fields if set to private for example

return {'email': '', 'irc': ''}
skrzepto commented 8 years ago

hows this json output for groups?

selection_046

skrzepto commented 8 years ago

I'm working on this branch for this https://github.com/skrzepto/fas/tree/json-info

skrzepto commented 8 years ago

Here's the people output selection_047

laxathom commented 8 years ago

Hi @skrzepto , FAS comes with a RESTful API already (from a dedicated route). There is no need to provide another route which lead to code duplication and security concern.. 3rd parties have to use the RESTful API - within the token mechanism in place - in order to retrieve any kind of registered information.

I can understand that you might need more view on the FAS's architecture and available features to drive your contribution. Just lemme know.

skrzepto commented 8 years ago

@laxathom could you help me out how to querry FAS3 for the screenshots above? They will be needed for fedora-hubs.

laxathom commented 8 years ago

Sure thing. On your local FAS instance, log in as an admin and go to settings's panel (from the top menu). From there, you will be able to generate a private token for your 3rd party app. Use the API key from the pop-up to request group info from the RESTful API.

See https://github.com/fedora-infra/python-fedora/blob/feature/fas3_support/fedora/client/fas2.py for example on how to talk to fas with a token api.

pypingou commented 8 years ago

@laxathom is the API documented somewhere on FAS itself?

laxathom commented 8 years ago

Not yet :disappointed: . That's something I need to do.

skrzepto commented 8 years ago

@laxathom Need any help writing documentation? I can help.

laxathom commented 8 years ago

Hey @skrzepto , for sure any help is welcomed. Could you give me a couple of time to wrap up a first-start guideline (I use to using sphinx to build docs) so you can continue and add more stuff to it. I will start with the basis so you can start asap on adding more stuff to it.

ryanlerch commented 3 years ago

Closing this issue as the FAS project is now archived, not actively developed, and unmaintained.

FAS was replaced in March 2021 by Fedora Accounts (https://accounts.fedoraproject.org).

If this issue is a Feature Request that you forsee might be beneficial to Fedora Accounts, please refile it against Noggin