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



27
28
29
# File 'lib/git-lfs-s3/aws.rb', line 27

def aws_access_key_id
  GitLfsS3::Application.settings.aws_access_key_id
end

#aws_regionObject



23
24
25
# File 'lib/git-lfs-s3/aws.rb', line 23

def aws_region
  GitLfsS3::Application.settings.aws_region
end

#aws_secret_access_keyObject



31
32
33
# File 'lib/git-lfs-s3/aws.rb', line 31

def aws_secret_access_key
  GitLfsS3::Application.settings.aws_secret_access_key
end

#bucketObject



15
16
17
# File 'lib/git-lfs-s3/aws.rb', line 15

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

#bucket_nameObject



11
12
13
# File 'lib/git-lfs-s3/aws.rb', line 11

def bucket_name
  GitLfsS3::Application.settings.s3_bucket
end

#object_data(oid) ⇒ Object



19
20
21
# File 'lib/git-lfs-s3/aws.rb', line 19

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

#s3Object



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

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