Giter Site home page Giter Site logo

Comments (8)

Nhowka avatar Nhowka commented on May 22, 2024

This includes the definition of roles for using with requires_role?

from saturn.

Krzysztof-Cieslak avatar Krzysztof-Cieslak commented on May 22, 2024

Hey, yes - I've added helpers for requiring role, or claim in authentication refactoring I've done today.

The helpers that can be plugged in scope, pipeline or controller are here - https://github.com/SaturnFramework/Saturn/blob/master/src/Saturn/Authentication.fs

The helpers for application - https://github.com/SaturnFramework/Saturn/blob/master/src/Saturn/Application.fs#L157-L235

Feedback welcomed.

from saturn.

Nhowka avatar Nhowka commented on May 22, 2024

Not really the helper I had in mind, but something for that part: https://vtquan.github.io/fsharp/setting-up-services-with-giraffe/

from saturn.

Krzysztof-Cieslak avatar Krzysztof-Cieslak commented on May 22, 2024

Oooh.. sure, adding those should be possible!

from saturn.

Nhowka avatar Nhowka commented on May 22, 2024

There is a lot that can be added to IServiceCollection and not sure where the line should be drawn. Maybe just having a helper to add a custom service to ServicesConfig would be enough in the case where the user need it.

from saturn.

Krzysztof-Cieslak avatar Krzysztof-Cieslak commented on May 22, 2024

Helper for adding custom ServiceConfig configuration definitely should be there - I'm not sure why it's not here since I've added similar helpers for both ApplicationBuilder and `WebHostBuilder - https://github.com/SaturnFramework/Saturn/blob/master/src/Saturn/Application.fs#L77-L85

And looking again at the link you've provided - how does AddAuthorization fits with non-ASP.NET-MVC applications (i.e. Giraffe)? MSFT documentation essentially points to using [<Authorize>] attributes on ASP.NET-MVC controllers which is not the case for us.

from saturn.

Nhowka avatar Nhowka commented on May 22, 2024

I was probably assuming stuff that is not true. I was understanding that these policies could behave as a role alias so I could use them in requires_role. Like the link, using Administrators to match Administrator and Moderators to match Administrator or Moderator.

Could we have a requires_policy with that behaviour?

from saturn.

Krzysztof-Cieslak avatar Krzysztof-Cieslak commented on May 22, 2024

Authentication helpers implemented in 3fe92ab

Authorization helpers discussion moved to #26

from saturn.

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.