-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add short lived token support in case of query security (event source…
… not supporting header nor post) #165
- Loading branch information
Showing
5 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(ns swarmpit.slt | ||
(:require [clojure.core.cache :as cache] | ||
[swarmpit.uuid :refer [uuid]] | ||
[swarmpit.base64 :as base64])) | ||
|
||
(def cache (atom (cache/ttl-cache-factory {} :ttl 10000))) | ||
|
||
(defn- generate | ||
[] | ||
(->> (uuid) | ||
(base64/encode))) | ||
|
||
(defn create | ||
[] | ||
(let [slt (generate)] | ||
(swap! cache assoc slt "slt") | ||
slt)) | ||
|
||
(defn valid? | ||
[slt] | ||
(if (cache/has? @cache slt) | ||
true | ||
false)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters