Skip to content

Commit

Permalink
Uplink-c v1.8.0 changes update (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
s101d1 authored Sep 20, 2023
1 parent 408dd65 commit 2f29dd6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Ruby bindings to the [libuplink](https://github.com/storj/uplink-c) Storj API li

### Prerequisites
* Clone [uplink-c](https://github.com/storj/uplink-c) repository.
* Check out the release version `v1.7.0`.
* Check out the release version `v1.8.0`.
```bash
$ git fetch --tags
$ git checkout tags/v1.7.0
$ git checkout tags/v1.8.0
```
* Run `make build` to build the uplink-c library.
* The `libuplink.so` file should be created in the `.build` folder.
Expand All @@ -23,9 +23,18 @@ Ruby bindings to the [libuplink](https://github.com/storj/uplink-c) Storj API li
Add this line to your application's Gemfile:
```ruby
gem 'uplink-ruby', '~> 1.7.0'
gem 'uplink-ruby', '~> 1.8.0'
```
or from the git:
```ruby
gem 'uplink-ruby', git: 'https://github.com/storj-thirdparty/uplink-ruby', tag: 'v1.8.0'
```
Make sure the major & minor version of the gem or git tag matches the uplink-c release version.
### Running the Tests
* Create a [Storj](https://www.storj.io/) account.
* In the Storj Dashboard, create an Access Grant and set the access grant key to `UPLINK_0_ACCESS` environment variable
Expand Down
1 change: 1 addition & 0 deletions lib/uplink/access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def edge_register_access(config, options = nil)
certificate_pem = FFI::MemoryPointer.from_string(config[:certificate_pem]) if config[:certificate_pem]
register_config[:auth_service_address] = auth_service_address
register_config[:certificate_pem] = certificate_pem
register_config[:insecure_unencrypted_connection] = config[:insecure_unencrypted_connection]

register_options = nil
if options && !options.empty?
Expand Down
3 changes: 2 additions & 1 deletion lib/uplink_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ class UplinkListUploadPartsOptions < FFI::Struct

class EdgeConfig < FFI::Struct
layout :auth_service_address, :pointer, # string
:certificate_pem, :pointer # string
:certificate_pem, :pointer, # string
:insecure_unencrypted_connection, :bool
end

class EdgeRegisterAccessOptions < FFI::Struct
Expand Down
5 changes: 0 additions & 5 deletions spec/lib/access_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ module UplinkTest
dial_timeout_milliseconds: 10_000
}
expect { described_class.request_access_with_passphrase_and_config(config, SATELLITE_ADDRESS, API_KEY, PASSPHRASE) { |_access| nil } }.not_to raise_error

config = {
dial_timeout_milliseconds: 1
}
expect { described_class.request_access_with_passphrase_and_config(config, SATELLITE_ADDRESS, API_KEY, PASSPHRASE) { |_access| nil } }.to raise_error(described_class::InternalError)
end

it 'returning satellite address' do
Expand Down
7 changes: 0 additions & 7 deletions spec/lib/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ module UplinkTest
dial_timeout_milliseconds: 10_000
}
expect { access.open_project_with_config(config) { |_project| nil } }.not_to raise_error

config = {
dial_timeout_milliseconds: 1
}
access.open_project_with_config(config) do |project|
expect { project.ensure_bucket(bucket_name) }.to raise_error(described_class::InternalError)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion uplink-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = 'uplink-ruby'
s.version = '1.7.0'
s.version = '1.8.0'
s.summary = 'libuplink bindings for ruby'
s.description = 'Ruby bindings to the libuplink C Storj API library'
s.authors = ['Your Data Inc']
Expand Down

0 comments on commit 2f29dd6

Please sign in to comment.