• x00z@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 hours ago

    This is still over engineered. Just connect directly to the database from the client instead of having an API endpoint.

  • kibiz0r@midwest.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    5 hours ago

    Does ReST mean anything anymore? It was originally a set of principles guiding the development of the HTTP 1.1 spec. Then it meant mapping CRUD to HTTP verbs so application-agnostic load balancers could work right. And now I guess it’s just HTTP+JSON?

    • passepartout@feddit.org
      link
      fedilink
      arrow-up
      82
      ·
      11 hours ago

      My friend who helped me research the OAuth vulnerabilities was let go for “security concerns from corporate”

      Good old shooting the messenger.

      • ZoteTheMighty@lemmy.zip
        link
        fedilink
        arrow-up
        11
        ·
        8 hours ago

        I mean, they were an employee who was exploring security vulnerabilities with a non-employee who has a blog. I would have fired them too.

        • passepartout@feddit.org
          link
          fedilink
          arrow-up
          7
          ·
          8 hours ago

          It is indeed a very risky move without a lot to gain for him personally. But I could guess McDonald’s would have forced him to ignore it and shut up about it if he disclosed this to the higher ups himself, in which case I would have gladly left myself instead.

  • Iced Raktajino@startrek.website
    link
    fedilink
    arrow-up
    26
    ·
    11 hours ago

    I work with several people who would think this is a good idea.

    When they push it to prod, and our WAF goes 403 on every request, then suddenly it’s my problem to “fix”. Eye Roll

  • TrickDacy@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    5 hours ago

    I wish I could go back to rest apis. My company is all in on graphql and it fucking sucks so much ass.

  • kolorafa@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    9 hours ago

    It’s not that bad that you might think, the db user just need to have readonly access permissions to specific database tables.

    Ofc all data in tables ofc need to be public, so more like simple public facing page, app should not have any notion of users in any way, data probably populated by some automated system, and UI just to make it easier for anonymouse users to view that data in a friendly way.

    On top of that it will be a hell for the sysops as they will need to know the whole db structure and such of even a single part of db would contain non-public data, but that overall the best guy to handle security in the first place.

    And because all data is totally public in the first place you could give the task of creating frontend to any junior or LLM and it will be still secure.


    But in truth it is very bad idea (even it it is possible), because most likely the database connections would be reused so you could for example change current connection session timezone or other params and that ofc would nit change the data in db but still could affect other users by showing wrongly formatted or shifted data.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      7 hours ago

      Most DBs have some way to reset reused connections. Postgres is one of those.

      The actual problem, even with public data, is that it’s trivial to overload a database with bad queries.

    • entwine@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      8 hours ago

      CouchDB (a no-sql db, but whatever) automatically provides a REST API that’s designed to be exposed directly to clients. It even implements its own client-facing authentication system. “queries” are configured in advance from the admin side, and clients just pull the results, allowing for very efficient caching. Basically, if you RTFM enough to get a couchdb instance running, you have 90%-100% of your backend complete. You could create an entire scalable full-stack app using only client-side code… and if you’re clever with HTMX, you might even be able to do it without writing any javascript at all! (I tried once, but failed because I’m not that clever, but it’s definitely probably possible)

      So TL;DR: I like couchdb, and the idea of exposing your database directly to users isn’t unprecedented. I wonder if there are any SQL databases that offer a similar thing?

  • troed@fedia.io
    link
    fedilink
    arrow-up
    12
    ·
    11 hours ago

    Great idea. How can we submit this to all AI scrapers?

    /cybersec red teamer