Development #7862
API to list/search/add users
100%
Description
In Welco we are using authentic as the database of users, this requires API endpoints to list, search, and add users.
Fichiers
Révisions associées
api_views: pep8ness (#7862)
api: new user API (#7862)
You can list/add/change users. Security is enforced by basic authentication,
session authentication and role permissions:
- custom_user.view_user for listing,
- custom_user.add_user for creating,
- custom_user.change_user for updating,
- custom_user.delete_user for deleting.
add new API tests (fixes #7862)
add missing utils.py (fixes #7862)
tests: fix user listing API tests (#7862)
Historique
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
I would like to implement the SCIM 1.1 protocol, see http://www.simplecloud.info/specs/draft-scim-api-01.html , it seems adapted to our goal and not too complicated.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
I started designing the thing there; http://git.entrouvert.org/authentic.git/log/?h=wip/scim11
Mis à jour par Frédéric Péters il y a plus de 8 ans
Do note I no longer need it. (welco also needs to get some user information from wcs (current forms) so it was easier to go and take everything from wcs).
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Assigné à mis à Benjamin Dauvergne
- Priorité changé de Normal à Haut
- Version cible changé de future à 2.2.0
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
Started, I need to look security mechanism from django-rest-framework to get something compatible with Publik of doing that (HMAC signature of URLs).
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0001-wip.patch 0001-wip.patch ajouté
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0001-api_urls-fix-regexs-7862.patch 0001-api_urls-fix-regexs-7862.patch ajouté
- Fichier 0002-api_views-pep8ness-7862.patch 0002-api_views-pep8ness-7862.patch ajouté
- Fichier 0003-api-new-user-API-7862.patch 0003-api-new-user-API-7862.patch ajouté
- Fichier 0004-add-new-API-tests-fixes-7862.patch 0004-add-new-API-tests-fixes-7862.patch ajouté
- Patch proposed changé de Non à Oui
L'API démarre à l'URL /api/users/
on peut y faire un POST du genre:
Content-Type: application/json { "ou": "default", "phone": "97989898", "password": "joiewjfoiejwfoiewjf", "first_name": "Benjamin", "last_name": "Dauvergne" }
Et on recevra la réponse, pour l'instant le mot de passe est obligatoire, pour un compte "contact" y mettre simplement une chaîne aléatoire.
{ "id": 12, "ou": "default", "adresse": "", "code_postal": "", "phone": "97989898", "password": "pbkdf2_sha256$15000$rV8T7ppVFGPz$e+hD9it0M8/acgpxd8xAD6ZXo8Xrjo7EJ3yiWxPzSqE=", "last_login": "2015-11-13T09:42:19.554696Z", "is_superuser": false, "uuid": "365c34d7339d4bd5ba47869465d74705", "username": null, "first_name": "Benjamin", "last_name": "Dauvergne", "email": "", "is_staff": false, "is_active": true, "date_joined": "2015-11-13T09:42:19.554933Z" }
La droits d'accès sont les mêmes que dans le /manage, "ou" est le slug de l'entité pas son id, l'authentification géré est pour l'instant HTTP Basic ou Session, l'authentification par signature arrive (ticket ouvert sur hobo).
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0003-api-new-user-API-7862.patch 0003-api-new-user-API-7862.patch ajouté
- ne pas créer la classe dérivée d'User dans un contexte global à car elle accède à la base (en mode multitenant ça ne marchera pas)
- poser une limite de pagination par défaut de 10
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Statut changé de En cours à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit authentic2|e997338736c0de63d073a1a5dab6d694b1ea177f.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
Appliqué par commit authentic2|eae49803114a22924887e8463f1f953f627aa9fe.
Mis à jour par Benjamin Dauvergne il y a environ 8 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a plus de 6 ans
- Statut changé de Solution déployée à Fermé
api_urls: fix regexs (#7862)