Projet

Général

Profil

Development #5279

Expression attribute source

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

Statut:
Nouveau
Priorité:
Bas
Assigné à:
-
Catégorie:
-
Version cible:
Début:
14 août 2014
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:

Description

I consider the proposed code as experimental and ,reading history on safe python code evaluation, very likely unsecure, so it's just for discussing.

It depends upon an untested safe-expression evaluator library1 which is the part likely unsecure. This library parse expression as python abstract syntax tree and only keep type of nodes deemed secure.

A secure implementation would maybe use a JS interpreter augmented with a sandbox2 module and should be able to flag "broken" code so that is not run anymore after detection (if the broken property can only be detected at runtime, like exceding the timeout).

1 https://github.com/bdauvergne/python-safe-expression

2 https://github.com/gf3/sandbox


Fichiers

Historique

#1

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

What would the usecase be? I ask this because it looks to me like it duplicates the existing attributes_ng/sources/function.py module.

#2

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

It would be easier to configure through the UI, function.py can do more (I mean "have side effects") but you need to create a python module or put the definition in config.py to configure it. Expression attribute would use a safe and common language so that users of a SaaS service can code their own "smart" attributes. Java applications often use the Javascript interpreter provided by the JDK for that.

#3

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

  • Assigné à mis à Benjamin Dauvergne
#4

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

  • Priorité changé de Normal à Bas
#5

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

  • Version cible mis à future
#6

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

  • Patch proposed changé de Oui à Non
#7

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

  • Assigné à Benjamin Dauvergne supprimé

Formats disponibles : Atom PDF