From 5f6e90e32ec89e2e3328aaf02f845e02607f8f15 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 27 May 2015 16:07:44 +0200 Subject: [PATCH] Rename MSP plugin as FC plugin --- COPYING | 2 +- MANIFEST.in | 6 +- README | 56 ++- debian/changelog | 2 +- debian/control | 4 +- setup.py | 28 +- .../__init__.py | 4 +- .../app_settings.py | 23 +- .../auth_frontends.py | 12 +- .../backends.py | 8 +- .../locale/fr/LC_MESSAGES/django.po | 12 +- .../models.py | 29 +- .../static/authentic2_auth_fc/css/msp.css | 3 + .../authentic2_auth_fc/css/screen.msp.css | 347 ++++++++++++++++++ .../img/Copie de illus_3.jpg | Bin .../img/Copie-de-ombre_content_h.png | Bin .../img/Logo_URSSAF_2012_RVB_EnSavoirPlus.png | Bin .../authentic2_auth_fc}/img/__illus_1.jpg | Bin .../authentic2_auth_fc}/img/__illus_2.jpg | Bin .../authentic2_auth_fc}/img/__illus_4.jpg | Bin .../img/bandeau_non_federe.jpg | Bin .../authentic2_auth_fc}/img/bg/clip.png | Bin .../authentic2_auth_fc}/img/bg/coin.png | Bin .../authentic2_auth_fc}/img/bg/connect.png | Bin .../authentic2_auth_fc}/img/bg/degrade.jpg | Bin .../authentic2_auth_fc}/img/bg/fermer.png | Bin .../authentic2_auth_fc}/img/bg/fleche.png | Bin .../img/bg/fleche_blanche.png | Bin .../authentic2_auth_fc}/img/bg/note.png | Bin .../authentic2_auth_fc}/img/bg/note2.gif | Bin .../authentic2_auth_fc}/img/bg/note2.png | Bin .../authentic2_auth_fc}/img/bg/retour.png | Bin .../authentic2_auth_fc}/img/bg/user.png | Bin .../authentic2_auth_fc}/img/bg/user_2.png | Bin .../img/bg/utilisateur.png | Bin .../img/bg/utilisateur_blanc.png | Bin .../authentic2_auth_fc}/img/bk-input.gif | Bin .../img/bkg_creerVotreCompte.png | Bin .../img/bkg_puce_bonnes_raisons.gif | Bin .../authentic2_auth_fc}/img/btn_minscrire.png | Bin .../authentic2_auth_fc}/img/deg_content_b.png | Bin .../authentic2_auth_fc}/img/deg_content_h.png | Bin .../authentic2_auth_fc}/img/degrade.jpg | Bin .../static/authentic2_auth_fc}/img/fleche.png | Bin .../img/fond_content_m.png | Bin .../img/fond_ensavoirplus_b.jpg | Bin .../img/fond_ensavoirplus_h.jpg | Bin .../authentic2_auth_fc}/img/fond_titre_1.png | Bin .../authentic2_auth_fc}/img/fond_titre_2.png | Bin .../authentic2_auth_fc}/img/fond_titre_3.png | Bin .../authentic2_auth_fc}/img/fond_titre_4.png | Bin .../authentic2_auth_fc}/img/illus_1.jpg | Bin .../authentic2_auth_fc}/img/illus_2.jpg | Bin .../authentic2_auth_fc}/img/illus_3.jpg | Bin .../authentic2_auth_fc}/img/illus_4.jpg | Bin .../authentic2_auth_fc}/img/lie_avec_msp.jpg | Bin .../static/authentic2_auth_fc}/img/logo_1.jpg | Bin .../authentic2_auth_fc}/img/logo_10.png | Bin .../authentic2_auth_fc}/img/logo_11.jpg | Bin .../static/authentic2_auth_fc}/img/logo_2.jpg | Bin .../static/authentic2_auth_fc}/img/logo_3.jpg | Bin .../static/authentic2_auth_fc}/img/logo_5.jpg | Bin .../static/authentic2_auth_fc}/img/logo_6.jpg | Bin .../static/authentic2_auth_fc}/img/logo_6.png | Bin .../static/authentic2_auth_fc}/img/logo_7.png | Bin .../static/authentic2_auth_fc}/img/logo_8.jpg | Bin .../static/authentic2_auth_fc}/img/logo_9.png | Bin .../img/logo_visite_guidee.gif | Bin .../img/mon_service-public.fr.png | Bin .../img/mon_service-public.fr_petit.png | Bin .../authentic2_auth_fc}/img/old logo_3.jpg | Bin .../authentic2_auth_fc}/img/old logo_4.jpg | Bin .../img/old__visite_guidee.png | Bin .../img/ombre_content_b.png | Bin .../img/ombre_content_h.png | Bin .../img/ombre_content_h2.png | Bin .../img/ombre_content_m.png | Bin .../img/toutes_vos_demarches.png | Bin .../authentic2_auth_fc}/img/visite_guidee.png | Bin .../img/vous_etes_actuellement.png | Bin .../static/authentic2_auth_fc}/js/domready.js | 0 .../js/getElementsByClassName-1.0.1.js | 0 .../static/authentic2_auth_fc}/js/oauth.js | 0 .../close-popup-redirect.html | 0 .../authentic2_auth_fc}/confirm_unlink.html | 16 +- .../authentic2_auth_fc/connecting.html | 35 ++ .../authentic2_auth_fc}/documents.html | 2 +- .../authentic2_auth_fc}/link_management.html | 14 +- .../templates/authentic2_auth_fc/linking.html | 55 +++ .../templates/authentic2_auth_fc/login.html | 1 + .../authentic2_auth_fc}/unlink_done.html | 4 +- src/authentic2_auth_fc/urls.py | 25 ++ .../views.py | 170 +++++---- .../css/Copie de screen.msp.css | 339 ----------------- .../static/authentic2_auth_msp/css/msp.css | 3 - .../authentic2_auth_msp/css/screen.msp.css | 347 ------------------ .../authentic2_auth_msp/connecting.html | 35 -- .../authentic2_auth_msp/linking.html | 55 --- .../templates/authentic2_auth_msp/login.html | 1 - src/authentic2_auth_msp/urls.py | 26 -- 100 files changed, 655 insertions(+), 1009 deletions(-) rename src/{authentic2_auth_msp => authentic2_auth_fc}/__init__.py (68%) rename src/{authentic2_auth_msp => authentic2_auth_fc}/app_settings.py (67%) rename src/{authentic2_auth_msp => authentic2_auth_fc}/auth_frontends.py (70%) rename src/{authentic2_auth_msp => authentic2_auth_fc}/backends.py (61%) rename src/{authentic2_auth_msp => authentic2_auth_fc}/locale/fr/LC_MESSAGES/django.po (86%) rename src/{authentic2_auth_msp => authentic2_auth_fc}/models.py (76%) create mode 100644 src/authentic2_auth_fc/static/authentic2_auth_fc/css/msp.css create mode 100644 src/authentic2_auth_fc/static/authentic2_auth_fc/css/screen.msp.css rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/Copie de illus_3.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/Copie-de-ombre_content_h.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/Logo_URSSAF_2012_RVB_EnSavoirPlus.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/__illus_1.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/__illus_2.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/__illus_4.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bandeau_non_federe.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/clip.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/coin.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/connect.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/degrade.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/fermer.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/fleche.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/fleche_blanche.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/note.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/note2.gif (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/note2.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/retour.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/user.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/user_2.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/utilisateur.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bg/utilisateur_blanc.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bk-input.gif (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bkg_creerVotreCompte.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/bkg_puce_bonnes_raisons.gif (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/btn_minscrire.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/deg_content_b.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/deg_content_h.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/degrade.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fleche.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_content_m.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_ensavoirplus_b.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_ensavoirplus_h.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_titre_1.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_titre_2.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_titre_3.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/fond_titre_4.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/illus_1.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/illus_2.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/illus_3.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/illus_4.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/lie_avec_msp.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_1.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_10.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_11.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_2.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_3.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_5.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_6.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_6.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_7.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_8.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_9.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/logo_visite_guidee.gif (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/mon_service-public.fr.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/mon_service-public.fr_petit.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/old logo_3.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/old logo_4.jpg (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/old__visite_guidee.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/ombre_content_b.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/ombre_content_h.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/ombre_content_h2.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/ombre_content_m.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/toutes_vos_demarches.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/visite_guidee.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/img/vous_etes_actuellement.png (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/js/domready.js (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/js/getElementsByClassName-1.0.1.js (100%) rename src/{authentic2_auth_msp/static/authentic2_auth_msp => authentic2_auth_fc/static/authentic2_auth_fc}/js/oauth.js (100%) rename src/{authentic2_auth_msp/templates/authentic2_auth_msp => authentic2_auth_fc/templates/authentic2_auth_fc}/close-popup-redirect.html (100%) rename src/{authentic2_auth_msp/templates/authentic2_auth_msp => authentic2_auth_fc/templates/authentic2_auth_fc}/confirm_unlink.html (74%) create mode 100644 src/authentic2_auth_fc/templates/authentic2_auth_fc/connecting.html rename src/{authentic2_auth_msp/templates/authentic2_auth_msp => authentic2_auth_fc/templates/authentic2_auth_fc}/documents.html (62%) rename src/{authentic2_auth_msp/templates/authentic2_auth_msp => authentic2_auth_fc/templates/authentic2_auth_fc}/link_management.html (84%) create mode 100644 src/authentic2_auth_fc/templates/authentic2_auth_fc/linking.html create mode 100644 src/authentic2_auth_fc/templates/authentic2_auth_fc/login.html rename src/{authentic2_auth_msp/templates/authentic2_auth_msp => authentic2_auth_fc/templates/authentic2_auth_fc}/unlink_done.html (87%) create mode 100644 src/authentic2_auth_fc/urls.py rename src/{authentic2_auth_msp => authentic2_auth_fc}/views.py (75%) delete mode 100644 src/authentic2_auth_msp/static/authentic2_auth_msp/css/Copie de screen.msp.css delete mode 100644 src/authentic2_auth_msp/static/authentic2_auth_msp/css/msp.css delete mode 100644 src/authentic2_auth_msp/static/authentic2_auth_msp/css/screen.msp.css delete mode 100644 src/authentic2_auth_msp/templates/authentic2_auth_msp/connecting.html delete mode 100644 src/authentic2_auth_msp/templates/authentic2_auth_msp/linking.html delete mode 100644 src/authentic2_auth_msp/templates/authentic2_auth_msp/login.html delete mode 100644 src/authentic2_auth_msp/urls.py diff --git a/COPYING b/COPYING index 9790db9..fb1febb 100644 --- a/COPYING +++ b/COPYING @@ -1,2 +1,2 @@ -authentic2-auth-msp is entirely under the copyright of Entr'ouvert and +authentic2-auth-fc is entirely under the copyright of Entr'ouvert and distributed under the license AGPLv3 or later. diff --git a/MANIFEST.in b/MANIFEST.in index 2687c98..0ea4faa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include COPYING -recursive-include src/authentic2_auth_msp/templates *.html -recursive-include src/authentic2_auth_msp/static *.js *.css *.png *.gif *.jpg -recursive-include src/authentic2_auth_msp/locale *.po *.mo +recursive-include src/authentic2_auth_fc/templates *.html +recursive-include src/authentic2_auth_fc/static *.js *.css *.png *.gif *.jpg +recursive-include src/authentic2_auth_fc/locale *.po *.mo diff --git a/README b/README index d1264f1..bc3aaa2 100644 --- a/README +++ b/README @@ -1,40 +1,38 @@ -authentic2-auth-msp +authentic2-auth-fc =================== -Authentic2 plugin to authenticate against *mon.service-public.fr* the french -citizen portal. +Authentic2 plugin to authenticate against *France Connect* the french +citizen and entreprise SSO. Installation ============ -- Install with `pip install authentic2-auth-msp` -- Add `A2_MSP_ENABLED = True` to your `local_settings.py` file +- Install with `pip install authentic2-auth-fc` +- Add `A2_FC_ENABLED = True` to your `local_settings.py` file - Define the needed parameters:: - MSP_CLIENT_ID = 'id assigned by DIMAP' - MSP_CLIENT_SECRET = 'secret assigned by DIMAP' - MSP_CLIENT_CERTIFICATE = ('/my-path/my-certificate.crt', '/my-path/my-certificate.key') - MSP_VERIFY_CERTIFICATE = False + FC_CLIENT_ID = 'id assigned by DISIC' + FC_CLIENT_SECRET = 'secret assigned by DISIC' + FC_VERIFY_CERTIFICATE = False # True for production -Test -==== +Platforms +========= -When testing agains the test platform of mon.service-public.fr you must change +When testing against another platform of France Connect you must change the default endpoints URL in your `local_settings.py` file:: -You must plug the application views in your urls.py file by adding this -content:: - MSP_AUTHORIZE_URL = 'https://mon.service-public.fr/apis/app/oauth/authorize' - MSP_TOKEN_URL = 'https://mon.service-public.fr:2443/apis/app/oauth/token' - MSP_API_URL = 'https://mon.service-public.fr:2443/apis/' + FC_AUTHORIZE_URL = 'https://fcp.integ01.dev-franceconnect.fr/api/v1/authorize' + FC_TOKEN_URL = 'https://fcp.integ01.dev-franceconnect.fr/api/v1/token' + FC_USERINFO_URL = 'https://fcp.integ01.dev-franceconnect.fr/api/v1/userinfo' + FC_LOGOUT_URL = 'https://fcp.integ01.dev-franceconnect.fr/api/v1/logout' -MSP Gateway +FC Gateway =========== -If you want to use the OAuth2 proxy to share the access to MSP apis, you must -user a shared cache backend: through memcached, redis or the ORM. For -example if you have a memcached installed just add the following fragment to -your settings:: +If you want to use the OAuth2 proxy to share the access to a FC data +provider, you must user a shared cache backend: through memcached, redis +or the ORM. For example if you have a memcached installed just add the +following fragment to your settings:: CACHES = { 'default': { @@ -43,19 +41,19 @@ your settings:: } } -If you want a specific cache backend for the MSP plugin, use the `msp` name +If you want a specific cache backend for the FC plugin, use the `fc` name for your cache instead of `default`. -The msp application also provides an OAuth2 gateway to MSP. To configure it your +The fc application also provides an OAuth2 gateway to FC. To configure it your just need to provider a list of client_id, client_secret pairs in your settings, like that:: - MSP_CLIENT_CREDENTIALS = (('client_id1', 'client_secret1'),) + FC_CLIENT_CREDENTIALS = (('client_id1', 'client_secret1'),) The following URL are provided: -- /msp/authorize : like the authorize URL of MSP -- /msp/access_token : like the access_token URL of MSP -- /msp/documents/ : like the document list REST API endpoint of MSP -- /msp/documents// : like the document retrieval REST API endpoint of MSP +- /fc/authorize : like the authorize URL of FC +- /fc/access_token : like the access_token URL of FC +- /fc/documents/ : like the document list REST API endpoint of FC +- /fc/documents// : like the document retrieval REST API endpoint of FC diff --git a/debian/changelog b/debian/changelog index d0a8486..a97fd81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-authentic2-auth-msp (1.0.1-0) wheezy; urgency=low +python-authentic2-auth-fc (1.0.1-0) wheezy; urgency=low * First upstream release diff --git a/debian/control b/debian/control index 086c805..d5182a2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: python-authentic2-auth-msp +Source: python-authentic2-auth-fc Maintainer: Benjamin Dauvergne Section: python Priority: optional @@ -7,7 +7,7 @@ Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6), debhelper (>= Standards-Version: 3.9.1 X-Python-Version: >= 2.6 -Package: python-authentic2-auth-msp +Package: python-authentic2-auth-fc Architecture: all Depends: ${misc:Depends}, python-authentic2 (>= 2.1.2), diff --git a/setup.py b/setup.py index ea38253..45ce642 100755 --- a/setup.py +++ b/setup.py @@ -86,29 +86,29 @@ README = file(os.path.join( os.path.dirname(__file__), 'README')).read() -setup(name='authentic2-auth-msp', +setup(name='authentic2-auth-fc', version=get_version(), license='AGPLv3', - description='Authentic2 mon.service-public.fr plugin', + description='Authentic2 FranceConnect plugin', long_description=README, author="Entr'ouvert", - url='https://repos.entrouvert.org/authentic2-auth-msp.git', + url='https://repos.entrouvert.org/authentic2-auth-fc.git', author_email="info@entrouvert.com", packages=find_packages('src'), package_dir={ '': 'src', }, package_data={ - 'authentic2_auth_msp': [ - 'templates/authentic2_auth_msp/*.html', - 'static/authentic2_auth_msp/js/*.js', - 'static/authentic2_auth_msp/css/*.css', - 'static/authentic2_auth_msp/img/*.png', - 'static/authentic2_auth_msp/img/*.jpg', - 'static/authentic2_auth_msp/img/*.gif', - 'static/authentic2_auth_msp/img/bg/*.png', - 'static/authentic2_auth_msp/img/bg/*.jpg', - 'static/authentic2_auth_msp/img/bg/*.gif', + 'authentic2_auth_fc': [ + 'templates/authentic2_auth_fc/*.html', + 'static/authentic2_auth_fc/js/*.js', + 'static/authentic2_auth_fc/css/*.css', + 'static/authentic2_auth_fc/img/*.png', + 'static/authentic2_auth_fc/img/*.jpg', + 'static/authentic2_auth_fc/img/*.gif', + 'static/authentic2_auth_fc/img/bg/*.png', + 'static/authentic2_auth_fc/img/bg/*.jpg', + 'static/authentic2_auth_fc/img/bg/*.gif', 'locale/fr/LC_MESSAGES/django.po', 'locale/fr/LC_MESSAGES/django.mo', ], @@ -121,7 +121,7 @@ setup(name='authentic2-auth-msp', ], entry_points={ 'authentic2.plugin': [ - 'authentic2-auth-msp = authentic2_auth_msp:Plugin', + 'authentic2-auth-fc = authentic2_auth_fc:Plugin', ], }, cmdclass={ diff --git a/src/authentic2_auth_msp/__init__.py b/src/authentic2_auth_fc/__init__.py similarity index 68% rename from src/authentic2_auth_msp/__init__.py rename to src/authentic2_auth_fc/__init__.py index a671b59..4ec9f60 100644 --- a/src/authentic2_auth_msp/__init__.py +++ b/src/authentic2_auth_fc/__init__.py @@ -9,7 +9,7 @@ class Plugin(object): return [__name__, 'sekizai'] def get_authentication_backends(self): - return ['authentic2_auth_msp.backends.MspBackend'] + return ['authentic2_auth_fc.backends.FcBackend'] def get_auth_frontends(self): - return ['authentic2_auth_msp.auth_frontends.MspFrontend'] + return ['authentic2_auth_fc.auth_frontends.FcFrontend'] diff --git a/src/authentic2_auth_msp/app_settings.py b/src/authentic2_auth_fc/app_settings.py similarity index 67% rename from src/authentic2_auth_msp/app_settings.py rename to src/authentic2_auth_fc/app_settings.py index 31a6b24..5bcbeb3 100644 --- a/src/authentic2_auth_msp/app_settings.py +++ b/src/authentic2_auth_fc/app_settings.py @@ -21,15 +21,19 @@ class AppSettings(object): @property def authorize_url(self): - return self._setting('AUTHORIZE_URL', 'https://mon.service-public.fr/apis/app/oauth/authorize') + return self._setting('AUTHORIZE_URL', 'https://fcp.integ01.dev-franceconnect.fr/api/v1/authorize') @property def token_url(self): - return self._setting('TOKEN_URL', 'https://mon.service-public.fr:2443/apis/app/oauth/token') + return self._setting('TOKEN_URL', 'https://fcp.integ01.dev-franceconnect.fr/api/v1/token') @property - def api_url(self): - return self._setting('API_URL', 'https://mon.service-public.fr:2443/apis/') + def userinfo_url(self): + return self._setting('USERINFO_URL', 'https://fcp.integ01.dev-franceconnect.fr/api/v1/userinfo') + + @property + def logout_url(self): + return self._setting('LOGOUT_URL', 'https://fcp.integ01.dev-franceconnect.fr/api/v1/logout') @property def client_id(self): @@ -39,10 +43,6 @@ class AppSettings(object): def client_secret(self): return self._setting('CLIENT_SECRET') - @property - def client_certificate(self): - return self._setting('CLIENT_CERTIFICATE', None) - @property def verify_certificate(self): return self._setting('VERIFY_CERTIFICATE', False) @@ -51,13 +51,8 @@ class AppSettings(object): def client_credentials(self): return self._setting('CLIENT_CREDENTIALS', ()) - @property - def more_url(self): - return self._setting('MORE_URL', 'https://mon.service-public.fr/') - - import sys -app_settings = AppSettings('A2_MSP_') +app_settings = AppSettings('A2_FC_') app_settings.__name__ = __name__ sys.modules[__name__] = app_settings diff --git a/src/authentic2_auth_msp/auth_frontends.py b/src/authentic2_auth_fc/auth_frontends.py similarity index 70% rename from src/authentic2_auth_msp/auth_frontends.py rename to src/authentic2_auth_fc/auth_frontends.py index 6871692..c5eda0f 100644 --- a/src/authentic2_auth_msp/auth_frontends.py +++ b/src/authentic2_auth_fc/auth_frontends.py @@ -5,25 +5,25 @@ from django.shortcuts import render from . import app_settings -class MspFrontend(object): +class FcFrontend(object): def enabled(self): return app_settings.enabled def name(self): - return gettext_noop('mon.service-public.fr') + return gettext_noop('France Connect') def id(self): - return 'msp' + return 'fc' def login(self, request, *args, **kwargs): - if 'nomsp' in request.GET: + if 'nofc' in request.GET: return context_instance = kwargs.pop('context_instance', None) - return render(request, 'authentic2_auth_msp/login.html', + return render(request, 'authentic2_auth_fc/login.html', context_instance=context_instance) def profile(self, request, *args, **kwargs): context_instance = kwargs.pop('context_instance', None) or RequestContext(request) - return render_to_string('authentic2_auth_msp/linking.html', {'popup': True}, + return render_to_string('authentic2_auth_fc/linking.html', {'popup': True}, context_instance=context_instance) diff --git a/src/authentic2_auth_msp/backends.py b/src/authentic2_auth_fc/backends.py similarity index 61% rename from src/authentic2_auth_msp/backends.py rename to src/authentic2_auth_fc/backends.py index 5ae14f5..64a105e 100644 --- a/src/authentic2_auth_msp/backends.py +++ b/src/authentic2_auth_fc/backends.py @@ -3,12 +3,12 @@ from . import models from django.contrib.auth.backends import ModelBackend -class MspBackend(ModelBackend): +class FcBackend(ModelBackend): def authenticate(self, agc=None, **kwargs): try: - msp_account = models.MspAccount.objects.get(agc=agc) - return msp_account.user - except models.MspAccount.DoesNotExist: + fc_account = models.FcAccount.objects.get(agc=agc) + return fc_account.user + except models.FcAccount.DoesNotExist: pass def get_saml2_authn_context(self): diff --git a/src/authentic2_auth_msp/locale/fr/LC_MESSAGES/django.po b/src/authentic2_auth_fc/locale/fr/LC_MESSAGES/django.po similarity index 86% rename from src/authentic2_auth_msp/locale/fr/LC_MESSAGES/django.po rename to src/authentic2_auth_fc/locale/fr/LC_MESSAGES/django.po index 092b4e4..6032643 100644 --- a/src/authentic2_auth_msp/locale/fr/LC_MESSAGES/django.po +++ b/src/authentic2_auth_fc/locale/fr/LC_MESSAGES/django.po @@ -1,11 +1,11 @@ # Authentic2 Mon.service-public.fr plugin french translations # Copyright (C) 2014 Entr'ouvert -# This file is distributed under the same license as the authentic2-auth-msp package. +# This file is distributed under the same license as the authentic2-auth-fc package. # Benjamin Dauvergne {% endaddtoblock %} - {% addtoblock "css" %}{% endaddtoblock %} - {% addtoblock "js" %}{% endaddtoblock %} - {% addtoblock "js" %}{% endaddtoblock %} - {% addtoblock "js-endpage" %}{% endaddtoblock %} -