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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce2cbe6f38376f6f4ec06a59c7b0fcb916ed1611
4
- data.tar.gz: 4acaea345f5840be79e9a2d77b301e96e2eaaf90
3
+ metadata.gz: 78c821832dbcdff6dabee85bee7555ed38ea75f7
4
+ data.tar.gz: 71d2aa594d621e5077d88b373f2dee0ec7289ac6
5
5
  SHA512:
6
- metadata.gz: db6f84a43691f47461ad4d7572d165fd23b2010fbc1f28b96dd81c624eef1e1af3b5070b56d1dce1fcb8293ce85d8dd74e3b134ca75aa14d24b6be94216d633d
7
- data.tar.gz: 7c3a4756ceaf4e6a7a96fee9ddf361843b6c46f61c825023ab2319290d46f0cdcb799fa24eea4d88f0e7bc34eaa62a3074badd56b51035a13f311a59a319b514
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).
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'google_sign_in'
3
- s.version = '0.1'
3
+ s.version = '0.1.1'
4
4
  s.authors = 'David Heinemeier Hansson'
5
5
  s.email = 'david@basecamp.com'
6
6
  s.summary = 'Sign in (or up) with Google for Rails applications'
@@ -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
@@ -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: '0.1'
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-05-30 00:00:00.000000000 Z
11
+ date: 2017-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport