@@ -1304,6 +1304,29 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1304
1304
},
1305
1305
Type : HVSSecretTypeKV ,
1306
1306
},
1307
+ {
1308
+ CreatedAt : strfmt .NewDateTime (),
1309
+ CreatedByID : "vso-2 uuid" ,
1310
+ LatestVersion : 1 ,
1311
+ Name : "rotatingfoo" ,
1312
+ Provider : "providerfoo" ,
1313
+ SyncStatus : nil ,
1314
+ RotatingVersion : & models.Secrets20231128OpenSecretRotatingVersion {
1315
+ CreatedAt : strfmt.DateTime {},
1316
+ CreatedByID : "vault-secrets-rotator" ,
1317
+ ExpiresAt : strfmt.DateTime {},
1318
+ Keys : []string {
1319
+ "api_key_one" ,
1320
+ "api_key_two" ,
1321
+ },
1322
+ Values : map [string ]string {
1323
+ "api_key_one" : "123456" ,
1324
+ "api_key_two" : "654321" ,
1325
+ },
1326
+ Version : 1 ,
1327
+ },
1328
+ Type : HVSSecretTypeRotating ,
1329
+ },
1307
1330
},
1308
1331
},
1309
1332
}
@@ -1366,9 +1389,11 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1366
1389
name : "valid" ,
1367
1390
resp : respValid ,
1368
1391
want : map [string ][]byte {
1369
- "bar" : []byte ("foo" ),
1370
- "foo" : []byte ("qux" ),
1371
- SecretDataKeyRaw : rawValid ,
1392
+ "bar" : []byte ("foo" ),
1393
+ "foo" : []byte ("qux" ),
1394
+ "rotatingfoo_api_key_one" : []byte ("123456" ),
1395
+ "rotatingfoo_api_key_two" : []byte ("654321" ),
1396
+ SecretDataKeyRaw : rawValid ,
1372
1397
},
1373
1398
wantErr : assert .NoError ,
1374
1399
},
@@ -1387,9 +1412,11 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1387
1412
},
1388
1413
},
1389
1414
want : map [string ][]byte {
1390
- "bar" : []byte ("FOO" ),
1391
- "foo" : []byte ("qux" ),
1392
- SecretDataKeyRaw : rawValid ,
1415
+ "bar" : []byte ("FOO" ),
1416
+ "foo" : []byte ("qux" ),
1417
+ "rotatingfoo_api_key_one" : []byte ("123456" ),
1418
+ "rotatingfoo_api_key_two" : []byte ("654321" ),
1419
+ SecretDataKeyRaw : rawValid ,
1393
1420
},
1394
1421
wantErr : assert .NoError ,
1395
1422
},
@@ -1428,12 +1455,31 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1428
1455
"version": 2
1429
1456
},
1430
1457
"type": "kv"
1458
+ },
1459
+ "rotatingfoo": {
1460
+ "created_at": "1970-01-01T00:00:00.000Z",
1461
+ "latest_version": 1,
1462
+ "name": "rotatingfoo",
1463
+ "provider": "providerfoo",
1464
+ "rotating_version": {
1465
+ "created_at": "0001-01-01T00:00:00.000Z",
1466
+ "expires_at": "0001-01-01T00:00:00.000Z",
1467
+ "keys": [
1468
+ "api_key_one",
1469
+ "api_key_two"
1470
+ ],
1471
+ "revoked_at": "0001-01-01T00:00:00.000Z",
1472
+ "version": 1
1473
+ },
1474
+ "type": "rotating"
1431
1475
}
1432
1476
}` ,
1433
1477
),
1434
- "bar" : []byte ("foo" ),
1435
- "foo" : []byte ("qux" ),
1436
- SecretDataKeyRaw : rawValid ,
1478
+ "bar" : []byte ("foo" ),
1479
+ "foo" : []byte ("qux" ),
1480
+ "rotatingfoo_api_key_one" : []byte ("123456" ),
1481
+ "rotatingfoo_api_key_two" : []byte ("654321" ),
1482
+ SecretDataKeyRaw : rawValid ,
1437
1483
},
1438
1484
wantErr : assert .NoError ,
1439
1485
},
@@ -1465,8 +1511,10 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1465
1511
Includes : []string {"foo" },
1466
1512
},
1467
1513
want : map [string ][]byte {
1468
- "foo" : []byte ("qux" ),
1469
- SecretDataKeyRaw : rawValid ,
1514
+ "foo" : []byte ("qux" ),
1515
+ "rotatingfoo_api_key_one" : []byte ("123456" ),
1516
+ "rotatingfoo_api_key_two" : []byte ("654321" ),
1517
+ SecretDataKeyRaw : rawValid ,
1470
1518
},
1471
1519
wantErr : assert .NoError ,
1472
1520
},
@@ -1517,8 +1565,10 @@ func TestSecretDataBuilder_WithHVSAppSecrets(t *testing.T) {
1517
1565
ExcludeRaw : true ,
1518
1566
},
1519
1567
want : map [string ][]byte {
1520
- "bar" : []byte ("foo" ),
1521
- "foo" : []byte ("qux" ),
1568
+ "bar" : []byte ("foo" ),
1569
+ "foo" : []byte ("qux" ),
1570
+ "rotatingfoo_api_key_one" : []byte ("123456" ),
1571
+ "rotatingfoo_api_key_two" : []byte ("654321" ),
1522
1572
},
1523
1573
wantErr : assert .NoError ,
1524
1574
},
0 commit comments