Skip to content

Commit

Permalink
Merge pull request #8 from wallarm/dev
Browse files Browse the repository at this point in the history
Revert public urls
  • Loading branch information
yamax2 authored Sep 29, 2022
2 parents 8d150eb + f226a08 commit 43fea16
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- GCS_BUCKET=some-bucket
- image: minio/minio:edge
entrypoint: sh
command: -c 'mkdir -p /data/test && /usr/bin/minio server /data --json'
command: -c 'mkdir -p /data/test && minio server /data --json'
- image: fsouza/fake-gcs-server
entrypoint: sh
command: >
Expand All @@ -40,7 +40,7 @@ references:
test:
matrix:
parameters:
ruby_version: ["2.5", "2.6", "2.7", "3.0"]
ruby_version: ["2.5", "2.7", "3.0", "3.1"]

workflows:
version: 2
Expand Down
31 changes: 0 additions & 31 deletions CHANGELOG.md

This file was deleted.

7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ cli = CloudStorage::Client.new(
=> "http://wallarm-devtmp-ipfeeds-presigned-urls-research.s3:4569/Gemfile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Date=20210310T061122Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=..."
```

### public url

```ruby
> cli.find('test.txt').url
=> "https://storage.googleapis.com/some-bucket/test_1.txt"
```

### Download

```ruby
Expand Down
4 changes: 0 additions & 4 deletions lib/cloud_storage/objects/gcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ def signed_url(**opts)
@internal.signed_url version: :v4, **opts
end

def url
@internal.url
end

alias name key

def delete!
Expand Down
6 changes: 1 addition & 5 deletions lib/cloud_storage/objects/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def key
@internal.key
end

alias name key

def signed_url(**opts)
signer = Aws::S3::Presigner.new(client: @client)

Expand All @@ -30,9 +28,7 @@ def signed_url(**opts)
response_content_type: opts[:content_type]
end

def url
@internal.public_url
end
alias name key

def delete!
@resource.bucket(bucket_name).object(key).delete
Expand Down
2 changes: 1 addition & 1 deletion lib/cloud_storage/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CloudStorage
VERSION = '0.2.0'
VERSION = '0.2.1'
end
8 changes: 0 additions & 8 deletions spec/cloud_storage/objects/gcs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
end
end

describe '#url' do
subject(:url) { obj.url }

after { obj.delete! }

it { is_expected.to eq('https://storage.googleapis.com/some-bucket/test_1.txt') }
end

describe '#delete!' do
context 'when file exists' do
it do
Expand Down
8 changes: 0 additions & 8 deletions spec/cloud_storage/objects/s3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
end
end

describe '#url' do
subject(:url) { obj.url }

after { obj.delete! }

it { is_expected.to eq("#{ENV.fetch('S3_ENDPOINT')}/#{ENV.fetch('S3_BUCKET')}/test_1.txt") }
end

describe '#delete!' do
context 'when file exists' do
it do
Expand Down

0 comments on commit 43fea16

Please sign in to comment.