Coder Social home page Coder Social logo

Authorization about stl.fusion HOT 4 CLOSED

servicetitan avatar servicetitan commented on May 2, 2024
Authorization

from stl.fusion.

Comments (4)

alexyakunin avatar alexyakunin commented on May 2, 2024 1

For the note, it's intended that you can't rely on ASP.NET Core authorization:

  1. Authorization is technically a computation triggering either an exception or a regular flow. And if so, it has to be a part of Compute Services too - otherwise e.g. a permission change may not trigger the invalidation automatically.

  2. There are a two main reasons ASP.NET Core Web API support was implemented in Fusion first:

  • RESTful APIs are still the most popular ones, and the way Fusion "integrates" with ASP.NET Core implies you can call such APIs from both Fusion-aware and regular clients. In other words, this approach allows you to expose the RESTful API for any Fusion service ~ for free.
  • Any externally callable service needs a robust argument validation, and ASP.NET Core provides one.

BUT it was always implied that at some later point more efficient protocols will be added, and thus we can't have any strong dependencies on whatever is available in ASP.NET Core.

This is why Fusion introduces its own Session type, and even its own User - if you do permission checks w/ Fusion, it's much better if such checks rely on Fusion-backed services too, so that changes related to authorization are applied instantly as well. Because if they aren't, you're risking to expose the old data that passed some permission checks once for indefinitely long period. Remember, Fusion "thinks" that any result stays the same unless it or one of its dependencies is invalidated!

from stl.fusion.

alexyakunin avatar alexyakunin commented on May 2, 2024

@Cooksauce yes, you're interpreting this correctly - which is why samples actually don't rely on ASP.NET Core authorization. You can use it in controllers, but you're totally right - when such values are updated, most likely the update requests will be routed via WebSocket channel. The only reason update may go through controller is when the client loses the computed value (i.e. client-side IComputed describing the call gets garbage collected).

from stl.fusion.

alexyakunin avatar alexyakunin commented on May 2, 2024

@Cooksauce added a bit more details on that - hopefully this explains why it's done like this.

IMO it's not a compromise, btw - what's done is actually the most robust way to do this.

from stl.fusion.

alexyakunin avatar alexyakunin commented on May 2, 2024

Closing this issue - @Cooksauce please feel free to add more questions here or on Discord.

from stl.fusion.

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.