C0 code coverage information
Generated on Fri Jul 11 15:55:35 -0700 2008 with rcov 0.7.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 require 'openid/util'
2
3 module OpenID
4
5 # Stores for Associations and nonces. Used by both the Consumer and
6 # the Server. If you have a database abstraction layer or other
7 # state storage in your application or framework already, you can
8 # implement the store interface.
9 module Store
10 # Abstract Store
11 # Changes in 2.0:
12 # * removed store_nonce, get_auth_key, is_dumb
13 # * changed use_nonce to support one-way nonces
14 # * added cleanup_nonces, cleanup_associations, cleanup
15 class Interface < Object
16
17 # Put a Association object into storage.
18 # When implementing a store, don't assume that there are any limitations
19 # on the character set of the server_url. In particular, expect to see
20 # unescaped non-url-safe characters in the server_url field.
21 def store_association(server_url, association)
22 raise NotImplementedError
23 end
24
25 # Returns a Association object from storage that matches
26 # the server_url. Returns nil if no such association is found or if
27 # the one matching association is expired. (Is allowed to GC expired
28 # associations when found.)
29 def get_association(server_url, handle=nil)
30 raise NotImplementedError
31 end
32
33 # If there is a matching association, remove it from the store and
34 # return true, otherwise return false.
35 def remove_association(server_url, handle)
36 raise NotImplementedError
37 end
38
39 # Return true if the nonce has not been used before, and store it
40 # for a while to make sure someone doesn't try to use the same value
41 # again. Return false if the nonce has already been used or if the
42 # timestamp is not current.
43 # You can use OpenID::Store::Nonce::SKEW for your timestamp window.
44 # server_url: URL of the server from which the nonce originated
45 # timestamp: time the nonce was created in seconds since unix epoch
46 # salt: A random string that makes two nonces issued by a server in
47 # the same second unique
48 def use_nonce(server_url, timestamp, salt)
49 raise NotImplementedError
50 end
51
52 # Remove expired nonces from the store
53 # Discards any nonce that is old enough that it wouldn't pass use_nonce
54 # Not called during normal library operation, this method is for store
55 # admins to keep their storage from filling up with expired data
56 def cleanup_nonces
57 raise NotImplementedError
58 end
59
60 # Remove expired associations from the store
61 # Not called during normal library operation, this method is for store
62 # admins to keep their storage from filling up with expired data
63 def cleanup_associations
64 raise NotImplementedError
65 end
66
67 # Remove expired nonces and associations from the store
68 # Not called during normal library operation, this method is for store
69 # admins to keep their storage from filling up with expired data
70 def cleanup
71 return cleanup_nonces, cleanup_associations
72 end
73 end
74 end
75 end
Generated using the rcov code coverage analysis tool for Ruby version 0.7.0.