Skip to content

Commit ae35370

Browse files
committed
Update README.md
1 parent e768fd4 commit ae35370

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,57 @@ rubycas-server-core
44

55
The core logic for handling CAS requests independent of any particular storage or web presentation technology.
66

7-
87
## Requirements
98

109
* ruby 1.9.x
1110

11+
## Adapters
12+
Currently available adapters are:
13+
* [rubycas-server-activerecord](https://github.com/kollegorna/rubycas-server-activerecord)
14+
* [rubycas-server-memory](https://github.com/vasilakisfil/rubycas-server-memory)
15+
16+
If you want to create a new adapter check these 2 adapters how they are implemented. Essentially you need to implement the following methods for each ticket:
17+
18+
```ruby
19+
20+
class XXXTicket
21+
def initialize(options = {})
22+
end
23+
24+
#deprecated
25+
def self.find_by_ticket(ticket)
26+
#returns the ticket based on the ticket id
27+
#it will be removed soon
28+
end
29+
30+
def self.find_by(opts = {})
31+
#returns the ticket based on the constraints in the hash (activerecord-style)
32+
end
33+
34+
def save!
35+
#saves the ticket in the storage
36+
#throws an exception in case of an error
37+
end
38+
39+
def save
40+
#saves the ticket in the storage
41+
end
42+
43+
def consumed?
44+
#returns true if ticket is already consumed
45+
end
46+
47+
def consume!
48+
#consumes the ticket
49+
end
50+
51+
def expired?(max_lifetime = 100)
52+
#checks if the ticket is already expired
53+
end
54+
55+
end
56+
```
57+
1258
## Contributing
1359

1460
1. Fork it

0 commit comments

Comments
 (0)