Skip to content

Commit 28d155f

Browse files
committed
Merge branch 'master' into dev
2 parents 7db869b + ad3907e commit 28d155f

File tree

6 files changed

+335
-56
lines changed

6 files changed

+335
-56
lines changed

LICENSE

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
Eclipse Public License -v 1.0
2+
3+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
4+
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
5+
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6+
7+
1. DEFINITIONS
8+
9+
"Contribution" means:
10+
11+
a) in the case of the initial Contributor, the initial code and documentation
12+
distributed under this Agreement, and
13+
14+
b) in the case of each subsequent Contributor:
15+
16+
i) changes to the Program, and
17+
18+
ii) additions to the Program;
19+
20+
where such changes and/or additions to the Program originate from and are
21+
distributed by that particular Contributor. A Contribution 'originates' from a
22+
Contributor if it was added to the Program by such Contributor itself or anyone
23+
acting on such Contributor's behalf. Contributions do not include additions to
24+
the Program which: (i) are separate modules of software distributed in
25+
conjunction with the Program under their own license agreement, and (ii) are
26+
not derivative works of the Program.
27+
28+
"Contributor" means any person or entity that distributes the Program.
29+
30+
"Licensed Patents " mean patent claims licensable by a Contributor which are
31+
necessarily infringed by the use or sale of its Contribution alone or when
32+
combined with the Program.
33+
34+
"Program" means the Contributions distributed in accordance with this
35+
Agreement.
36+
37+
"Recipient" means anyone who receives the Program under this Agreement,
38+
including all Contributors.
39+
40+
2. GRANT OF RIGHTS
41+
42+
a) Subject to the terms of this Agreement, each Contributor hereby grants
43+
Recipient a non-exclusive, worldwide, royalty-free copyright license to
44+
reproduce, prepare derivative works of, publicly display, publicly perform,
45+
distribute and sublicense the Contribution of such Contributor, if any, and
46+
such derivative works, in source code and object code form.
47+
48+
b) Subject to the terms of this Agreement, each Contributor hereby grants
49+
Recipient a non-exclusive, worldwide, royalty-free patent license under
50+
Licensed Patents to make, use, sell, offer to sell, import and otherwise
51+
transfer the Contribution of such Contributor, if any, in source code and
52+
object code form. This patent license shall apply to the combination of the
53+
Contribution and the Program if, at the time the Contribution is added by
54+
the Contributor, such addition of the Contribution causes such combination
55+
to be covered by the Licensed Patents. The patent license shall not apply to
56+
any other combinations which include the Contribution. No hardware per se is
57+
licensed hereunder.
58+
59+
c) Recipient understands that although each Contributor grants the licenses to
60+
its Contributions set forth herein, no assurances are provided by any
61+
Contributor that the Program does not infringe the patent or other
62+
intellectual property rights of any other entity. Each Contributor disclaims
63+
any liability to Recipient for claims brought by any other entity based on
64+
infringement of intellectual property rights or otherwise. As a condition to
65+
exercising the rights and licenses granted hereunder, each Recipient hereby
66+
assumes sole responsibility to secure any other intellectual property rights
67+
needed, if any. For example, if a third party patent license is required to
68+
allow Recipient to distribute the Program, it is Recipient's responsibility
69+
to acquire that license before distributing the Program.
70+
71+
d) Each Contributor represents that to its knowledge it has sufficient
72+
copyright rights in its Contribution, if any, to grant the copyright license
73+
set forth in this Agreement.
74+
75+
3. REQUIREMENTS
76+
77+
A Contributor may choose to distribute the Program in object code form under
78+
its own license agreement, provided that:
79+
80+
a) it complies with the terms and conditions of this Agreement; and
81+
82+
b) its license agreement:
83+
84+
i) effectively disclaims on behalf of all Contributors all warranties and
85+
conditions, express and implied, including warranties or conditions of title
86+
and non-infringement, and implied warranties or conditions of
87+
merchantability and fitness for a particular purpose;
88+
89+
ii) effectively excludes on behalf of all Contributors all liability for
90+
damages, including direct, indirect, special, incidental and consequential
91+
damages, such as lost profits;
92+
93+
iii) states that any provisions which differ from this Agreement are offered by
94+
that Contributor alone and not by any other party; and
95+
96+
iv) states that source code for the Program is available from such Contributor,
97+
and informs licensees how to obtain it in a reasonable manner on or through
98+
a medium customarily used for software exchange.
99+
100+
When the Program is made available in source code form:
101+
102+
a) it must be made available under this Agreement; and
103+
104+
b) a copy of this Agreement must be included with each copy of the Program.
105+
106+
Contributors may not remove or alter any copyright notices contained within the
107+
Program.
108+
109+
Each Contributor must identify itself as the originator of its Contribution, if
110+
any, in a manner that reasonably allows subsequent Recipients to identify the
111+
originator of the Contribution.
112+
113+
4. COMMERCIAL DISTRIBUTION
114+
115+
Commercial distributors of software may accept certain responsibilities with
116+
respect to end users, business partners and the like. While this license is
117+
intended to facilitate the commercial use of the Program, the Contributor who
118+
includes the Program in a commercial product offering should do so in a manner
119+
which does not create potential liability for other Contributors. Therefore, if
120+
a Contributor includes the Program in a commercial product offering, such
121+
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
122+
every other Contributor ("Indemnified Contributor") against any losses, damages
123+
and costs (collectively "Losses") arising from claims, lawsuits and other legal
124+
actions brought by a third party against the Indemnified Contributor to the
125+
extent caused by the acts or omissions of such Commercial Contributor in
126+
connection with its distribution of the Program in a commercial product
127+
offering. The obligations in this section do not apply to any claims or Losses
128+
relating to any actual or alleged intellectual property infringement. In order
129+
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
130+
Contributor in writing of such claim, and b) allow the Commercial Contributor
131+
to control, and cooperate with the Commercial Contributor in, the defense and
132+
any related settlement negotiations. The Indemnified Contributor may
133+
participate in any such claim at its own expense.
134+
135+
For example, a Contributor might include the Program in a commercial product
136+
offering, Product X. That Contributor is then a Commercial Contributor. If that
137+
Commercial Contributor then makes performance claims, or offers warranties
138+
related to Product X, those performance claims and warranties are such
139+
Commercial Contributor's responsibility alone. Under this section, the
140+
Commercial Contributor would have to defend claims against the other
141+
Contributors related to those performance claims and warranties, and if a court
142+
requires any other Contributor to pay any damages as a result, the Commercial
143+
Contributor must pay those damages.
144+
145+
5. NO WARRANTY
146+
147+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
148+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
149+
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
150+
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
151+
Recipient is solely responsible for determining the appropriateness of using
152+
and distributing the Program and assumes all risks associated with its exercise
153+
of rights under this Agreement , including but not limited to the risks and
154+
costs of program errors, compliance with applicable laws, damage to or loss of
155+
data, programs or equipment, and unavailability or interruption of operations.
156+
157+
6. DISCLAIMER OF LIABILITY
158+
159+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
160+
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
161+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
162+
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
163+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
164+
WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
165+
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
166+
167+
7. GENERAL
168+
169+
If any provision of this Agreement is invalid or unenforceable under applicable
170+
law, it shall not affect the validity or enforceability of the remainder of the
171+
terms of this Agreement, and without further action by the parties hereto, such
172+
provision shall be reformed to the minimum extent necessary to make such
173+
provision valid and enforceable.
174+
175+
If Recipient institutes patent litigation against any entity (including a
176+
cross-claim or counterclaim in a lawsuit) alleging that the Program itself
177+
(excluding combinations of the Program with other software or hardware)
178+
infringes such Recipient's patent(s), then such Recipient's rights granted
179+
under Section 2(b) shall terminate as of the date such litigation is filed.
180+
181+
All Recipient's rights under this Agreement shall terminate if it fails to
182+
comply with any of the material terms or conditions of this Agreement and does
183+
not cure such failure in a reasonable period of time after becoming aware of
184+
such noncompliance. If all Recipient's rights under this Agreement terminate,
185+
Recipient agrees to cease use and distribution of the Program as soon as
186+
reasonably practicable. However, Recipient's obligations under this Agreement
187+
and any licenses granted by Recipient relating to the Program shall continue
188+
and survive.
189+
190+
Everyone is permitted to copy and distribute copies of this Agreement, but in
191+
order to avoid inconsistency the Agreement is copyrighted and may only be
192+
modified in the following manner. The Agreement Steward reserves the right to
193+
publish new versions (including revisions) of this Agreement from time to time.
194+
No one other than the Agreement Steward has the right to modify this Agreement.
195+
The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation
196+
may assign the responsibility to serve as the Agreement Steward to a suitable
197+
separate entity. Each new version of the Agreement will be given a
198+
distinguishing version number. The Program (including Contributions) may always
199+
be distributed subject to the version of the Agreement under which it was
200+
received. In addition, after a new version of the Agreement is published,
201+
Contributor may elect to distribute the Program (including its Contributions)
202+
under the new version. Except as expressly stated in Sections 2(a) and 2(b)
203+
above, Recipient receives no rights or licenses to the intellectual property of
204+
any Contributor under this Agreement, whether expressly, by implication,
205+
estoppel or otherwise. All rights in the Program not expressly granted under
206+
this Agreement are reserved.
207+
208+
This Agreement is governed by the laws of the State of New York and the
209+
intellectual property laws of the United States of America. No party to this
210+
Agreement will bring a legal action under this Agreement more than one year
211+
after the cause of action arose. Each party waives its rights to a jury trial
212+
in any resulting litigation.
213+

