cognac 0.1.0 → 0.1.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 +10 -4
- data/cognac.gemspec +1 -0
- data/lib/cognac/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 919761511baee7130f501a32e61618926799b652
|
4
|
+
data.tar.gz: 44fbca19631cea02f42324770ea4f60bbfdbce18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1481ceb5cc53846f9db92cbc24a0bf5b3784b09a4c992e815b2d22a7f39bfeadc37119d8141c576e27ab7d67ef7c6b9d149bc063644e2c928ccc7a5cd01ddb3c
|
7
|
+
data.tar.gz: e7b2d39d146e3955effedecd3bc04a24bf413ddbc995e60a0227f63e632336bf5398942aae716340c4138b1a08b566dc24c447babcf1430143c848e115d48760
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Cognac
|
2
2
|
|
3
|
-
This is a lightweight gem for implementing Amazon S3 upload using CORS support. The dependencies are kept to a minimum for easier maintenance.
|
3
|
+
This is a lightweight gem for implementing Amazon S3 upload using CORS support. The dependencies are kept to a minimum for easier maintenance.
|
4
|
+
|
5
|
+
This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html. It requires the Amazon keys, as well as options about the request (request type, resource, etc).
|
6
|
+
|
7
|
+
To experiment with this code, run `bin/console` for an interactive prompt.
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -30,11 +34,13 @@ You can use this gem in your Rails controller like this:
|
|
30
34
|
```ruby
|
31
35
|
def generate_signed_s3_url
|
32
36
|
# To avoid file collision, we prepend string to the file_name
|
33
|
-
file_name = Cognac::CloudFile.generate(params[:
|
37
|
+
file_name = Cognac::CloudFile.generate(params[:filename])
|
34
38
|
resource_end_point = Cognac::CloudFile.resource_end_point(ENV["AWS_S3_BUCKET"], file_name)
|
39
|
+
|
35
40
|
options = Cognac::Signature.generate_options_for_build_s3_upload_url(ENV["AWS_S3_BUCKET"], file_name, params[:content_type])
|
36
|
-
url =
|
37
|
-
|
41
|
+
url = Cognac::Signature.build_s3_upload_url(resource_end_point, ENV["AWS_ACCESS_KEY_ID"], ENV["AWS_SECRET_ACCESS_KEY"], options)
|
42
|
+
|
43
|
+
render :json => {:put_url => url, :file_url => resource_end_point}
|
38
44
|
end
|
39
45
|
```
|
40
46
|
|
data/cognac.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["bparanj@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{A simple library to implement Amazon S3 upload using CORS.}
|
13
|
+
spec.description = %q{This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html. It requires the Amazon keys, as well as options about the request (request type, resource, etc).}
|
13
14
|
spec.homepage = "http://www.rubyplus.com"
|
14
15
|
spec.license = "MIT"
|
15
16
|
|
data/lib/cognac/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cognac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bala Paranj
|
@@ -66,7 +66,9 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.7'
|
69
|
-
description:
|
69
|
+
description: This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html.
|
70
|
+
It requires the Amazon keys, as well as options about the request (request type,
|
71
|
+
resource, etc).
|
70
72
|
email:
|
71
73
|
- bparanj@gmail.com
|
72
74
|
executables: []
|