Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

foto #55

Open
wants to merge 57 commits into
base: move-to-one-oh
Choose a base branch
from
Open

foto #55

wants to merge 57 commits into from

Conversation

Staswolf
Copy link

@Staswolf Staswolf commented Oct 9, 2017

jellyfish

atmos and others added 30 commits September 3, 2013 17:15
Handle multiple X-Forwarded-Proto headers
The gravatar_id attribute has been deprecated in favour of avatar_url:
https://developer.github.com/changes/2014-09-05-removing-gravatar-id/

Removing gravatar_id entirely would break clients, but avatar_url should
at least be available.
Make avatar_url available through the user object
This was accidentally removed in 8023a53.
Make token interception more difficult
atmos and others added 27 commits February 18, 2015 13:22
Add basic single sign out support for GitHub properties
Previously, the MembershipCache was a subclass of Hash. When serializing
to and deserializing from JSON, the MembershipCache would become a Hash
and blow up. This is a problem in warden-github-rails where I switched
to a custom warden (de)serialization in order to properly support JSON
serialization and also to support mocked users in test environments
between requests[1].

[1]: fphilipe/warden-github-rails@db82470
…tibility

Improve JSON serialization compatibility of User
This fixes a really difficult issue to track down, particularly when the
user specifies a GitHub team as an integer instead of a string. The
resulting API call includes a string, but the cache will be an integer.
As such, it will always force a cache lookup.
The membership cache was being serialized into the user object. It was
assumed that the user object was serialized at the end of each request.
It turns out that this is not the case. Instead, the user object only
gets serialized once, namely after setting the user. This means that the
membership cache wasn't working at all between requests.

This commit fixes it by not including the memberships in the serialized
user as there's no point in doing so. Instead, after the user object is
set up, the memberships hash get retrieved from the user session (warden
provides a session object for each scope; if there is none, a new hash
is stored in the session) and assigned to the user object. The hash is
then used as before and we get the session serialization from rack for
free.

Fixes #52.
This conversion is done by Transpec 3.3.0 with the following command:
    transpec

* 58 conversions
    from: obj.should
      to: expect(obj).to

* 9 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 8 conversions
    from: obj.stub(:message => value)
      to: allow(obj).to receive_messages(:message => value)

* 4 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 3 conversions
    from: =~ /pattern/
      to: match(/pattern/)

* 3 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 1 conversion
    from: =~ [1, 2]
      to: match_array([1, 2])

For more details: https://github.com/yujinakayama/transpec#supported-conversions
Persist membership cache between requests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants