This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
foto #55
Open
Staswolf
wants to merge
57
commits into
move-to-one-oh
Choose a base branch
from
master
base: move-to-one-oh
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
foto #55
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Staswolf
commented
Oct 9, 2017
Cut a 1.0 release
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.
Cache team memberships
Make token interception more difficult
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.
Always use strings
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
Upgrade things
Persist membership cache between requests
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.