Module: GitLfsS3::AwsHelpers

Included in:
Application, CephPresignerService, UploadService, UploadService::Base
Defined in:
lib/git-lfs-s3/aws.rb

Instance Method Summary collapse

Instance Method Details

#aws_access_key_idObject



29
30
31
# File 'lib/git-lfs-s3/aws.rb', line 29

def aws_access_key_id
  GitLfsS3::Application.settings.aws_access_key_id
end

#aws_regionObject



25
26
27
# File 'lib/git-lfs-s3/aws.rb', line 25

def aws_region
  GitLfsS3::Application.settings.aws_region
end

#aws_secret_access_keyObject



33
34
35
# File 'lib/git-lfs-s3/aws.rb', line 33

def aws_secret_access_key
  GitLfsS3::Application.settings.aws_secret_access_key
end

#bucketObject



17
18
19
# File 'lib/git-lfs-s3/aws.rb', line 17

def bucket
  @bucket ||= Aws::S3::Bucket.new(name: bucket_name, client: s3)
end

#bucket_nameObject



13
14
15
# File 'lib/git-lfs-s3/aws.rb', line 13

def bucket_name
  GitLfsS3::Application.settings.s3_bucket
end

#object_data(oid) ⇒ Object



21
22
23
# File 'lib/git-lfs-s3/aws.rb', line 21

def object_data(oid)
  bucket.object("data/#{oid}")
end

#s3Object



5
6
7
8
9
10
11
# File 'lib/git-lfs-s3/aws.rb', line 5

def s3
  @s3 ||= Aws::S3::Client.new({
                                region: aws_region,
                                access_key_id: aws_access_key_id,
                                secret_access_key: aws_secret_access_key
                              })
end