Skip to content

Commit

Permalink
Merge 1e7dd90 into c3bdaf6
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlittman committed Jan 15, 2020
2 parents c3bdaf6 + 1e7dd90 commit 1345520
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/lib/preservation_catalog/s3/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module S3
# Methods for auditing checking the state of a ZippedMoabVersion on an S3 endpoint. Requires AWS credentials are
# available in the environment. At the time of this comment, ONLY running queue workers will have proper creds loaded.
class Audit
delegate :bucket, :bucket_name, to: ::PreservationCatalog::S3
delegate :bucket_name, to: ::PreservationCatalog::S3

attr_reader :zmv, :results

Expand Down Expand Up @@ -72,6 +72,14 @@ def check_existence(aws_s3_object, part)
false
end
end

def bucket
endpoint = zmv.zip_endpoint.endpoint_name
::PreservationCatalog::S3.configure(region: Settings.zip_endpoints[endpoint].region,
access_key_id: Settings.zip_endpoints[endpoint].access_key_id,
secret_access_key: Settings.zip_endpoints[endpoint].secret_access_key)
::PreservationCatalog::S3.bucket
end
end
end
end

0 comments on commit 1345520

Please sign in to comment.