Code Monkey home page Code Monkey logo

Comments (5)

thomaxxl avatar thomaxxl commented on August 13, 2024

Hi Patrick,

IIRC the IDs are generated server-side so it shouldn't be possible to create an item with a user-defined ID so the POSTs to /model/{modelId}/ should probably be deleted altogether.
Does a POST to /model/{modelId}/ work for you?

no worries about the amount of issues, I want this thing to be perfect :), I'll be on holiday next week however :| .

from safrs.

thomaxxl avatar thomaxxl commented on August 13, 2024

In 10aee62 I removed the swagger and changed the jsonapi POST request processing a bit. I try to follow the spec, eg. https://jsonapi.org/format/#crud-creating-client-ids .

Also, you should be careful when implementing fine-grained access control: We're pretty much reading and writing to the database directly, this may be a bit dangerous. For example by requesting related resources through the "include" request parameter it may be possible to retrieve information that you would like to hide. Similarly, POSTing to a relationship may cause related database objects to be updated.

from safrs.

patvdleer avatar patvdleer commented on August 13, 2024

is there an easy way to hide certain attributes? for example the password hash of a user?

from safrs.

thomaxxl avatar thomaxxl commented on August 13, 2024

You can overwrite the _s_to_dict method. I should update the readme, it is still called to_dict there.

from safrs.

thomaxxl avatar thomaxxl commented on August 13, 2024

fixed in v2.1.0

from safrs.

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.