bson 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +91 -7
- data/Rakefile +63 -39
- data/ext/bson/read.c +18 -3
- data/ext/bson/util.c +1 -1
- data/ext/bson/write.c +4 -0
- data/lib/bson/decimal128/builder.rb +1 -1
- data/lib/bson/object_id.rb +11 -1
- data/lib/bson/version.rb +2 -1
- data/spec/bson/object_id_spec.rb +14 -0
- metadata +7 -80
- checksums.yaml.gz.sig +0 -0
- data/spec/shared/LICENSE +0 -20
- data/spec/shared/bin/get-mongodb-download-url +0 -17
- data/spec/shared/bin/s3-copy +0 -45
- data/spec/shared/bin/s3-upload +0 -69
- data/spec/shared/lib/mrss/child_process_helper.rb +0 -80
- data/spec/shared/lib/mrss/cluster_config.rb +0 -231
- data/spec/shared/lib/mrss/constraints.rb +0 -378
- data/spec/shared/lib/mrss/docker_runner.rb +0 -298
- data/spec/shared/lib/mrss/eg_config_utils.rb +0 -51
- data/spec/shared/lib/mrss/event_subscriber.rb +0 -210
- data/spec/shared/lib/mrss/lite_constraints.rb +0 -238
- data/spec/shared/lib/mrss/server_version_registry.rb +0 -113
- data/spec/shared/lib/mrss/session_registry.rb +0 -69
- data/spec/shared/lib/mrss/session_registry_legacy.rb +0 -60
- data/spec/shared/lib/mrss/spec_organizer.rb +0 -179
- data/spec/shared/lib/mrss/utils.rb +0 -37
- data/spec/shared/share/Dockerfile.erb +0 -321
- data/spec/shared/share/haproxy-1.conf +0 -16
- data/spec/shared/share/haproxy-2.conf +0 -17
- data/spec/shared/shlib/config.sh +0 -27
- data/spec/shared/shlib/distro.sh +0 -74
- data/spec/shared/shlib/server.sh +0 -416
- data/spec/shared/shlib/set_env.sh +0 -169
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 044d0b78ceb338edd0398edc8954cb631353007ab4bf9d1fa6f94f6fd31aa24e
|
4
|
+
data.tar.gz: 1ee99d59e6a730188b3a73ca79a1bc8cfbe82a5e405c66e8dee8ffd890fd096c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 326b80a11916faaadf8c576b4f79adc2708dc12ec8de4e0793da7d4f2cf998d207ce67c330bc4a2dedcd0d369601e5ed9de6234a81988b5787c41705084e36f3
|
7
|
+
data.tar.gz: 28083aa41b8f22f34e1220b3a90fb90b590c961eefc44b5db720961118fa473ccbe0e566c8a39f343199a1881ce57c4930b3806ef01fd25fa582c26501b254e5
|
data/README.md
CHANGED
@@ -1,16 +1,54 @@
|
|
1
1
|
BSON
|
2
2
|
[![Gem Version][rubygems-img]][rubygems-url]
|
3
3
|
[![Build Status][ghactions-img]][ghactions-url]
|
4
|
-
[![Coverage Status][coveralls-img]][coveralls-url]
|
5
|
-
[![Inline docs][inch-img]][inch-url]
|
6
4
|
====
|
7
5
|
|
8
6
|
An implementation of the BSON specification in Ruby.
|
9
7
|
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
|
11
|
+
BSON can be installed via RubyGems:
|
12
|
+
|
13
|
+
```
|
14
|
+
> gem install bson
|
15
|
+
```
|
16
|
+
|
17
|
+
Or by adding it to your project's Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'bson'
|
21
|
+
```
|
22
|
+
|
23
|
+
### Release Integrity
|
24
|
+
|
25
|
+
Each release of the BSON library for Ruby after version 5.0.0 has been automatically built and signed using the team's GPG key.
|
26
|
+
|
27
|
+
To verify the bson gem file:
|
28
|
+
|
29
|
+
1. [Download the GPG key](https://pgp.mongodb.com/ruby-driver.asc).
|
30
|
+
2. Import the key into your GPG keyring with `gpg --import ruby-driver.asc`.
|
31
|
+
3. Download the gem file (if you don't already have it). You can download it from RubyGems with `gem fetch bson`, or you can download it from the [releases page](https://github.com/mongodb/bson-ruby/releases) on GitHub.
|
32
|
+
4. Download the corresponding detached signature file from the [same release](https://github.com/mongodb/bson-ruby/releases). Look at the bottom of the release that corresponds to the gem file, under the 'Assets' list, for a `.sig` file with the same version number as the gem you wish to install.
|
33
|
+
5. Verify the gem with `gpg --verify bson-X.Y.Z.gem.sig bson-X.Y.Z.gem` (replacing `X.Y.Z` with the actual version number).
|
34
|
+
|
35
|
+
You are looking for text like "Good signature from "MongoDB Ruby Driver Release Signing Key <packaging@mongodb.com>" in the output. If you see that, the signature was found to correspond to the given gem file.
|
36
|
+
|
37
|
+
(Note that other output, like "This key is not certified with a trusted signature!", is related to *web of trust* and depends on how strongly you, personally, trust the `ruby-driver.asc` key that you downloaded from us. To learn more, see https://www.gnupg.org/gph/en/manual/x334.html)
|
38
|
+
|
39
|
+
### Why not use RubyGems' gem-signing functionality?
|
40
|
+
|
41
|
+
RubyGems' own gem signing is problematic, most significantly because there is no established chain of trust related to the keys used to sign gems. RubyGems' own documentation admits that "this method of signing gems is not widely used" (see https://guides.rubygems.org/security/). Discussions about this in the RubyGems community have been off-and-on for more than a decade, and while a solution will eventually arrive, we have settled on using GPG instead for the following reasons:
|
42
|
+
|
43
|
+
1. Many of the other driver teams at MongoDB are using GPG to sign their product releases. Consistency with the other teams means that we can reuse existing tooling for our own product releases.
|
44
|
+
2. GPG is widely available and has existing tools and procedures for dealing with web of trust (though they are admittedly quite arcane and intimidating to the uninitiated, unfortunately).
|
45
|
+
|
46
|
+
Ultimately, most users do not bother to verify gems, and will not be impacted by our choice of GPG over RubyGems' native method.
|
47
|
+
|
10
48
|
Compatibility
|
11
49
|
-------------
|
12
50
|
|
13
|
-
BSON is tested against MRI (2.
|
51
|
+
BSON is tested against MRI (2.7+) and JRuby (9.3+).
|
14
52
|
|
15
53
|
Documentation
|
16
54
|
-------------
|
@@ -29,6 +67,56 @@ BSON Specification
|
|
29
67
|
|
30
68
|
The [BSON specification](http://bsonspec.org) is at bsonspec.org.
|
31
69
|
|
70
|
+
## Bugs & Feature Requests
|
71
|
+
|
72
|
+
To report a bug in the `bson` gem or request a feature:
|
73
|
+
|
74
|
+
1. Visit [our issue tracker](https://jira.mongodb.org/) and login
|
75
|
+
(or create an account if you do not have one already).
|
76
|
+
2. Navigate to the [RUBY project](https://jira.mongodb.org/browse/RUBY).
|
77
|
+
3. Click 'Create Issue' and fill out all of the applicable form fields, making
|
78
|
+
sure to select `BSON` in the _Component/s_ field.
|
79
|
+
|
80
|
+
When creating an issue, please keep in mind that all information in JIRA
|
81
|
+
for the RUBY project, as well as the core server (the SERVER project),
|
82
|
+
is publicly visible.
|
83
|
+
|
84
|
+
**PLEASE DO:**
|
85
|
+
|
86
|
+
- Provide as much information as possible about the issue.
|
87
|
+
- Provide detailed steps for reproducing the issue.
|
88
|
+
- Provide any applicable code snippets, stack traces and log data.
|
89
|
+
- Specify version numbers of the `bson` gem and/or Ruby driver and MongoDB
|
90
|
+
server.
|
91
|
+
|
92
|
+
**PLEASE DO NOT:**
|
93
|
+
|
94
|
+
- Provide any sensitive data or server logs.
|
95
|
+
- Report potential security issues publicly (see 'Security Issues' below).
|
96
|
+
|
97
|
+
## Security Issues
|
98
|
+
|
99
|
+
If you have identified a potential security-related issue in the `bson` gem
|
100
|
+
(or any other MongoDB product), please report it by following the
|
101
|
+
[instructions here](https://www.mongodb.com/docs/manual/tutorial/create-a-vulnerability-report).
|
102
|
+
|
103
|
+
## Product Feature Requests
|
104
|
+
|
105
|
+
To request a feature which is not specific to the `bson` gem, or which
|
106
|
+
affects more than the `bson` gem and/or Ruby driver alone (for example, a
|
107
|
+
feature which requires MongoDB server support), please submit your idea through
|
108
|
+
the [MongoDB Feedback Forum](https://feedback.mongodb.com/forums/924286-drivers).
|
109
|
+
|
110
|
+
## Maintenance and Bug Fix Policy
|
111
|
+
|
112
|
+
New library functionality is generally added in a backwards-compatible manner
|
113
|
+
and results in new minor releases. Bug fixes are generally made on
|
114
|
+
master first and are backported to the current minor library release. Exceptions
|
115
|
+
may be made on a case-by-case basis, for example security fixes may be
|
116
|
+
backported to older stable branches. Only the most recent minor release
|
117
|
+
is officially supported. Customers should use the most recent release in
|
118
|
+
their applications.
|
119
|
+
|
32
120
|
Versioning
|
33
121
|
----------
|
34
122
|
|
@@ -56,7 +144,3 @@ limitations under the License.
|
|
56
144
|
[rubygems-url]: http://badge.fury.io/rb/bson
|
57
145
|
[ghactions-img]: https://github.com/mongodb/bson-ruby/actions/workflows/bson-ruby.yml/badge.svg?query=branch%3Amaster
|
58
146
|
[ghactions-url]: https://github.com/mongodb/bson-ruby/actions/workflows/bson-ruby.yml?query=branch%3Amaster
|
59
|
-
[coveralls-img]: https://coveralls.io/repos/mongodb/bson-ruby/badge.svg?branch=master
|
60
|
-
[coveralls-url]: https://coveralls.io/r/mongodb/bson-ruby?branch=master
|
61
|
-
[inch-img]: http://inch-ci.org/github/mongodb/bson-ruby.svg?branch=master
|
62
|
-
[inch-url]: http://inch-ci.org/github/mongodb/bson-ruby
|
data/Rakefile
CHANGED
@@ -47,28 +47,37 @@ else
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
RSpec::Core::RakeTask.new(:rspec)
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
desc 'Build the bson gem'
|
53
|
+
task :build => [ :clean_all, *(jruby? ? :compile : nil) ] do
|
54
|
+
output = "--output=#{ENV['GEM_FILE_NAME']}" if ENV['GEM_FILE_NAME']
|
55
|
+
system "gem build #{output} bson.gemspec"
|
54
56
|
end
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
-
|
58
|
+
# `rake version` is used by the deployment system so get the release version
|
59
|
+
# of the product beng deployed. It must do nothing more than just print the
|
60
|
+
# product version number.
|
61
|
+
desc 'Print the current version of the Ruby-BSON library'
|
62
|
+
task :version do
|
63
|
+
require 'bson/version'
|
64
|
+
puts BSON::VERSION
|
65
|
+
end
|
59
66
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
67
|
+
# `rake gem_file_name` is used by the deployment system so get the name of
|
68
|
+
# the gem file to be generated. It must do nothing more than just print the
|
69
|
+
# name of the gem file to generate.
|
70
|
+
desc 'Print the name of the gem file to generate.'
|
71
|
+
task :gem_file_name do
|
72
|
+
require 'bson/version'
|
73
|
+
base = "bson-#{BSON::VERSION}"
|
74
|
+
base << '-java' if jruby?
|
75
|
+
puts "#{base}.gem"
|
68
76
|
end
|
69
77
|
|
70
78
|
task :clean_all => :clean do
|
71
|
-
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', "bson_native
|
79
|
+
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', "bson_native.bundle"))
|
80
|
+
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', "bson_native.so"))
|
72
81
|
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', "bson_native.o"))
|
73
82
|
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', "bson-ruby.jar"))
|
74
83
|
end
|
@@ -77,49 +86,63 @@ task :spec => :compile do
|
|
77
86
|
Rake::Task["rspec"].invoke
|
78
87
|
end
|
79
88
|
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
# overrides the default Bundler-provided `release` task, which also
|
90
|
+
# builds the gem. Our release process assumes the gem has already
|
91
|
+
# been built (and signed via GPG), so we just need `rake release` to
|
92
|
+
# push the gem to rubygems.
|
93
|
+
task :release do
|
94
|
+
require 'bson/version'
|
95
|
+
|
96
|
+
# confirm: there ought to be two gems, one for MRI, and one for Java. These
|
97
|
+
# will have been previously generated by the 'BSON Release' GitHub action.
|
98
|
+
gems = Dir['*.gem']
|
99
|
+
if gems.length != 2
|
100
|
+
abort "Expected two gem files to be ready to release; got #{gems.length}"
|
101
|
+
end
|
102
|
+
|
103
|
+
if ENV['GITHUB_ACTION'].nil?
|
104
|
+
abort <<~WARNING
|
105
|
+
`rake release` must be invoked from the `BSON Release` GitHub action,
|
106
|
+
and must not be invoked locally. This ensures the gem is properly signed
|
107
|
+
and distributed by the appropriate user.
|
108
|
+
|
109
|
+
Note that it is the `rubygems/release-gem@v1` step in the `BSON Release`
|
110
|
+
action that invokes this task. Do not rename or remove this task, or the
|
111
|
+
release-gem step will fail. Reimplement this task with caution.
|
112
|
+
|
113
|
+
NO GEMS were pushed to RubyGems.
|
114
|
+
WARNING
|
115
|
+
end
|
116
|
+
|
117
|
+
gems.each do |gem|
|
118
|
+
system 'gem', 'push', gem
|
95
119
|
end
|
96
120
|
end
|
97
121
|
|
98
122
|
namespace :benchmark do
|
99
123
|
|
100
|
-
task :
|
124
|
+
task :prep do
|
125
|
+
require_relative "perf/bench"
|
126
|
+
end
|
127
|
+
|
128
|
+
task ruby: [ :clean_all, 'benchmark:prep' ] do
|
101
129
|
puts "Benchmarking pure Ruby..."
|
102
|
-
require "bson"
|
103
130
|
benchmark!
|
104
131
|
end
|
105
132
|
|
106
|
-
task :
|
133
|
+
task native: [ :compile, 'benchmark:prep' ] do
|
107
134
|
puts "Benchmarking with native extensions..."
|
108
|
-
require "bson"
|
109
135
|
benchmark!
|
110
136
|
end
|
111
137
|
|
112
138
|
namespace :decimal128 do
|
113
|
-
|
114
|
-
task :from_string do
|
139
|
+
task from_string: 'benchmark:prep' do
|
115
140
|
puts "Benchmarking creating Decimal128 objects from a string"
|
116
|
-
require 'bson'
|
117
141
|
benchmark_decimal128_from_string!
|
118
142
|
end
|
119
143
|
|
120
|
-
task :
|
144
|
+
task to_string: 'benchmark:prep' do
|
121
145
|
puts "Benchmarking getting a string representation of a Decimal128"
|
122
|
-
require 'bson'
|
123
146
|
benchmark_decimal128_to_string!
|
124
147
|
end
|
125
148
|
end
|
@@ -133,6 +156,7 @@ task :docs => 'docs:yard'
|
|
133
156
|
namespace :docs do
|
134
157
|
desc "Generate yard documention"
|
135
158
|
task :yard do
|
159
|
+
require 'bson/version'
|
136
160
|
out = File.join('yard-docs', BSON::VERSION)
|
137
161
|
FileUtils.rm_rf(out)
|
138
162
|
system "yardoc -o #{out} --title bson-#{BSON::VERSION}"
|
data/ext/bson/read.c
CHANGED
@@ -29,6 +29,7 @@ static VALUE pvt_get_symbol(byte_buffer_t *b, VALUE rb_buffer, int argc, VALUE *
|
|
29
29
|
static VALUE pvt_get_boolean(byte_buffer_t *b);
|
30
30
|
static VALUE pvt_read_field(byte_buffer_t *b, VALUE rb_buffer, uint8_t type, int argc, VALUE *argv);
|
31
31
|
static void pvt_skip_cstring(byte_buffer_t *b);
|
32
|
+
static size_t pvt_strnlen(const byte_buffer_t *b);
|
32
33
|
|
33
34
|
void pvt_raise_decode_error(volatile VALUE msg) {
|
34
35
|
VALUE klass = pvt_const_get_3("BSON", "Error", "BSONDecodeError");
|
@@ -143,7 +144,7 @@ VALUE rb_bson_byte_buffer_get_bytes(VALUE self, VALUE i)
|
|
143
144
|
}
|
144
145
|
|
145
146
|
VALUE pvt_get_boolean(byte_buffer_t *b){
|
146
|
-
VALUE result;
|
147
|
+
VALUE result = Qnil;
|
147
148
|
char byte_value;
|
148
149
|
ENSURE_BSON_READ(b, 1);
|
149
150
|
byte_value = *READ_PTR(b);
|
@@ -236,7 +237,7 @@ VALUE rb_bson_byte_buffer_get_cstring(VALUE self)
|
|
236
237
|
int length;
|
237
238
|
|
238
239
|
TypedData_Get_Struct(self, byte_buffer_t, &rb_byte_buffer_data_type, b);
|
239
|
-
length = (int)
|
240
|
+
length = (int)pvt_strnlen(b);
|
240
241
|
ENSURE_BSON_READ(b, length);
|
241
242
|
string = rb_enc_str_new(READ_PTR(b), length, rb_utf8_encoding());
|
242
243
|
b->read_position += length + 1;
|
@@ -249,7 +250,7 @@ VALUE rb_bson_byte_buffer_get_cstring(VALUE self)
|
|
249
250
|
void pvt_skip_cstring(byte_buffer_t *b)
|
250
251
|
{
|
251
252
|
int length;
|
252
|
-
length = (int)
|
253
|
+
length = (int)pvt_strnlen(b);
|
253
254
|
ENSURE_BSON_READ(b, length);
|
254
255
|
b->read_position += length + 1;
|
255
256
|
}
|
@@ -453,3 +454,17 @@ VALUE rb_bson_byte_buffer_get_array(int argc, VALUE *argv, VALUE self){
|
|
453
454
|
|
454
455
|
return array;
|
455
456
|
}
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Returns the length of the given string `str`. If no null-terminating byte
|
460
|
+
* is present when `len` bytes have been scanned, then `len` is
|
461
|
+
* returned.
|
462
|
+
*/
|
463
|
+
size_t pvt_strnlen(const byte_buffer_t *b) {
|
464
|
+
const char *ptr = memchr(READ_PTR(b), '\0', READ_SIZE(b));
|
465
|
+
|
466
|
+
if (!ptr)
|
467
|
+
rb_raise(rb_eRangeError, "string is too long (possibly not null-terminated)");
|
468
|
+
|
469
|
+
return (size_t)(ptr - READ_PTR(b));
|
470
|
+
}
|
data/ext/bson/util.c
CHANGED
@@ -65,7 +65,7 @@ VALUE rb_bson_object_id_generator_next(int argc, VALUE* args, VALUE self)
|
|
65
65
|
* obtaining the timestamp value." */
|
66
66
|
|
67
67
|
timestamp = rb_funcall(rb_bson_object_id_class, rb_intern("timestamp"), 0);
|
68
|
-
time_component = BSON_UINT32_TO_BE(
|
68
|
+
time_component = BSON_UINT32_TO_BE(NUM2UINT(timestamp));
|
69
69
|
|
70
70
|
/* "A 5-byte field consisting of a random value generated once per process.
|
71
71
|
* This random value is unique to the machine and process.
|
data/ext/bson/write.c
CHANGED
@@ -633,6 +633,10 @@ void pvt_put_array_index(byte_buffer_t *b, int32_t index)
|
|
633
633
|
c_str = buffer;
|
634
634
|
snprintf(buffer, sizeof(buffer), "%d", index);
|
635
635
|
}
|
636
|
+
// strlen is a potential vector for out-of-bounds errors, but
|
637
|
+
// the only way for that to happen here, specifically, is if `index`
|
638
|
+
// is greater than 10e16 - 1, which is far beyond the domain of an
|
639
|
+
// int32.
|
636
640
|
length = strlen(c_str) + 1;
|
637
641
|
ENSURE_BSON_WRITE(b, length);
|
638
642
|
memcpy(WRITE_PTR(b), c_str, length);
|
@@ -156,7 +156,7 @@ module BSON
|
|
156
156
|
# @return [ Regex ] The regex for a valid decimal128 string.
|
157
157
|
#
|
158
158
|
# @since 4.2.0
|
159
|
-
VALID_DECIMAL128_STRING_REGEX =
|
159
|
+
VALID_DECIMAL128_STRING_REGEX = /\A[\-\+]?(\d+(\.\d*)?|\.\d+)(E[\-\+]?\d+)?\Z/i
|
160
160
|
|
161
161
|
# Initialize the FromString Builder object.
|
162
162
|
#
|
data/lib/bson/object_id.rb
CHANGED
@@ -356,12 +356,22 @@ module BSON
|
|
356
356
|
block_given? ? yield(object) : object
|
357
357
|
end
|
358
358
|
|
359
|
+
# The largest numeric value that can be converted to an integer by MRI's
|
360
|
+
# NUM2UINT. Further, the spec dictates that the time component of an
|
361
|
+
# ObjectID must be no more than 4 bytes long, so the spec itself is
|
362
|
+
# constrained in this regard.
|
363
|
+
MAX_INTEGER = 2 ** 32
|
364
|
+
|
359
365
|
# Returns an integer timestamp (seconds since the Epoch). Primarily used
|
360
366
|
# by the generator to produce object ids.
|
361
367
|
#
|
368
|
+
# @note This value is guaranteed to be no more than 4 bytes in length. A
|
369
|
+
# time value far enough in the future to require a larger integer than
|
370
|
+
# 4 bytes will be truncated to 4 bytes.
|
371
|
+
#
|
362
372
|
# @return [ Integer ] the number of seconds since the Epoch.
|
363
373
|
def timestamp
|
364
|
-
::Time.now.to_i
|
374
|
+
::Time.now.to_i % MAX_INTEGER
|
365
375
|
end
|
366
376
|
end
|
367
377
|
|
data/lib/bson/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# rubocop:todo all
|
3
|
+
|
3
4
|
# Copyright (C) 2009-2020 MongoDB Inc.
|
4
5
|
#
|
5
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,5 +16,5 @@
|
|
15
16
|
# limitations under the License.
|
16
17
|
|
17
18
|
module BSON
|
18
|
-
VERSION = "5.0.
|
19
|
+
VERSION = "5.0.1"
|
19
20
|
end
|
data/spec/bson/object_id_spec.rb
CHANGED
@@ -622,6 +622,20 @@ describe BSON::ObjectId do
|
|
622
622
|
end
|
623
623
|
end
|
624
624
|
|
625
|
+
context 'when the timestamp is larger than a 32-bit integer' do
|
626
|
+
let(:distant_future) { Time.at(2 ** 32) }
|
627
|
+
|
628
|
+
before do
|
629
|
+
allow(Time).to receive(:now).and_return(distant_future)
|
630
|
+
end
|
631
|
+
|
632
|
+
let(:object_id) { BSON::ObjectId.new }
|
633
|
+
|
634
|
+
it 'wraps the timestamp to 0' do
|
635
|
+
expect(object_id.to_time).to be == Time.at(0)
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
625
639
|
context 'when fork changes the pid' do
|
626
640
|
before do
|
627
641
|
skip 'requires Process.fork' unless Process.respond_to?(:fork)
|
metadata
CHANGED
@@ -1,41 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The MongoDB Ruby Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMREwDwYDVQQDDAhkYngt
|
14
|
-
cnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZFgNj
|
15
|
-
b20wHhcNMjQwMjA5MTc0NzIyWhcNMjUwMjA4MTc0NzIyWjBBMREwDwYDVQQDDAhk
|
16
|
-
YngtcnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZ
|
17
|
-
FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0/Veq9l47cTfX
|
18
|
-
tQ+kHq2NOCwJuJGt1iXWQ/vH/yp7pZ/bLej7gPDl2CfIngAXRjM7r1FkR9ya7VAm
|
19
|
-
IneBFcVU3HhpIXWi4ByXGjBOXFD1Dfbz4C4zedIWRk/hNzXa+rQY4KPwpOwG/hZg
|
20
|
-
id+rSXWSbNlkyN97XfonweVh7JsIa9X/2JY9ADYjhCfEZF+b0+Wl7+jgwzLWb46I
|
21
|
-
0WH0bZBIZ0BbKAwUXIgvq5mQf9PzukmMVYCwnkJ/P4wrHO22HuwnbMyvJuGjVwqi
|
22
|
-
j1NRp/2vjmKBFWxIfhlSXEIiqAmeEVNXzhPvTVeyo+rma+7R3Bo+4WHkcnPpXJJZ
|
23
|
-
Jd63qXMvTB0GplEcMJPztWhrJOmcxIOVoQyigEPSQT8JpzFVXby4SGioizv2eT7l
|
24
|
-
VYSiCHuc3yEDyq5M+98WGX2etbj6esYtzI3rDevpIAHPB6HQmtoJIA4dSl3gjFb+
|
25
|
-
D+YQSuB2qYu021FI9zeY9sbZyWysEXBxhwrmTk+XUV0qz+OQZkMCAwEAAaN7MHkw
|
26
|
-
CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFH4nnr4tYlatU57RbExW
|
27
|
-
jG86YM5nMB8GA1UdEQQYMBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMB8GA1UdEgQY
|
28
|
-
MBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQBKGtHA
|
29
|
-
fpi3N/BL1J5O4CBsAjtF4jHDiw2r5MwK+66NzMh3uedjgPI7MoosemLy++SB+8BR
|
30
|
-
SE8bDkb6gfDQQzrI6KSXXyqH2TbQXpY5Tac7/yqXRiu8G2qOrOj4czB/Hq7j09CV
|
31
|
-
YoH88v6hL11i5jt6jPjFh8hXYG0hDQxhi3atRz5Wwd98tUf2DSbyJXJiRgCBeZjl
|
32
|
-
rP7AnKsWMu0C+zPlL+nXtQr+nTFtkKXRWfUJMqePpBqtriQvgQ+Y1ItqYVTSLuiM
|
33
|
-
iwUMcn/rGhdCMBSaKDXdFkIveCHQE2f2WBo2EdErrcTrgEKYYdNfzcb/43j7L1kx
|
34
|
-
AUwyTtk+HFrviBynQbKN82rjbZE+5gukVea5c7idQPkqacPYsoU37DI+hTlUyJkV
|
35
|
-
dcTtfEg44lLlfNukBslfiQf54r+uWbyB0m0rDUN/py7/Ghyzt5GLBU91uCO3dGoI
|
36
|
-
55uFRHMvEcJMTDeImC/nuucPCAiEGMHggr9+NPC0tqpxjGKTo7lS7GzUFjg=
|
37
|
-
-----END CERTIFICATE-----
|
38
|
-
date: 2024-02-13 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-07-23 00:00:00.000000000 Z
|
39
12
|
dependencies: []
|
40
13
|
description: A fully featured BSON specification implementation in Ruby
|
41
14
|
email: dbx-ruby@mongodb.com
|
@@ -167,29 +140,6 @@ files:
|
|
167
140
|
- spec/runners/common_driver.rb
|
168
141
|
- spec/runners/corpus.rb
|
169
142
|
- spec/runners/corpus_legacy.rb
|
170
|
-
- spec/shared/LICENSE
|
171
|
-
- spec/shared/bin/get-mongodb-download-url
|
172
|
-
- spec/shared/bin/s3-copy
|
173
|
-
- spec/shared/bin/s3-upload
|
174
|
-
- spec/shared/lib/mrss/child_process_helper.rb
|
175
|
-
- spec/shared/lib/mrss/cluster_config.rb
|
176
|
-
- spec/shared/lib/mrss/constraints.rb
|
177
|
-
- spec/shared/lib/mrss/docker_runner.rb
|
178
|
-
- spec/shared/lib/mrss/eg_config_utils.rb
|
179
|
-
- spec/shared/lib/mrss/event_subscriber.rb
|
180
|
-
- spec/shared/lib/mrss/lite_constraints.rb
|
181
|
-
- spec/shared/lib/mrss/server_version_registry.rb
|
182
|
-
- spec/shared/lib/mrss/session_registry.rb
|
183
|
-
- spec/shared/lib/mrss/session_registry_legacy.rb
|
184
|
-
- spec/shared/lib/mrss/spec_organizer.rb
|
185
|
-
- spec/shared/lib/mrss/utils.rb
|
186
|
-
- spec/shared/share/Dockerfile.erb
|
187
|
-
- spec/shared/share/haproxy-1.conf
|
188
|
-
- spec/shared/share/haproxy-2.conf
|
189
|
-
- spec/shared/shlib/config.sh
|
190
|
-
- spec/shared/shlib/distro.sh
|
191
|
-
- spec/shared/shlib/server.sh
|
192
|
-
- spec/shared/shlib/set_env.sh
|
193
143
|
- spec/spec_helper.rb
|
194
144
|
- spec/spec_tests/common_driver_spec.rb
|
195
145
|
- spec/spec_tests/corpus_legacy_spec.rb
|
@@ -266,7 +216,7 @@ metadata:
|
|
266
216
|
documentation_uri: https://www.mongodb.com/docs/ruby-driver/current/tutorials/bson-v4/
|
267
217
|
homepage_uri: https://www.mongodb.com/docs/ruby-driver/current/tutorials/bson-v4/
|
268
218
|
source_code_uri: https://github.com/mongodb/bson-ruby
|
269
|
-
post_install_message:
|
219
|
+
post_install_message:
|
270
220
|
rdoc_options: []
|
271
221
|
require_paths:
|
272
222
|
- lib
|
@@ -281,8 +231,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
231
|
- !ruby/object:Gem::Version
|
282
232
|
version: 1.3.6
|
283
233
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
285
|
-
signing_key:
|
234
|
+
rubygems_version: 3.4.19
|
235
|
+
signing_key:
|
286
236
|
specification_version: 4
|
287
237
|
summary: Ruby implementation of the BSON specification
|
288
238
|
test_files:
|
@@ -335,29 +285,6 @@ test_files:
|
|
335
285
|
- spec/runners/common_driver.rb
|
336
286
|
- spec/runners/corpus.rb
|
337
287
|
- spec/runners/corpus_legacy.rb
|
338
|
-
- spec/shared/LICENSE
|
339
|
-
- spec/shared/bin/get-mongodb-download-url
|
340
|
-
- spec/shared/bin/s3-copy
|
341
|
-
- spec/shared/bin/s3-upload
|
342
|
-
- spec/shared/lib/mrss/child_process_helper.rb
|
343
|
-
- spec/shared/lib/mrss/cluster_config.rb
|
344
|
-
- spec/shared/lib/mrss/constraints.rb
|
345
|
-
- spec/shared/lib/mrss/docker_runner.rb
|
346
|
-
- spec/shared/lib/mrss/eg_config_utils.rb
|
347
|
-
- spec/shared/lib/mrss/event_subscriber.rb
|
348
|
-
- spec/shared/lib/mrss/lite_constraints.rb
|
349
|
-
- spec/shared/lib/mrss/server_version_registry.rb
|
350
|
-
- spec/shared/lib/mrss/session_registry.rb
|
351
|
-
- spec/shared/lib/mrss/session_registry_legacy.rb
|
352
|
-
- spec/shared/lib/mrss/spec_organizer.rb
|
353
|
-
- spec/shared/lib/mrss/utils.rb
|
354
|
-
- spec/shared/share/Dockerfile.erb
|
355
|
-
- spec/shared/share/haproxy-1.conf
|
356
|
-
- spec/shared/share/haproxy-2.conf
|
357
|
-
- spec/shared/shlib/config.sh
|
358
|
-
- spec/shared/shlib/distro.sh
|
359
|
-
- spec/shared/shlib/server.sh
|
360
|
-
- spec/shared/shlib/set_env.sh
|
361
288
|
- spec/spec_helper.rb
|
362
289
|
- spec/spec_tests/common_driver_spec.rb
|
363
290
|
- spec/spec_tests/corpus_legacy_spec.rb
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data/spec/shared/LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2020 MongoDB, Inc.
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
desired_version, arch = ARGV
|
4
|
-
if arch.nil?
|
5
|
-
STDERR.puts "Usage: get-mongodb-download-url desired-version arch"
|
6
|
-
exit 1
|
7
|
-
end
|
8
|
-
|
9
|
-
$: << File.join(File.dirname(__FILE__), '../lib')
|
10
|
-
require 'mrss/server_version_registry'
|
11
|
-
|
12
|
-
begin
|
13
|
-
puts Mrss::ServerVersionRegistry.new(desired_version, arch).download_url
|
14
|
-
rescue Mrss::ServerVersionRegistry::Error => exc
|
15
|
-
STDERR.puts "Error: #{exc}"
|
16
|
-
exit 2
|
17
|
-
end
|
data/spec/shared/bin/s3-copy
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'optparse'
|
4
|
-
require 'aws-sdk-s3'
|
5
|
-
|
6
|
-
options = {}
|
7
|
-
OptionParser.new do |opts|
|
8
|
-
opts.banner = "Usage: s3-copy options"
|
9
|
-
|
10
|
-
opts.on("-r", "--region=REGION", "AWS region to use (default us-east-1)") do |v|
|
11
|
-
options[:region] = v
|
12
|
-
end
|
13
|
-
|
14
|
-
opts.on("-p", "--param=KEY=VALUE", "Specify parameter for new files") do |v|
|
15
|
-
options[:params] ||= {}
|
16
|
-
k, v = v.split('=', 2)
|
17
|
-
options[:params][k.to_sym] = v
|
18
|
-
end
|
19
|
-
|
20
|
-
opts.on("-f", "--from=BUCKET:PATH", "Bucket name and key (or path) to copy from") do |v|
|
21
|
-
options[:from] = v
|
22
|
-
end
|
23
|
-
|
24
|
-
opts.on("-t", "--to=BUCKET:PATH", "Bucket name and key (or path) to write to (may be specified more than once)") do |v|
|
25
|
-
options[:to] ||= []
|
26
|
-
options[:to] << v
|
27
|
-
end
|
28
|
-
end.parse!
|
29
|
-
|
30
|
-
ENV['AWS_REGION'] ||= options[:region] || 'us-east-1'
|
31
|
-
|
32
|
-
bucket, key = options.fetch(:from).split(':', 2)
|
33
|
-
|
34
|
-
s3 = Aws::S3::Client.new
|
35
|
-
|
36
|
-
options.fetch(:to).each do |dest|
|
37
|
-
STDERR.puts "Copying to #{dest}"
|
38
|
-
dbucket, dkey = dest.split(':', 2)
|
39
|
-
s3.copy_object(
|
40
|
-
bucket: dbucket,
|
41
|
-
key: dkey,
|
42
|
-
copy_source: "/#{bucket}/#{key}",
|
43
|
-
**options[:params] || {},
|
44
|
-
)
|
45
|
-
end
|