Skip to content

Commit

Permalink
Change config namespace to whisk.s3 from whisk.db.s3
Browse files Browse the repository at this point in the history
  • Loading branch information
chetanmeh committed Jun 21, 2018
1 parent 9fcbaa6 commit 418dcf3
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 69 deletions.
126 changes: 62 additions & 64 deletions common/scala/src/main/resources/s3-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,77 @@
# license agreements; and to You under the Apache License, Version 2.0.

whisk {
db {
s3 {
# See https://developer.lightbend.com/docs/alpakka/current/s3.html#usage
alpakka {
# whether the buffer request chunks (up to 5MB each) to "memory" or "disk"
buffer = "memory"
s3 {
# See https://developer.lightbend.com/docs/alpakka/current/s3.html#usage
alpakka {
# whether the buffer request chunks (up to 5MB each) to "memory" or "disk"
buffer = "memory"

# location for temporary files, if buffer is set to "disk". If empty, uses the standard java temp path.
disk-buffer-path = ""
# location for temporary files, if buffer is set to "disk". If empty, uses the standard java temp path.
disk-buffer-path = ""

proxy {
# hostname of the proxy. If undefined ("") proxy is not enabled.
host = ""
port = 8000
proxy {
# hostname of the proxy. If undefined ("") proxy is not enabled.
host = ""
port = 8000

# if "secure" is set to "true" then HTTPS will be used for all requests to S3, otherwise HTTP will be used
secure = true
}
# if "secure" is set to "true" then HTTPS will be used for all requests to S3, otherwise HTTP will be used
secure = true
}

# default values for AWS configuration. If credentials and/or region are not specified when creating S3Client,
# these values will be used.
aws {
# If this section is absent, the fallback behavior is to use the
# com.amazonaws.auth.DefaultAWSCredentialsProviderChain instance to resolve credentials
credentials {
# supported providers:
# anon - anonymous requests ("no auth")
# static - static credentials,
# required params:
# access-key-id
# secret-access-key
# optional:
# token
# default: as described in com.amazonaws.auth.DefaultAWSCredentialsProviderChain docs,
# attempts to get the credentials from either:
# - environment variables
# - system properties
# - credentials file
# - EC2 credentials service
# - IAM / metadata
provider = default
}
# default values for AWS configuration. If credentials and/or region are not specified when creating S3Client,
# these values will be used.
aws {
# If this section is absent, the fallback behavior is to use the
# com.amazonaws.auth.DefaultAWSCredentialsProviderChain instance to resolve credentials
credentials {
# supported providers:
# anon - anonymous requests ("no auth")
# static - static credentials,
# required params:
# access-key-id
# secret-access-key
# optional:
# token
# default: as described in com.amazonaws.auth.DefaultAWSCredentialsProviderChain docs,
# attempts to get the credentials from either:
# - environment variables
# - system properties
# - credentials file
# - EC2 credentials service
# - IAM / metadata
provider = default
}

# If this section is absent, the fallback behavior is to use the
# com.amazonaws.regions.AwsRegionProvider.DefaultAwsRegionProviderChain instance to resolve region
region {
# supported providers:
# static - static credentials,
# required params:
# default-region
# default: as described in com.amazonaws.regions.AwsRegionProvider.DefaultAwsRegionProviderChain docs,
# attempts to get the region from either:
# - environment variables
# - system properties
# - progile file
# - EC2 metadata
provider = default
}
# If this section is absent, the fallback behavior is to use the
# com.amazonaws.regions.AwsRegionProvider.DefaultAwsRegionProviderChain instance to resolve region
region {
# supported providers:
# static - static credentials,
# required params:
# default-region
# default: as described in com.amazonaws.regions.AwsRegionProvider.DefaultAwsRegionProviderChain docs,
# attempts to get the region from either:
# - environment variables
# - system properties
# - progile file
# - EC2 metadata
provider = default
}
}

# Enable path style access to s3, i.e. "https://s3-eu-west-1.amazonaws.com/my.bucket/myobject"
# Default is virtual-hosted style.
# When using virtual hosted–style buckets with SSL, the S3 wild card certificate only matches buckets that do not contain periods.
# Buckets containing periods will lead to certificate errors. In those cases it's useful to enable path-style access.
path-style-access = true
# Enable path style access to s3, i.e. "https://s3-eu-west-1.amazonaws.com/my.bucket/myobject"
# Default is virtual-hosted style.
# When using virtual hosted–style buckets with SSL, the S3 wild card certificate only matches buckets that do not contain periods.
# Buckets containing periods will lead to certificate errors. In those cases it's useful to enable path-style access.
path-style-access = true

# Custom endpoint url, used for alternate s3 implementations
# endpoint-url = null
# Custom endpoint url, used for alternate s3 implementations
# endpoint-url = null

# Which version of the list bucket api to use. Set to 1 to use the old style version 1 API.
# By default the newer version 2 api is used.
list-bucket-api-version = 2
}
# Which version of the list bucket api to use. Set to 1 to use the old style version 1 API.
# By default the newer version 2 api is used.
list-bucket-api-version = 2
}
}
}
2 changes: 1 addition & 1 deletion common/scala/src/main/scala/whisk/core/WhiskConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,6 @@ object ConfigKeys {
val containerProxy = "whisk.container-proxy"
val containerProxyTimeouts = s"$containerProxy.timeouts"

val s3 = s"$db.s3"
val s3 = "whisk.s3"

}
2 changes: 0 additions & 2 deletions tests/src/test/scala/whisk/core/database/s3/S3Aws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ trait S3Aws extends FlatSpec {
materializer: ActorMaterializer): AttachmentStore = {
val config = ConfigFactory.parseString(s"""
|whisk {
| db {
| s3 {
| alpakka {
| aws {
Expand All @@ -49,7 +48,6 @@ trait S3Aws extends FlatSpec {
| }
| bucket = "$bucket"
| }
| }
|}
""".stripMargin).withFallback(ConfigFactory.load())
S3AttachmentStoreProvider.makeStore[D](config)
Expand Down
2 changes: 0 additions & 2 deletions tests/src/test/scala/whisk/core/database/s3/S3Minio.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ trait S3Minio extends FlatSpec with BeforeAndAfterAll with StreamLogging {
materializer: ActorMaterializer): AttachmentStore = {
val config = ConfigFactory.parseString(s"""
|whisk {
| db{
| s3 {
| alpakka {
| aws {
Expand All @@ -58,7 +57,6 @@ trait S3Minio extends FlatSpec with BeforeAndAfterAll with StreamLogging {
| }
| bucket = "$bucket"
| }
| }
|}
""".stripMargin).withFallback(ConfigFactory.load())
S3AttachmentStoreProvider.makeStore[D](config)
Expand Down

0 comments on commit 418dcf3

Please sign in to comment.