File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
src/aws/sdk/kotlin/services/dsql
test/aws/sdk/kotlin/services/dsql
src/aws/sdk/kotlin/services/rds Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 44 */
55package aws.sdk.kotlin.services.dsql
66
7+ import aws.sdk.kotlin.runtime.auth.AuthTokenGenerator
78import aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider
89import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
910import aws.smithy.kotlin.runtime.net.url.Url
1011import kotlinx.coroutines.runBlocking
1112import kotlin.time.Duration
1213import kotlin.time.Duration.Companion.seconds
13- import aws.sdk.kotlin.runtime.auth.AuthTokenGenerator
1414
1515/* *
1616 * Generates an IAM authentication token for use with DSQL databases
1717 * @param credentials The credentials to use when generating the auth token, defaults to resolving credentials from the [DefaultChainCredentialsProvider]
1818 */
1919public class AuthTokenGenerator (
20- public val credentials : Credentials ? = runBlocking { DefaultChainCredentialsProvider ().resolve() }
20+ public val credentials : Credentials ? = runBlocking { DefaultChainCredentialsProvider ().resolve() },
2121) {
2222 private val generator = AuthTokenGenerator (" dsql" , credentials)
2323
@@ -56,4 +56,4 @@ public class AuthTokenGenerator(
5656
5757 return generator.generateAuthToken(dbConnectAdminEndpoint, region, expiration)
5858 }
59- }
59+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class AuthTokenGeneratorTest {
2323 .generateDbConnectAuthToken(
2424 endpoint = Url { host = Host .parse(" peccy.dsql.us-east-1.on.aws" ) },
2525 region = " us-east-1" ,
26- expiration = 450 .seconds
26+ expiration = 450 .seconds,
2727 )
2828
2929 // Token should have a parameter Action=DbConnect
@@ -49,7 +49,7 @@ class AuthTokenGeneratorTest {
4949 .generateDbConnectAdminAuthToken(
5050 endpoint = Url { host = Host .parse(" peccy.dsql.us-east-1.on.aws" ) },
5151 region = " us-east-1" ,
52- expiration = 450 .seconds
52+ expiration = 450 .seconds,
5353 )
5454
5555 // Token should have a parameter Action=DbConnect
@@ -66,4 +66,4 @@ class AuthTokenGeneratorTest {
6666 assertFalse(token.contains(it))
6767 }
6868 }
69- }
69+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import kotlin.time.Duration.Companion.seconds
1818 * @param credentials The credentials to use when generating the auth token, defaults to resolving credentials from the [DefaultChainCredentialsProvider]
1919 */
2020public class AuthTokenGenerator (
21- public val credentials : Credentials ? = runBlocking { DefaultChainCredentialsProvider ().resolve() }
21+ public val credentials : Credentials ? = runBlocking { DefaultChainCredentialsProvider ().resolve() },
2222) {
2323 private val generator = AuthTokenGenerator (" rds-db" , credentials)
2424
@@ -40,4 +40,4 @@ public class AuthTokenGenerator(
4040
4141 return generator.generateAuthToken(dbConnectEndpoint, region, expiration)
4242 }
43- }
43+ }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class AuthTokenGeneratorTest {
2727 },
2828 region = " us-east-1" ,
2929 username = " peccy" ,
30- expiration = 450 .seconds
30+ expiration = 450 .seconds,
3131 )
3232
3333 // Token should have a parameter Action=DbConnect
@@ -44,4 +44,4 @@ class AuthTokenGeneratorTest {
4444 assertFalse(token.contains(it))
4545 }
4646 }
47- }
47+ }
You can’t perform that action at this time.
0 commit comments