Comments (5)
At this point, buddy-auth matches the urls as is but not passes any parameter to the request. But, I think it would be interesting feature to add.
I will add it in the next version, thanks for reporting this.
from buddy.
Thanks!
Currently I've solved it by manually adding in the clout library.
Something like
(defn match
[request routes]
(into {} (map #(clout/route-matches % request) routes)))
(def project-routes
["/projects/:project-id"
"/projects/:project-id/*"])
(defn is-owner?
[request]
(let [params (match request project-routes)]
; ... auth logic here
))
(def rules
{:uris project-routes
:handler {:and [logged-in? is-owner?]}})
Which is less than elegant, but works for now! Thank you for considering the feature 😄
from buddy.
I just have released the buddy-auth 0.5.1 (it is not included in the last metapackage of buddy, so you can include the new dependency expliclty).
from buddy.
Thanks 👍
from buddy.
@joelkuiper Thanks for pointing me in the right direction! Works great but I agree on the elegant part 💯
@niwinz Thanks for the great library - really enjoying it!
from buddy.
Related Issues (20)
- Example of token-backend HOT 3
- libsodium support welcome? HOT 3
- Unsupported major.minor version 52.0 with java 1.7 and buddy 0.2.0 HOT 4
- Token based auth HOT 8
- buddy 0.1.1 -> 0.2.3 unauthorized-handler does not redirect when asked to HOT 1
- Keccak digest & hasher
- Documentation out of date HOT 2
- Write Rationale in README HOT 2
- Link to Buddy submodules in README HOT 3
- Json Web Token support
- Link to latest docs broken HOT 6
- Exception java.io.FileNotFoundException: Could not locate cats/monad/exception__init.class HOT 4
- No such var: codecs/bytes->safebase64 HOT 2
- Issue when compiling to uberjar HOT 5
- ClojureScript Port HOT 2
- Question about session HOT 1
- Getting an error `JCE cannot authenticate the provider BC` when done UberJar HOT 1
- JWT Backend not using authfn when authentication header is missing
- 0.1.0 beta4 not in clojars HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buddy.