google_sign_in 0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/google_sign_in.gemspec +1 -1
- data/lib/google_sign_in/identity.rb +3 -1
- data/test/identity_test.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c821832dbcdff6dabee85bee7555ed38ea75f7
|
4
|
+
data.tar.gz: 71d2aa594d621e5077d88b373f2dee0ec7289ac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8886bd5132c3e69289b752a7f17bd361bd8a9e9db01e6a850d605d24b4c944d3b9d27ce3be477603435a3143bf828a10802e36b1ae0f1c3b1c47ba3b0fb07758
|
7
|
+
data.tar.gz: 1ac5a753f98bb8788a391d963dac2a1e0922655bf595ec244b51319b5471e46cf7ec66725514b44a8f4c03ccfe1a914cb32a0e92e3dcb6c852839624a4545574
|
data/README.md
CHANGED
@@ -17,8 +17,22 @@ Now you can use the sign-in integration on your signup or sigin screen.
|
|
17
17
|
Here's the most basic example:
|
18
18
|
|
19
19
|
```ruby
|
20
|
+
# app/views/layouts/application.html.erb
|
21
|
+
<html>
|
22
|
+
<head>
|
23
|
+
<% # Required for google_sign_in to add the Google JS assets and meta tags! %>
|
24
|
+
<%= yield :head %>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<%= yield %>
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
|
20
31
|
# app/views/sessions/new.html.erb
|
21
32
|
<%= google_sign_in(url: session_path) do %>
|
33
|
+
# You can replace this with whatever design you please for the button.
|
34
|
+
# You should follow Google's brand guidelines for Google Sign-In, though:
|
35
|
+
# https://developers.google.com/identity/branding-guidelines
|
22
36
|
<%= button_tag("Signin with Google") %>
|
23
37
|
<% end %>
|
24
38
|
```
|
@@ -68,6 +82,12 @@ is version 1.3.1 from 2015. So for now, you should depend on the github version
|
|
68
82
|
gem 'google-id-token', github: 'google/google-id-token'
|
69
83
|
```
|
70
84
|
|
85
|
+
## Outstanding work
|
86
|
+
|
87
|
+
- Proper testing. Need to generate a test client_id/google id token combo that we can use to test with.
|
88
|
+
- Cajole Google to release a new version of the google-id-token so caveat can be removed.
|
89
|
+
- Not much more. I'm seeking to keep this simple, just for signin/signup, not general Google integration.
|
90
|
+
|
71
91
|
## License
|
72
92
|
|
73
93
|
Google Sign-In for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
|
data/google_sign_in.gemspec
CHANGED
@@ -57,7 +57,9 @@ module GoogleSignIn
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def ensure_proper_audience
|
60
|
-
@payload["aud"].include?(client_id)
|
60
|
+
unless @payload["aud"].include?(client_id)
|
61
|
+
raise "Failed to locate the client_id #{client_id} in the authorized audience (#{@payload["aud"]})"
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
63
65
|
end
|
data/test/identity_test.rb
CHANGED
@@ -6,4 +6,8 @@ class GoogleSignIn::IdentityTest < ActiveSupport::TestCase
|
|
6
6
|
GoogleSignIn::Identity.client_id = nil
|
7
7
|
assert_raises(ArgumentError) { GoogleSignIn::Identity.new("some_fake_token") }
|
8
8
|
end
|
9
|
+
|
10
|
+
test "client_id must be part of the audience" do
|
11
|
+
# FIXME: Need to build a mock/simulate the google token to test this
|
12
|
+
end
|
9
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_sign_in
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|