Sha256: 9ddba1f0de04d373cc0df12933b8ca330d6f4b924280dded8fd5f6730e54006f

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

class Hadley::TokenAccess

  def initialize(store)
    @store = store
  end

  def key_for(token)
    "afid-access-token:#{token}"
  end

  def get(token)
    access = @store.get(key_for(token))
    if access
      access[:anonymous] = access[:identity] == Hadley::ANONYMOUS_IDENTITY
    end
    access
  end

  def put(token, expires_in, data={})
    @store.set(key_for(token), data, expires_in)
  end

  def delete(token)
    @store.delete(key_for(token))
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hadley-0.0.1 lib/hadley/token_access.rb