Skip to content

Commit

Permalink
Fix EC2/ECS test server default values (#623)
Browse files Browse the repository at this point in the history
* Fix EC2/ECS test server default values

* swift format
  • Loading branch information
adam-fowler authored Nov 21, 2024
1 parent ec88874 commit 96e58b6
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions Sources/SotoTestUtils/TestServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ extension AWSTestServer {
case v2
}

public struct EC2InstanceMetaData: Encodable {
public struct EC2InstanceMetaData: Encodable, Sendable {
public let accessKeyId: String
public let secretAccessKey: String
public let token: String
Expand All @@ -174,17 +174,15 @@ extension AWSTestServer {
public let lastUpdated: Date
public let type: String

public static var `default`: EC2InstanceMetaData {
.init(
accessKeyId: "EC2ACCESSKEYID",
secretAccessKey: "EC2SECRETACCESSKEY",
token: "EC2SESSIONTOKEN",
expiration: Date(timeIntervalSinceNow: 3600),
code: "ec2-test-role",
lastUpdated: Date(timeIntervalSinceReferenceDate: 0),
type: "type"
)
}
public static let `default` = EC2InstanceMetaData(
accessKeyId: "EC2ACCESSKEYID",
secretAccessKey: "EC2SECRETACCESSKEY",
token: "EC2SESSIONTOKEN",
expiration: Date(timeIntervalSinceNow: 3600),
code: "ec2-test-role",
lastUpdated: Date(timeIntervalSinceReferenceDate: 0),
type: "type"
)

enum CodingKeys: String, CodingKey {
case accessKeyId = "AccessKeyId"
Expand All @@ -197,22 +195,20 @@ extension AWSTestServer {
}
}

public struct ECSMetaData: Encodable {
public struct ECSMetaData: Encodable, Sendable {
public let accessKeyId: String
public let secretAccessKey: String
public let token: String
public let expiration: Date
public let roleArn: String

public static var `default`: ECSMetaData {
.init(
accessKeyId: "ECSACCESSKEYID",
secretAccessKey: "ECSSECRETACCESSKEY",
token: "ECSSESSIONTOKEN",
expiration: Date(timeIntervalSinceNow: 3600),
roleArn: "arn:aws:iam:000000000000:role/ecs-test-role"
)
}
public static let `default` = ECSMetaData(
accessKeyId: "ECSACCESSKEYID",
secretAccessKey: "ECSSECRETACCESSKEY",
token: "ECSSESSIONTOKEN",
expiration: Date(timeIntervalSinceNow: 3600),
roleArn: "arn:aws:iam:000000000000:role/ecs-test-role"
)

enum CodingKeys: String, CodingKey {
case accessKeyId = "AccessKeyId"
Expand Down

0 comments on commit 96e58b6

Please sign in to comment.