Projet

Général

Profil

Development #5275

New example code for creating authentic2 plugins (for IdP or authentication)

Ajouté par Benjamin Dauvergne il y a plus de 9 ans. Mis à jour il y a plus de 9 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
13 août 2014
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

The example contains an adapt.sh script which simplify renaming of all files when creating a real plugin.


Fichiers

Révisions associées

Révision 2976ab87 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 9 ans

Replace existing example for creating authentic2 plugins (fixes #5275)

This plugin implements all possible hooks by an authentic2 plugin to
show how to implement them.

It should be kept in sync with the rest of authentic2.

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Assigné à mis à Benjamin Dauvergne
#2

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-samples-replace-a2_test_plugin-by-a-new-example-for-.patch supprimé
#3

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-samples-replace-a2_test_plugin-by-a-new-example-for-.patch ajouté
#4

Mis à jour par Frédéric Péters il y a plus de 9 ans

For a real template I would go for an empty class Plugin(authentic2.foobar.BasePlugin) (well, as empty as possible, we probably need get_apps); ditto for models, I would prefer it done like django apps, just a "# add your models in this file" line.

I am note sure about it, but could the plugin_enabled decorator find its way into authentic?

s/Uperrcase/Uppercase/.

#5

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

Frédéric Péters a écrit :

For a real template I would go for an empty class Plugin(authentic2.foobar.BasePlugin) (well, as empty as possible, we probably need get_apps); ditto for models, I would prefer it done like django apps, just a "# add your models in this file" line.

Ok for the models.py file (and the admin.py too) but for the __init__.py and its plugin class I'm more inclined to let as much hooks visible, as there is not much documentation on them for now.

I am note sure about it, but could the plugin_enabled decorator find its way into authentic?

Not so easy as it depends on the plugin specific ENABLED settings. I could make the enabled status part of the signature of the plugin class with some kind of is_enabled(cls) method, and use it in a generic decorator which would receive the name of the plugin as a parameter but it seems a lot of work for something that each plugin can do his own way.

#7

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-samples-replace-a2_test_plugin-by-a-new-example-for-.patch supprimé
#8

Mis à jour par Frédéric Péters il y a plus de 9 ans

Fine, then for method signatures, but is the content of service_list and logout_list really necessary? It seems confusing, especially as it embeds actual questions (the "# utils.get_actions() ?" line).

#9

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

Here with only docstrings describing interfaces of service_list() and logout_list().

#10

Mis à jour par Frédéric Péters il y a plus de 9 ans

Ok, thanks; I believe this is fine as is.

#11

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#12

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF