signet 0.15.0 → 0.16.0
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/.yardopts +11 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +43 -0
- data/SECURITY.md +7 -0
- data/lib/signet/oauth_1/credential.rb +1 -1
- data/lib/signet/oauth_1/signature_methods/hmac_sha1.rb +1 -1
- data/lib/signet/oauth_1/signature_methods/plaintext.rb +1 -1
- data/lib/signet/oauth_1/signature_methods/rsa_sha1.rb +1 -1
- data/lib/signet/oauth_1.rb +1 -1
- data/lib/signet/oauth_2/client.rb +17 -12
- data/lib/signet/oauth_2.rb +1 -1
- data/lib/signet/version.rb +1 -1
- data/lib/signet.rb +1 -1
- metadata +24 -24
- data/Gemfile +0 -8
- data/Rakefile +0 -112
- data/signet.gemspec +0 -45
- data/spec/signet/oauth_1/client_spec.rb +0 -810
- data/spec/signet/oauth_1/credential_spec.rb +0 -169
- data/spec/signet/oauth_1/server_spec.rb +0 -839
- data/spec/signet/oauth_1/signature_methods/hmac_sha1_spec.rb +0 -61
- data/spec/signet/oauth_1/signature_methods/plaintext_spec.rb +0 -61
- data/spec/signet/oauth_1/signature_methods/rsa_sha1_spec.rb +0 -126
- data/spec/signet/oauth_1_spec.rb +0 -1036
- data/spec/signet/oauth_2/client_spec.rb +0 -1254
- data/spec/signet/oauth_2_spec.rb +0 -194
- data/spec/signet_spec.rb +0 -78
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -10
- data/spec/spec_helper_spec.rb +0 -17
- data/website/index.html +0 -95
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bc1d85dc2f8c727e54436bb38a284576cb81ea5ee0b0af58860678cb069bde9
|
4
|
+
data.tar.gz: e0b149f3ee841fe5f30af08a2d0e6cebbfbc173d1370d4e4a8fc3b2109fa54a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef091d389b3ac52e87dba96f8647a072acf11a346244600bca551b23ead3c24bb73d75209af7c79c261769d5589053c84a3bb837fb57f2b063e19d3516d0ad4
|
7
|
+
data.tar.gz: d8a38134dd48453e0e976639b7ded1838ee363ab3b27917847f27e8de98adcb9f60f28359a90459a75537a03595417bd7275e4b3f291019cb13ea4eb09383495
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
## [0.16.0](https://www.github.com/googleapis/signet/compare/signet/v0.15.0...signet/v0.16.0) (2021-09-03)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* Support for fetching an access token with basic auth ([3c43e32](https://www.github.com/googleapis/signet/commit/3c43e3201d79b1e2303e672f3c07e060c5079423))
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Remove extraneous files from the gem ([e515bb6](https://www.github.com/googleapis/signet/commit/e515bb627a64e32ec885412fed8b01eb73067ee0))
|
14
|
+
* Require addressable 2.8 to remediate vulnerability ([9a2f899](https://www.github.com/googleapis/signet/commit/9a2f8996f522538c4bb7998535e2a50331d564fc))
|
15
|
+
|
3
16
|
## [0.15.0](https://www.github.com/googleapis/signet/compare/v0.14.1...v0.15.0) (2021-03-04)
|
4
17
|
|
5
18
|
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project,
|
4
|
+
and in the interest of fostering an open and welcoming community,
|
5
|
+
we pledge to respect all people who contribute through reporting issues,
|
6
|
+
posting feature requests, updating documentation,
|
7
|
+
submitting pull requests or patches, and other activities.
|
8
|
+
|
9
|
+
We are committed to making participation in this project
|
10
|
+
a harassment-free experience for everyone,
|
11
|
+
regardless of level of experience, gender, gender identity and expression,
|
12
|
+
sexual orientation, disability, personal appearance,
|
13
|
+
body size, race, ethnicity, age, religion, or nationality.
|
14
|
+
|
15
|
+
Examples of unacceptable behavior by participants include:
|
16
|
+
|
17
|
+
* The use of sexualized language or imagery
|
18
|
+
* Personal attacks
|
19
|
+
* Trolling or insulting/derogatory comments
|
20
|
+
* Public or private harassment
|
21
|
+
* Publishing other's private information,
|
22
|
+
such as physical or electronic
|
23
|
+
addresses, without explicit permission
|
24
|
+
* Other unethical or unprofessional conduct.
|
25
|
+
|
26
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
27
|
+
comments, commits, code, wiki edits, issues, and other contributions
|
28
|
+
that are not aligned to this Code of Conduct.
|
29
|
+
By adopting this Code of Conduct,
|
30
|
+
project maintainers commit themselves to fairly and consistently
|
31
|
+
applying these principles to every aspect of managing this project.
|
32
|
+
Project maintainers who do not follow or enforce the Code of Conduct
|
33
|
+
may be permanently removed from the project team.
|
34
|
+
|
35
|
+
This code of conduct applies both within project spaces and in public spaces
|
36
|
+
when an individual is representing the project or its community.
|
37
|
+
|
38
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior
|
39
|
+
may be reported by opening an issue
|
40
|
+
or contacting one or more of the project maintainers.
|
41
|
+
|
42
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
|
43
|
+
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
data/SECURITY.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
To report a security issue, please use [g.co/vulnz](https://g.co/vulnz).
|
4
|
+
|
5
|
+
The Google Security Team will respond within 5 working days of your report on g.co/vulnz.
|
6
|
+
|
7
|
+
We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue.
|
data/lib/signet/oauth_1.rb
CHANGED
@@ -880,13 +880,13 @@ module Signet
|
|
880
880
|
end
|
881
881
|
|
882
882
|
def grant_type= new_grant_type
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
883
|
+
@grant_type =
|
884
|
+
case new_grant_type
|
885
|
+
when "authorization_code", "refresh_token", "password", "client_credentials"
|
886
|
+
new_grant_type
|
887
|
+
else
|
888
|
+
Addressable::URI.parse new_grant_type
|
889
|
+
end
|
890
890
|
end
|
891
891
|
|
892
892
|
def to_jwt options = {}
|
@@ -972,8 +972,8 @@ module Signet
|
|
972
972
|
end
|
973
973
|
parameters.merge! extension_parameters
|
974
974
|
end
|
975
|
-
parameters["client_id"] = client_id
|
976
|
-
parameters["client_secret"] = client_secret
|
975
|
+
parameters["client_id"] = client_id if !options[:use_basic_auth] && !client_id.nil?
|
976
|
+
parameters["client_secret"] = client_secret if !options[:use_basic_auth] && !client_secret.nil?
|
977
977
|
if options[:scope]
|
978
978
|
parameters["scope"] = options[:scope]
|
979
979
|
elsif options[:use_configured_scope] && !scope.nil?
|
@@ -990,10 +990,11 @@ module Signet
|
|
990
990
|
options = deep_hash_normalize options
|
991
991
|
|
992
992
|
client = options[:connection] ||= Faraday.default_connection
|
993
|
-
url = Addressable::URI.parse
|
993
|
+
url = Addressable::URI.parse token_credential_uri
|
994
994
|
parameters = generate_access_token_request options
|
995
995
|
if client.is_a? Faraday::Connection
|
996
|
-
|
996
|
+
client.basic_auth client_id, client_secret if options[:use_basic_auth]
|
997
|
+
response = client.post url.normalize.to_s,
|
997
998
|
Addressable::URI.form_encode(parameters),
|
998
999
|
"Content-Type" => "application/x-www-form-urlencoded"
|
999
1000
|
status = response.status.to_i
|
@@ -1001,7 +1002,11 @@ module Signet
|
|
1001
1002
|
content_type = response.headers["Content-type"]
|
1002
1003
|
else
|
1003
1004
|
# Hurley
|
1004
|
-
|
1005
|
+
if options[:use_basic_auth]
|
1006
|
+
url.user = client_id
|
1007
|
+
url.password = client_secret
|
1008
|
+
end
|
1009
|
+
response = client.post url.normalize.to_s, parameters
|
1005
1010
|
status = response.status_code.to_i
|
1006
1011
|
body = response.body
|
1007
1012
|
content_type = response.header[:content_type]
|
data/lib/signet/oauth_2.rb
CHANGED
data/lib/signet/version.rb
CHANGED
data/lib/signet.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Aman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-03
|
12
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '2.
|
20
|
+
version: '2.8'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '2.
|
27
|
+
version: '2.8'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: faraday
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,14 +127,28 @@ dependencies:
|
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
130
|
+
version: '13.0'
|
131
131
|
type: :development
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
137
|
+
version: '13.0'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: redcarpet
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '3.0'
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3.0'
|
138
152
|
- !ruby/object:Gem::Dependency
|
139
153
|
name: rspec
|
140
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,11 +206,12 @@ extensions: []
|
|
192
206
|
extra_rdoc_files:
|
193
207
|
- README.md
|
194
208
|
files:
|
209
|
+
- ".yardopts"
|
195
210
|
- CHANGELOG.md
|
196
|
-
-
|
211
|
+
- CODE_OF_CONDUCT.md
|
197
212
|
- LICENSE
|
198
213
|
- README.md
|
199
|
-
-
|
214
|
+
- SECURITY.md
|
200
215
|
- lib/signet.rb
|
201
216
|
- lib/signet/errors.rb
|
202
217
|
- lib/signet/oauth_1.rb
|
@@ -209,21 +224,6 @@ files:
|
|
209
224
|
- lib/signet/oauth_2.rb
|
210
225
|
- lib/signet/oauth_2/client.rb
|
211
226
|
- lib/signet/version.rb
|
212
|
-
- signet.gemspec
|
213
|
-
- spec/signet/oauth_1/client_spec.rb
|
214
|
-
- spec/signet/oauth_1/credential_spec.rb
|
215
|
-
- spec/signet/oauth_1/server_spec.rb
|
216
|
-
- spec/signet/oauth_1/signature_methods/hmac_sha1_spec.rb
|
217
|
-
- spec/signet/oauth_1/signature_methods/plaintext_spec.rb
|
218
|
-
- spec/signet/oauth_1/signature_methods/rsa_sha1_spec.rb
|
219
|
-
- spec/signet/oauth_1_spec.rb
|
220
|
-
- spec/signet/oauth_2/client_spec.rb
|
221
|
-
- spec/signet/oauth_2_spec.rb
|
222
|
-
- spec/signet_spec.rb
|
223
|
-
- spec/spec.opts
|
224
|
-
- spec/spec_helper.rb
|
225
|
-
- spec/spec_helper_spec.rb
|
226
|
-
- website/index.html
|
227
227
|
homepage: https://github.com/googleapis/signet
|
228
228
|
licenses:
|
229
229
|
- Apache-2.0
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: 1.3.5
|
250
250
|
requirements: []
|
251
|
-
rubygems_version: 3.2.
|
251
|
+
rubygems_version: 3.2.17
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: Signet is an OAuth 1.0 / OAuth 2.0 implementation.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "json"
|
3
|
-
require "rake"
|
4
|
-
require "bundler/gem_tasks"
|
5
|
-
|
6
|
-
task :release_gem, :tag do |_t, args|
|
7
|
-
tag = args[:tag]
|
8
|
-
raise "You must provide a tag to release." if tag.nil?
|
9
|
-
|
10
|
-
# Verify the tag format "vVERSION"
|
11
|
-
m = tag.match /v(?<version>\S*)/
|
12
|
-
raise "Tag #{tag} does not match the expected format." if m.nil?
|
13
|
-
|
14
|
-
version = m[:version]
|
15
|
-
raise "You must provide a version." if version.nil?
|
16
|
-
|
17
|
-
api_token = ENV["RUBYGEMS_API_TOKEN"]
|
18
|
-
|
19
|
-
require "gems"
|
20
|
-
if api_token
|
21
|
-
::Gems.configure do |config|
|
22
|
-
config.key = api_token
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
Bundler.with_clean_env do
|
27
|
-
sh "rm -rf pkg"
|
28
|
-
sh "bundle update"
|
29
|
-
sh "bundle exec rake build"
|
30
|
-
end
|
31
|
-
|
32
|
-
path_to_be_pushed = "pkg/signet-#{version}.gem"
|
33
|
-
gem_was_published = nil
|
34
|
-
if File.file? path_to_be_pushed
|
35
|
-
begin
|
36
|
-
response = ::Gems.push File.new(path_to_be_pushed)
|
37
|
-
puts response
|
38
|
-
raise unless response.include? "Successfully registered gem:"
|
39
|
-
gem_was_published = true
|
40
|
-
puts "Successfully built and pushed signet for version #{version}"
|
41
|
-
rescue StandardError => e
|
42
|
-
gem_was_published = false
|
43
|
-
puts "Error while releasing signet version #{version}: #{e.message}"
|
44
|
-
end
|
45
|
-
else
|
46
|
-
raise "Cannot build signet for version #{version}"
|
47
|
-
end
|
48
|
-
|
49
|
-
Rake::Task["kokoro:publish_docs"].invoke if gem_was_published
|
50
|
-
end
|
51
|
-
|
52
|
-
task :ci do
|
53
|
-
header "Using Ruby - #{RUBY_VERSION}"
|
54
|
-
sh "bundle exec rubocop"
|
55
|
-
sh "bundle exec rspec"
|
56
|
-
end
|
57
|
-
|
58
|
-
namespace :kokoro do
|
59
|
-
task :load_env_vars do
|
60
|
-
service_account = "#{ENV['KOKORO_GFILE_DIR']}/service-account.json"
|
61
|
-
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = service_account
|
62
|
-
filename = "#{ENV['KOKORO_GFILE_DIR']}/env_vars.json"
|
63
|
-
env_vars = JSON.parse File.read(filename)
|
64
|
-
env_vars.each { |k, v| ENV[k] = v }
|
65
|
-
end
|
66
|
-
|
67
|
-
task :presubmit do
|
68
|
-
Rake::Task["ci"].invoke
|
69
|
-
end
|
70
|
-
|
71
|
-
task :continuous do
|
72
|
-
Rake::Task["ci"].invoke
|
73
|
-
end
|
74
|
-
|
75
|
-
task :nightly do
|
76
|
-
Rake::Task["ci"].invoke
|
77
|
-
end
|
78
|
-
|
79
|
-
task :release do
|
80
|
-
version = "0.1.0"
|
81
|
-
Bundler.with_clean_env do
|
82
|
-
version = `bundle exec gem list`
|
83
|
-
.split("\n").select { |line| line.include? "signet" }
|
84
|
-
.first.split("(").last.split(")").first || "0.1.0"
|
85
|
-
end
|
86
|
-
Rake::Task["kokoro:load_env_vars"].invoke
|
87
|
-
Rake::Task["release_gem"].invoke "v#{version}"
|
88
|
-
end
|
89
|
-
|
90
|
-
task :post do
|
91
|
-
require_relative "rakelib/link_checker.rb"
|
92
|
-
|
93
|
-
link_checker = LinkChecker.new
|
94
|
-
link_checker.run
|
95
|
-
exit link_checker.exit_status
|
96
|
-
end
|
97
|
-
|
98
|
-
task :publish_docs do
|
99
|
-
require_relative "rakelib/devsite_builder.rb"
|
100
|
-
|
101
|
-
DevsiteBuilder.new(__dir__).publish
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def header str, token = "#"
|
106
|
-
line_length = str.length + 8
|
107
|
-
puts ""
|
108
|
-
puts token * line_length
|
109
|
-
puts "#{token * 3} #{str} #{token * 3}"
|
110
|
-
puts token * line_length
|
111
|
-
puts ""
|
112
|
-
end
|