googleauth 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 888e57705b33e87158d060b7b1569e54e00000428de35f979e7ffc9456cbb7b3
4
- data.tar.gz: ac341b6c481df125091c1465b56642173591f5698baff6f4806b05216eca8802
3
+ metadata.gz: 37795e56189392a97d5941b4982730ffa2ee1dd53ec63593bbb7f5ad50be044e
4
+ data.tar.gz: 72d6b584c89c321698485bda1e4aef33f361ed35da4762bd22b5dc4634556f8f
5
5
  SHA512:
6
- metadata.gz: 0e9d2fd50c39bf83e86f9f31bbddb897d28ce908be1214849926c45ce7ad2fa0d8f48d70a01acc84c9fa49ddf1a3a3c0c5a87b9bdf1d3ae1b9430b739e709c67
7
- data.tar.gz: f92483b4971ecc9d48a0b3656a76c694974c6b60153d6ea5ff0f1dd6c544da51b924aedbfa71956db2c1dada98a6cdaa632bb6f38c663e384acc8ebb3af8d1d2
6
+ metadata.gz: 1dcfc8f1e8e65f9b4b27c4933e71faffd2998d11766307cf464d0551d5f37e41c266e840a340a9aba41d49f44d05005006077526851b1b33e277ce3155d16370
7
+ data.tar.gz: f036b3403998c93f41eae33c472ad714758e6c6d06e9a1b197b53d118d182c2abb9caf40636ff63c152e2186642430de824e7929dcd2978cd358a5bd03194c1c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.8.1 (2023-09-19)
4
+
5
+ #### Documentation
6
+
7
+ * improve ADC related error and warning messages ([#452](https://github.com/googleapis/google-auth-library-ruby/issues/452))
8
+
3
9
  ### 1.8.0 (2023-09-07)
4
10
 
5
11
  #### Features
@@ -20,9 +20,9 @@ module Google
20
20
  # used to access Google APIs.
21
21
  module Auth
22
22
  NOT_FOUND_ERROR = <<~ERROR_MESSAGE.freeze
23
- Could not load the default credentials. Browse to
24
- https://cloud.google.com/docs/authentication/provide-credentials-adc
25
- for more information
23
+ Your credentials were not found. To set up Application Default
24
+ Credentials for your environment, see
25
+ https://cloud.google.com/docs/authentication/external/set-up-adc
26
26
  ERROR_MESSAGE
27
27
 
28
28
  module_function
@@ -64,7 +64,6 @@ module Google
64
64
  # `client_secrets.json` files.
65
65
  #
66
66
  def initialize id, secret
67
- CredentialsLoader.warn_if_cloud_sdk_credentials id
68
67
  raise "Client id can not be nil" if id.nil?
69
68
  raise "Client secret can not be nil" if secret.nil?
70
69
  @id = id
@@ -362,7 +362,6 @@ module Google
362
362
  else
363
363
  update_from_filepath keyfile, options
364
364
  end
365
- CredentialsLoader.warn_if_cloud_sdk_credentials @client.client_id
366
365
  @project_id ||= CredentialsLoader.load_gcloud_project_id
367
366
  @client.fetch_access_token! if @client.needs_access_token?
368
367
  @env_vars = nil
@@ -49,14 +49,6 @@ module Google
49
49
  CLOUD_SDK_CLIENT_ID = "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.app" \
50
50
  "s.googleusercontent.com".freeze
51
51
 
52
- CLOUD_SDK_CREDENTIALS_WARNING =
53
- "You are authenticating using user credentials." \
54
- "For production, we recommend using service account credentials." \
55
- "To learn more about service account credentials, see" \
56
- "http://cloud.google.com/docs/authentication/external/set-up-adc-on-cloud " \
57
- "To suppress this message, set the " \
58
- "GOOGLE_AUTH_SUPPRESS_CREDENTIALS_WARNINGS environment variable.".freeze
59
-
60
52
  # make_creds proxies the construction of a credentials instance
61
53
  #
62
54
  # By default, it calls #new on the current class, but this behaviour can
@@ -150,12 +142,6 @@ module Google
150
142
 
151
143
  module_function
152
144
 
153
- # Issues warning if cloud sdk client id is used
154
- def warn_if_cloud_sdk_credentials client_id
155
- return if ENV["GOOGLE_AUTH_SUPPRESS_CREDENTIALS_WARNINGS"]
156
- warn CLOUD_SDK_CREDENTIALS_WARNING if client_id == CLOUD_SDK_CLIENT_ID
157
- end
158
-
159
145
  # Finds project_id from gcloud CLI configuration
160
146
  def load_gcloud_project_id
161
147
  gcloud = GCLOUD_WINDOWS_COMMAND if OS.windows?
@@ -35,11 +35,9 @@ module Google
35
35
  json_key_io = options[:json_key_io]
36
36
  if json_key_io
37
37
  json_key, clz = determine_creds_class json_key_io
38
- warn_if_cloud_sdk_credentials json_key["client_id"]
39
38
  io = StringIO.new MultiJson.dump(json_key)
40
39
  clz.make_creds options.merge(json_key_io: io)
41
40
  else
42
- warn_if_cloud_sdk_credentials ENV[CredentialsLoader::CLIENT_ID_VAR]
43
41
  clz = read_creds
44
42
  clz.make_creds options
45
43
  end
@@ -16,6 +16,6 @@ module Google
16
16
  # Module Auth provides classes that provide Google-specific authorization
17
17
  # used to access Google APIs.
18
18
  module Auth
19
- VERSION = "1.8.0".freeze
19
+ VERSION = "1.8.1".freeze
20
20
  end
21
21
  end
@@ -192,13 +192,13 @@ module Google
192
192
  end
193
193
 
194
194
  def self.extract_callback_state request
195
- state = MultiJson.load(request[STATE_PARAM] || "{}")
195
+ state = MultiJson.load(request.params[STATE_PARAM] || "{}")
196
196
  redirect_uri = state[CURRENT_URI_KEY]
197
197
  callback_state = {
198
- AUTH_CODE_KEY => request[AUTH_CODE_KEY],
199
- ERROR_CODE_KEY => request[ERROR_CODE_KEY],
198
+ AUTH_CODE_KEY => request.params[AUTH_CODE_KEY],
199
+ ERROR_CODE_KEY => request.params[ERROR_CODE_KEY],
200
200
  SESSION_ID_KEY => state[SESSION_ID_KEY],
201
- SCOPE_KEY => request[SCOPE_KEY]
201
+ SCOPE_KEY => request.params[SCOPE_KEY]
202
202
  }
203
203
  [callback_state, redirect_uri]
204
204
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googleauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Emiola
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday