aws-google 0.2.2 → 0.2.4

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
  SHA256:
3
- metadata.gz: 5a99a98afdd145f3e2077599e0a90c743f215c8ee7e32c3d74fc50d0f670e881
4
- data.tar.gz: 451a434fde3537db95a1c58d8989afc9a0a00491c90f90b3d2203f5cc3cf0bdc
3
+ metadata.gz: 453c973d775146ceca58836c5f0d623b4c129b4d65292ac376c0f3346f2675f0
4
+ data.tar.gz: ca604dbb401d2ff818a89684abbb3ca8be889735315ab2e5b7568d783fad6c4a
5
5
  SHA512:
6
- metadata.gz: ed65637fb6d1ce3c527ae90aae5a46a1e1358a7afe411e71eee9dc76d05b34ab3d75a0b2cbe7a7811890a872e1d268e5b23b849e66956091405f43f2c425a9f9
7
- data.tar.gz: 4bc5596979411c3d27fea983d592bb7c947aa2375a6e072b433cbbfe24d537ce042a688d4f118b87fd1438c4aa0d3fce039148c8cc79af680b615772a8204a6b
6
+ metadata.gz: e4fff0d85f95439042e332bd744d2d7243e3d58cd6c0895f18df8f7e0660cc3197013dfc63d81e5ae97a58ba2adfb1ccb83960e7fe3025517535a4779a8832ea
7
+ data.tar.gz: 5fa075fe56b039726309db3e896548ee792cf982c9f20bf05da3f2da69901bbbd4182f046e50ee943d6b692dd9ec193d6bff6af45d937e2ec7a6b2b8641b99ab
@@ -7,7 +7,7 @@ on:
7
7
 
8
8
  jobs:
9
9
  # Test on code-dot-org Ruby version
10
- test_3_0_5:
10
+ test_3_1_7:
11
11
  runs-on: ubuntu-latest
12
12
 
13
13
  steps:
@@ -17,7 +17,7 @@ jobs:
17
17
  - name: Set up Ruby
18
18
  uses: ruby/setup-ruby@v1
19
19
  with:
20
- ruby-version: 3.0.5
20
+ ruby-version: 3.1.7
21
21
  bundler-cache: true
22
22
 
23
23
  - name: Install gems
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.5
1
+ 3.1.7
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.0.5
1
+ FROM ruby:3.1.7
2
2
 
3
3
  WORKDIR /app
4
4
 
data/README.md CHANGED
@@ -95,7 +95,7 @@ The extra `credential_process` config line tells AWS to [Source Credentials with
95
95
 
96
96
  Prerequisites:
97
97
 
98
- * Ruby 3.0.5
98
+ * Ruby 3.1.7
99
99
 
100
100
  You can have Ruby installed locally, or use Docker and mount this repository into a Ruby container. By using Docker you can avoid conflicts with differing Ruby versions or other installed gems. To run and 'bash' into a Ruby container, install Docker and run the following. See [docker-compose.yml](docker-compose.yml) for details.
101
101
 
data/aws-google.gemspec CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'aws/google/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.required_ruby_version = '>= 3.0.5'
6
+ spec.required_ruby_version = '~> 3.0'
7
7
  spec.name = 'aws-google'
8
8
  spec.version = Aws::Google::VERSION
9
9
  spec.authors = ['Will Jordan']
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'aws-sdk-core', '~> 3.211.0'
25
+ spec.add_dependency 'aws-sdk-core', '~> 3.211'
26
26
  spec.add_dependency 'google-apis-core', '~> 0.11.3' # Newest version compatible with code-dot-org's google_drive>googleauth dependency
27
27
  spec.add_dependency 'launchy', '~> 3.0.1'
28
28
 
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  class Google
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.2.4'.freeze
4
4
  end
5
5
  end
data/lib/aws/google.rb CHANGED
@@ -108,24 +108,28 @@ module Aws
108
108
  end
109
109
 
110
110
  def get_oauth_code(client, options)
111
- raise 'fallback' unless @port && !@port.zero?
111
+ raise ArgumentError.new('Missing port for local oauth server') unless @port && !@port.zero?
112
112
 
113
113
  require 'launchy'
114
114
  require 'webrick'
115
+
115
116
  code = nil
116
117
  server = WEBrick::HTTPServer.new(
117
118
  Port: @port,
118
119
  Logger: WEBrick::Log.new(STDOUT, 0),
119
120
  AccessLog: []
120
121
  )
122
+
121
123
  server.mount_proc '/' do |req, res|
122
124
  code = req.query['code']
123
125
  res.status = 202
124
126
  res.body = 'Login successful, you may close this browser window.'
125
- server.stop
127
+ server.shutdown
126
128
  end
129
+
127
130
  trap('INT') { server.shutdown }
128
131
  client.redirect_uri = "http://localhost:#{@port}"
132
+
129
133
  silence_output do
130
134
  launchy = Launchy.open(client.authorization_uri(options).to_s)
131
135
  server_thread = Thread.new do
@@ -134,21 +138,13 @@ module Aws
134
138
  ensure server.shutdown
135
139
  end
136
140
  end
137
- while server_thread.alive?
138
- raise 'fallback' if !launchy.alive? && !launchy.value.success?
139
-
140
- sleep 0.1
141
- end
141
+
142
+ server_thread.join
142
143
  end
143
- code || raise('fallback')
144
- rescue StandardError
145
- trap('INT', 'DEFAULT')
146
- # Fallback to out-of-band authentication if browser launch failed.
147
- client.redirect_uri = 'oob'
148
- return ENV['OAUTH_CODE'] if ENV['OAUTH_CODE']
149
144
 
150
- raise RuntimeError, 'Open the following URL in a browser to get a code,' \
151
- "export to $OAUTH_CODE and rerun:\n#{client.authorization_uri(options)}", []
145
+ code || raise('Local Google Oauth failed to get code')
146
+ ensure
147
+ trap('INT', 'DEFAULT')
152
148
  end
153
149
 
154
150
  def refresh
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Jordan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-11 00:00:00.000000000 Z
11
+ date: 2025-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.211.0
19
+ version: '3.211'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.211.0
26
+ version: '3.211'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-apis-core
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,6 @@ files:
147
147
  - ".github/workflows/pr-verify.yml"
148
148
  - ".gitignore"
149
149
  - ".ruby-version"
150
- - ".travis.yml"
151
150
  - Dockerfile
152
151
  - Gemfile
153
152
  - LICENSE.txt
@@ -167,23 +166,23 @@ licenses:
167
166
  - Apache-2.0
168
167
  metadata:
169
168
  allowed_push_host: https://rubygems.org
170
- post_install_message:
169
+ post_install_message:
171
170
  rdoc_options: []
172
171
  require_paths:
173
172
  - lib
174
173
  required_ruby_version: !ruby/object:Gem::Requirement
175
174
  requirements:
176
- - - ">="
175
+ - - "~>"
177
176
  - !ruby/object:Gem::Version
178
- version: 3.0.5
177
+ version: '3.0'
179
178
  required_rubygems_version: !ruby/object:Gem::Requirement
180
179
  requirements:
181
180
  - - ">="
182
181
  - !ruby/object:Gem::Version
183
182
  version: '0'
184
183
  requirements: []
185
- rubygems_version: 3.2.33
186
- signing_key:
184
+ rubygems_version: 3.3.27
185
+ signing_key:
187
186
  specification_version: 4
188
187
  summary: Use Google OAuth as an AWS credential provider
189
188
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.14.6