Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Remove reliance on DatabaseKit/Fluent #65

Open
0xTim opened this issue Mar 26, 2019 · 4 comments
Open

Remove reliance on DatabaseKit/Fluent #65

0xTim opened this issue Mar 26, 2019 · 4 comments
Labels
enhancement New feature or request
Projects

Comments

@0xTim
Copy link
Member

0xTim commented Mar 26, 2019

It would be great to be able to use the auth package when implementing something like the repository pattern. In SteamPress for Vapor 3, there is no knowledge of Fluent (at least the inner package). All the models are held behind repositories accessible from services. This would be fine, except for the fact things like BasicAuthenticatable that all the web sessions stuff relies on use DatabaseConnection to get the user for verifying. Because it's done in the protocol there's no way to implement the extensions yourself but still conform, meaning you have to reimplement most of the auth package 😞

Would be great to be fixed with Vapor 4!

@calebkleveter
Copy link
Member

I think you mean Vapor 4?

@0xTim
Copy link
Member Author

0xTim commented Mar 26, 2019

Nothing to see here 😆

@tanner0101 tanner0101 added the enhancement New feature or request label Apr 2, 2019
@tanner0101 tanner0101 added this to To Do in Vapor 4 via automation Apr 2, 2019
@tanner0101
Copy link
Member

@0xTim I agree, this is something I've wanted to do. I think we could follow a pattern similar to how Vapor 4 will have separate packages for Fluent and FluentKit:

  • vapor/fluent: FluentKit + Vapor (providers / integration)
  • vapor/fluent-kit: 95% of Fluent, models, query builders, protocols, etc.

Following that, we could have vapor/auth and vapor/auth-kit. Where vapor/auth provides all the nice default extensions where your authenticable items are also models. That would allow you to theoretically use AuthKit with any ORM.

The other alternative would just be accepting that vapor/auth is an auth layer for Fluent. The win there is less complexity / package bloat.

@0xTim
Copy link
Member Author

0xTim commented Apr 6, 2019

@tanner0101 yeah an AuthKit and FluentAuth package would make sense. I think accepting vapor/auth as an auth layer for Fluent as it currently stands would be wrong as there's lots of stuff in here that doesn't need Fluent and could be broken out relatively easily with little changes. But splitting them into different packages with no dependency on Fluent would be a big win, especially for things like APIs that don't touch Fluent

@tanner0101 tanner0101 moved this from Backlog to Done in Vapor 4 Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Vapor 4
  
Done
Development

No branches or pull requests

3 participants