README.md

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ clj-redis-session
22
=================
33

44
[![Build Status][travis-badge]][travis]
5-
6-
*A Redis backed Clojure/Ring session store*
5+
[![Dependencies Status][deps-badge]][deps]
6+
[![Clojars Project][clojars-badge]][clojars]
7+
[![Tag][tag-badge]][tag]
8+
[![JDK version][jdk-v]](.travis.yml)
9+
[![Clojure version][clojure-v]](project.clj)
710

811
[![Project Logo][logo]][logo-large]
912

13+
*A Redis backed Clojure/Ring session store*
14+
1015

1116
What is it?
1217
-----------
@@ -19,25 +24,41 @@ hierarchical data, actually any `*print-str*`able clojure data types.
1924
Why?
2025
----
2126

22-
The reason I wrote `clj-redis-session` is that the only Redis-backed
23-
sesssion store I could find ([rrss][rrss])
24-
doesn't support hierarchical data structures, e.g. lists, maps.
27+
The reason `clj-redis-session` was written was that there was a need for
28+
a Redis-backed session store that supported hierarchical data structures,
29+
and the only Redis session store available ([rrss][rrss]) ... didn't.
2530

2631

2732
Installation
2833
------------
2934

3035
Add
3136
```clojure
32-
33-
[clojusc/clj-redis-session "2.1.4"]
37+
[clojusc/clj-redis-session "3.0.0"]
3438
```
3539
to `:dependencies` in your `project.clj`.
3640

