-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update settings loading and parsing code
- Loading branch information
Showing
16 changed files
with
252 additions
and
199 deletions.
There are no files selected for viewing
43 changes: 10 additions & 33 deletions
43
...domain-auth-core/src/main/scala/com/gu/pandomainauth/PanDomainAuthSettingsRefresher.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
pan-domain-auth-verification/src/main/scala/com/gu/pandomainauth/S3BucketLoader.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.gu.pandomainauth | ||
|
||
import com.amazonaws.services.s3.AmazonS3 | ||
|
||
import java.io.InputStream | ||
|
||
/** | ||
* This trait provides a way to download a file from an S3 bucket, in a way that's agnostic of which | ||
* AWS SDK (v1 or v2) is being used. An instance of S3BucketLoader is *specific* to a particular S3 bucket. | ||
*/ | ||
trait S3BucketLoader { | ||
/** | ||
* @param key the key of the file in the S3 bucket, not including the bucket name or a starting "/" | ||
*/ | ||
def inputStreamFetching(key: String): InputStream | ||
} | ||
|
||
object S3BucketLoader { | ||
/** | ||
* A convenience method to create an S3BucketLoader using AWS SDK v1, the version used by most of our existing code. | ||
* However, codebases that want to use AWS SDK v2 are able to provide their own implementation of S3BucketLoader. | ||
*/ | ||
def forAwsSdkV1(s3Client: AmazonS3, bucketName: String): S3BucketLoader = | ||
s3Client.getObject(bucketName, _).getObjectContent | ||
} |
Oops, something went wrong.