Projet

Général

Profil

Development #10055

Refine data provider management

Ajouté par Mikaël Ates il y a environ 8 ans. Mis à jour il y a environ 8 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
23 février 2016
Echéance:
% réalisé:

0%

Temps estimé:
Hors marché:
Non
Patch proposed:
Non
Planning:

Description

Data is requested using the login or link endpoint view giving space delimited scopes in the `fd_scopes` get parameter just to get closer to the authorization request format.

Data is stored in a dictionnary of scopes in the session, not in a list, and rename it fc-data.

Build FD request url using urlencode.


Fichiers

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • prefer using django.utils.http.urlencode than urllib.urlencode which does not handle unicode strings
  • ugly
    [fc_data.setdefault(k, []).extend(v) for k, v in self.data.items()]

    I would just do the following as I do not think we need to keep many version of the same data:
    request.session['fc-data'] = self.data
    
  • too much wrapping, we accept 100 characters line now in all our projects.
                    self.logger.debug('fc data in session %s',
                        self.request.session['fc-data'])
    

    maybe we could just log the data received, i.e. self.data, not fc_data.

Anyway it's a bit too early to do anything complicated around FD as we still do not know how we are gonna use them in the future, probably we will use some kind of proxy oauth2 view to request access to proxy web-service view targeting the fd (as in the OAuth2 backend for mon.service-public.fr).

#2

Mis à jour par Mikaël Ates il y a environ 8 ans

Ok on your last remarq and django.utils.http.urlencode and too much wrapping.

I would prefer to keep for now in session all ressources resolved, then merging the two dicts of lists, do you prefer ?

for scope in self.data:
    fc_data.setdefault(scope, []).extend(self.data[scope])

#3

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

Yes it's more readable. Ack for all.

#4

Mis à jour par Mikaël Ates il y a environ 8 ans

  • Statut changé de Nouveau à Fermé

Formats disponibles : Atom PDF