Usage

$ kinit
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/groups/
{"result": [{"name": "test-group", "uri": "http://$(hostname)/fasjson/v1/groups/test-group/"}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/groups/admins/
{"result": {"name": "test-group", "uri": "http://fasjson.example.test/fasjson/v1/groups/test-group/"}}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/groups/admins/sponsors/
{"result": [{"username": "admin", [...]}, {"username": "user123", [...]}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/groups/admins/members/
{"result": [{"username": "admin", [...]}, {"username": "user123", [...]}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/users/admin/
{"result": {"username": "admin", "surname": "Administrator", "givenname": "", "emails": ["admin@$(domain)"], "ircnicks": null, "locale": "fr_FR", "timezone": null, "gpgkeyids": null, "creation": "2020-04-23T10:16:35", "locked": false, "uri": "http://$(hostname)/fasjson/v1/users/admin/"}}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/users/admin/groups/
{"result": [{"name": "test-group", "uri": "http://$(hostname)/fasjson/v1/groups/test-group/"}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/search/users/?username=admin&ircnick=admin&surname=admin&givenname=admin&email=admin@example.test
{"result": [{"username": "admin", [...]}, {"username": "badminton", [...]}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/search/users/?group=firstgroup&group=othergroup
{"result": [{"username": "admin", [...]}, {"username": "badminton", [...]}]}
$ curl --negotiate -u : http://$(hostname)/fasjson/v1/me/
{"result": {"dn": "uid=admin,cn=users,cn=accounts,dc=$(domain)", "username": "admin", "uri": "http://$(hostname)/fasjson/v1/users/admin/"}}

There is an interactive autogenerated documentation that can be reached by opening https://fasjson.fedoraproject.org/docs/v1/. Please note however that at the moment the example curl commands displayed by this documentation lack the necessary -u : --negotiate options, you’ll have to remember to add them.

Searching for users

Endpoint: /v1/search/users/

Users can be search by many user attributes, refer to the autogenerated documentation for details. They can also be searched by group names with the group search term. If multiple group search terms are given, the resulting users will be the members of all the groups.