Code Monkey home page Code Monkey logo

Comments (8)

rmorshea avatar rmorshea commented on June 8, 2024

Before going with the database-backed approach, I have one more idea. What if users configured a secret in their settings for Django IDOM that we used to symmetrically encrypt the pickled parameters before including them in the rendered templates. This both protects sensitive information and prevents injection attacks without requiring anything to be stored in the database.

from reactpy-django.

Archmonger avatar Archmonger commented on June 8, 2024

We should develop that as an optional feature in an follow-up PR. To do that properly would require additional dependencies.

from reactpy-django.

rmorshea avatar rmorshea commented on June 8, 2024

My impression is that it might take more time to figure out how to properly expire these database entries vs adding a setting for a secret and using it to encrypting the parameters using the cryptography library.

from reactpy-django.

Archmonger avatar Archmonger commented on June 8, 2024

There is added complexity to cryptography though, mostly related to key rotation (handling/upgrading old keys to new keys without breaking). Additionally, a common issue with django DB encryption libraries is determining a way to do it without breaking AlterField migration operations.

from reactpy-django.

rmorshea avatar rmorshea commented on June 8, 2024

It looks like there's an option for key rotation: https://cryptography.io/en/latest/fernet/#cryptography.fernet.MultiFernet

With that said, I'm realizing that implementing an encryption-based solution in a way that's convenient for the user will involve saving these keys in the database and providing utilities to rotate them. This would allow us to make proper key-management and generation our responsibility rather than the user's and doing that would require some care.

Given this, I'm open to going with whatever approach you think will be easiest to complete the fastest.

from reactpy-django.

Archmonger avatar Archmonger commented on June 8, 2024

There's a lot to discuss about approach/compatibility/algorithms/etc. And it will require a non-trivial amount of code to accomplish within Django.

IMO encryption support deserves it's own issue/PR.

from reactpy-django.

rmorshea avatar rmorshea commented on June 8, 2024

It seems like to complete this then, you'll go with approaches 1 & 3 for expiration?

from reactpy-django.

Archmonger avatar Archmonger commented on June 8, 2024

Yeah. Although option 2 is technologically ideal, it does not seem convenient for end-users.

from reactpy-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.