@@ -1569,7 +1569,6 @@ func mustCertificate(t *testing.T, pub, priv interface{}) *x509.Certificate {
1569
1569
}
1570
1570
1571
1571
func TestProvisionersResponse_MarshalJSON (t * testing.T ) {
1572
-
1573
1572
k := map [string ]any {
1574
1573
"use" : "sig" ,
1575
1574
"kty" : "EC" ,
@@ -1581,9 +1580,14 @@ func TestProvisionersResponse_MarshalJSON(t *testing.T) {
1581
1580
}
1582
1581
key := squarejose.JSONWebKey {}
1583
1582
b , err := json .Marshal (k )
1584
- assert . FatalError (t , err )
1583
+ require . NoError (t , err )
1585
1584
err = json .Unmarshal (b , & key )
1586
- assert .FatalError (t , err )
1585
+ require .NoError (t , err )
1586
+
1587
+ var encodedPassword bytes.Buffer
1588
+ enc := base64 .NewEncoder (base64 .StdEncoding , & encodedPassword )
1589
+ _ , err = enc .Write ([]byte ("super-secret-password" ))
1590
+ require .NoError (t , err )
1587
1591
1588
1592
r := ProvisionersResponse {
1589
1593
Provisioners : provisioner.List {
@@ -1593,9 +1597,12 @@ func TestProvisionersResponse_MarshalJSON(t *testing.T) {
1593
1597
ChallengePassword : "not-so-secret" ,
1594
1598
MinimumPublicKeyLength : 2048 ,
1595
1599
EncryptionAlgorithmIdentifier : 2 ,
1600
+ IncludeRoot : true ,
1601
+ ExcludeIntermediate : true ,
1596
1602
DecrypterCertificate : []byte {1 , 2 , 3 , 4 },
1597
- DecrypterKey : "softkms:path=/path/to/private.key" ,
1598
- DecrypterKeyPassword : "super-secret-password" ,
1603
+ DecrypterKeyPEM : []byte {5 , 6 , 7 , 8 },
1604
+ DecrypterKeyURI : "softkms:path=/path/to/private.key" ,
1605
+ DecrypterKeyPassword : encodedPassword .Bytes (),
1599
1606
},
1600
1607
& provisioner.JWK {
1601
1608
EncryptedKey : "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwicDJjIjoxMDAwMDAsInAycyI6IlhOdmYxQjgxSUlLMFA2NUkwcmtGTGcifQ.XaN9zcPQeWt49zchUDm34FECUTHfQTn_.tmNHPQDqR3ebsWfd.9WZr3YVdeOyJh36vvx0VlRtluhvYp4K7jJ1KGDr1qypwZ3ziBVSNbYYQ71du7fTtrnfG1wgGTVR39tWSzBU-zwQ5hdV3rpMAaEbod5zeW6SHd95H3Bvcb43YiiqJFNL5sGZzFb7FqzVmpsZ1efiv6sZaGDHtnCAL6r12UG5EZuqGfM0jGCZitUz2m9TUKXJL5DJ7MOYbFfkCEsUBPDm_TInliSVn2kMJhFa0VOe5wZk5YOuYM3lNYW64HGtbf-llN2Xk-4O9TfeSPizBx9ZqGpeu8pz13efUDT2WL9tWo6-0UE-CrG0bScm8lFTncTkHcu49_a5NaUBkYlBjEiw.thPcx3t1AUcWuEygXIY3Fg" ,
@@ -1612,9 +1619,13 @@ func TestProvisionersResponse_MarshalJSON(t *testing.T) {
1612
1619
{
1613
1620
"type" : "scep" ,
1614
1621
"name" : "scep" ,
1622
+ "forceCN" : false ,
1623
+ "includeRoot" : true ,
1624
+ "excludeIntermediate" : true ,
1615
1625
"challenge" : "*** REDACTED ***" ,
1616
1626
"decrypterCertificate" : "*** REDACTED ***" ,
1617
1627
"decrypterKey" : "*** REDACTED ***" ,
1628
+ "decrypterKeyPEM" : "*** REDACTED ***" ,
1618
1629
"decrypterKeyPassword" : "*** REDACTED ***" ,
1619
1630
"minimumPublicKeyLength" : 2048 ,
1620
1631
"encryptionAlgorithmIdentifier" : 2 ,
@@ -1652,9 +1663,12 @@ func TestProvisionersResponse_MarshalJSON(t *testing.T) {
1652
1663
ChallengePassword : "not-so-secret" ,
1653
1664
MinimumPublicKeyLength : 2048 ,
1654
1665
EncryptionAlgorithmIdentifier : 2 ,
1666
+ IncludeRoot : true ,
1667
+ ExcludeIntermediate : true ,
1655
1668
DecrypterCertificate : []byte {1 , 2 , 3 , 4 },
1656
- DecrypterKey : "softkms:path=/path/to/private.key" ,
1657
- DecrypterKeyPassword : "super-secret-password" ,
1669
+ DecrypterKeyPEM : []byte {5 , 6 , 7 , 8 },
1670
+ DecrypterKeyURI : "softkms:path=/path/to/private.key" ,
1671
+ DecrypterKeyPassword : encodedPassword .Bytes (),
1658
1672
},
1659
1673
& provisioner.JWK {
1660
1674
EncryptedKey : "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwicDJjIjoxMDAwMDAsInAycyI6IlhOdmYxQjgxSUlLMFA2NUkwcmtGTGcifQ.XaN9zcPQeWt49zchUDm34FECUTHfQTn_.tmNHPQDqR3ebsWfd.9WZr3YVdeOyJh36vvx0VlRtluhvYp4K7jJ1KGDr1qypwZ3ziBVSNbYYQ71du7fTtrnfG1wgGTVR39tWSzBU-zwQ5hdV3rpMAaEbod5zeW6SHd95H3Bvcb43YiiqJFNL5sGZzFb7FqzVmpsZ1efiv6sZaGDHtnCAL6r12UG5EZuqGfM0jGCZitUz2m9TUKXJL5DJ7MOYbFfkCEsUBPDm_TInliSVn2kMJhFa0VOe5wZk5YOuYM3lNYW64HGtbf-llN2Xk-4O9TfeSPizBx9ZqGpeu8pz13efUDT2WL9tWo6-0UE-CrG0bScm8lFTncTkHcu49_a5NaUBkYlBjEiw.thPcx3t1AUcWuEygXIY3Fg" ,
0 commit comments