3741

3842
Usage
3943
-----
4044

45+
**¡Important!**
46+
47+
As of version 3.0.0 (as maintained in the Clojusc org), the
48+
namespace for `clj-redis-session` has changed! Whereas before the
49+
following was used:
50+
51+
```clj
52+
clj-redis-session.core
53+
```
54+
55+
This now needs to be updated to:
56+
57+
```clj
58+
ring.redis.session
59+
```
60+
61+
4162
`clj-redis-session` is a drop-in replacement for Ring native session
4263
stores. `clj-redis-session` uses [Carmine][carmine] as its Redis client.
4364

@@ -47,7 +68,7 @@ First, require the session namespaces:
4768
```clj
4869
(ns your-app
4970
(:require [ring.middleware.session :as ring-session]
50-
[clj-redis-session.core :refer [redis-store]]))
71+
[ring.redis.session :refer [redis-store]]))
5172
```
5273

5374
Then define the Redis [connection options][redis conn opts] as you would when
@@ -72,6 +93,11 @@ application sessions:
7293
(...)))
7394
```
7495

96+
If you are using `friend` for auth/authz, you will want to thread your security
97+
wrappers first, and then the session. If you are using `ring-defaults` to wrap
98+
for the site defaults, you'll want to thread the session wrapper before the
99+
defaults are set.
100+
75101
Automatically expire sessions after 12 hours:
76102

77103
```clj
@@ -99,6 +125,8 @@ License
99125

100126
Copyright © 2013 Zhe Wu <[email protected]>
101127

128+
Copyright © 2016 Clojure-Aided Enrichment Center
129+
102130
Distributed under the Eclipse Public License, the same as Clojure.
103131

104132

@@ -109,3 +137,11 @@ Distributed under the Eclipse Public License, the same as Clojure.
109137
[rrss]: https://github.com/paraseba/rrss
110138
[carmine]: https://github.com/ptaoussanis/carmine
111139
[redis conn opts]: https://github.com/ptaoussanis/carmine/blob/master/src/taoensso/carmine.clj#L26
140+
[deps]: http://jarkeeper.com/clojusc/clj-redis-session
141+
[deps-badge]: http://jarkeeper.com/clojusc/clj-redis-session/status.svg
142+
[tag-badge]: https://img.shields.io/github/tag/clojusc/clj-redis-session.svg
143+
[tag]: https://github.com/clojusc/clj-redis-session/tags
144+
[clojure-v]: https://img.shields.io/badge/clojure-1.8.0-blue.svg
145+
[jdk-v]: https://img.shields.io/badge/jdk-1.7+-blue.svg
146+
[clojars]: https://clojars.org/clojusc/clj-redis-session
147+
[clojars-badge]: https://img.shields.io/clojars/v/clojusc/clj-redis-session.svg

project.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
(defproject clojusc/clj-redis-session "2.1.4"
2-
:url "https://github.com/wuzhe/clj-redis-session"
1+
(defproject clojusc/clj-redis-session "3.0.0"
2+
:url "https://github.com/clojusc/clj-redis-session"
33
:description "Redis-backed Clojure/Ring session store"
4-
:dependencies [[com.taoensso/carmine "2.15.0"]
5-
[org.clojure/clojure "1.5.0"]
4+
:license
5+
{:name "Eclipse Public License"
6+
:url "https://opensource.org/licenses/EPL-1.0"}
7+
:dependencies [[com.taoensso/carmine "2.15.1"]
8+
[org.clojure/clojure "1.8.0"]
69
[org.clojure/tools.logging "0.3.1"]
710
[ring/ring-core "1.6.0-beta6"]]
811
:profiles {

src/clj_redis_session/core.clj

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)