Class: OpenID::Store::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/openid/store/interface.rb

Overview

Abstract Store Changes in 2.0:

  • removed store_nonce, get_auth_key, is_dumb

  • changed use_nonce to support one-way nonces

  • added cleanup_nonces, cleanup_associations, cleanup

Direct Known Subclasses

Filesystem, Memcache, Memory

Instance Method Summary collapse

Instance Method Details

#cleanupObject

Remove expired nonces and associations from the store Not called during normal library operation, this method is for store admins to keep their storage from filling up with expired data



70
71
72
# File 'lib/openid/store/interface.rb', line 70

def cleanup
  return cleanup_nonces, cleanup_associations
end

#cleanup_associationsObject

Remove expired associations from the store Not called during normal library operation, this method is for store admins to keep their storage from filling up with expired data

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/openid/store/interface.rb', line 63

def cleanup_associations
  raise NotImplementedError
end

#cleanup_noncesObject

Remove expired nonces from the store Discards any nonce that is old enough that it wouldn’t pass use_nonce Not called during normal library operation, this method is for store admins to keep their storage from filling up with expired data

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/openid/store/interface.rb', line 56

def cleanup_nonces
  raise NotImplementedError
end

#get_association(server_url, handle = nil) ⇒ Object

Returns a Association object from storage that matches the server_url. Returns nil if no such association is found or if the one matching association is expired. (Is allowed to GC expired associations when found.)

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/openid/store/interface.rb', line 29

def get_association(server_url, handle=nil)
  raise NotImplementedError
end

#remove_association(server_url, handle) ⇒ Object

If there is a matching association, remove it from the store and return true, otherwise return false.

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/openid/store/interface.rb', line 35

def remove_association(server_url, handle)
  raise NotImplementedError
end

#store_association(server_url, association) ⇒ Object

Put a Association object into storage. When implementing a store, don’t assume that there are any limitations on the character set of the server_url. In particular, expect to see unescaped non-url-safe characters in the server_url field.

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/openid/store/interface.rb', line 21

def store_association(server_url, association)
  raise NotImplementedError
end

#use_nonce(server_url, timestamp, salt) ⇒ Object

Return true if the nonce has not been used before, and store it for a while to make sure someone doesn’t try to use the same value again. Return false if the nonce has already been used or if the timestamp is not current. You can use OpenID::Store::Nonce::SKEW for your timestamp window. server_url: URL of the server from which the nonce originated timestamp: time the nonce was created in seconds since unix epoch salt: A random string that makes two nonces issued by a server in

the same second unique

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/openid/store/interface.rb', line 48

def use_nonce(server_url, timestamp, salt)
  raise NotImplementedError
end