Skip to content

Commit 86c9374

Browse files
UI: Remove type assignment for stringArray editTypes (#11051) (#11108) (#11133)
* remove type assignment for stringArray edit types * update integration tests * add changelog * reword changelog Co-authored-by: claire bontempo <[email protected]>
1 parent 7dc016e commit 86c9374

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

changelog/_11051.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
ui/pki: Fix handling of values that contain commas in list fields like `crl_distribution_points`.
3+
```

ui/app/models/pki/issuer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,21 @@ export default class PkiIssuerModel extends Model {
104104
})
105105
revocationSignatureAlgorithm;
106106

107-
@attr('string', {
107+
@attr({
108108
subText:
109109
'The URL values for the Issuing Certificate field; these are different URLs for the same resource.',
110110
editType: 'stringArray',
111111
})
112112
issuingCertificates;
113113

114-
@attr('string', {
114+
@attr({
115115
label: 'CRL distribution points',
116116
subText: 'Specifies the URL values for the CRL Distribution Points field.',
117117
editType: 'stringArray',
118118
})
119119
crlDistributionPoints;
120120

121-
@attr('string', {
121+
@attr({
122122
label: 'OCSP servers',
123123
subText: 'Specifies the URL values for the OCSP Servers field.',
124124
editType: 'stringArray',

ui/tests/integration/components/pki/page/pki-issuer-edit-test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
5454
usage: 'read-only,issuing-certificates,ocsp-signing',
5555
manual_chain: 'issuer_ref',
5656
issuing_certificates: ['http://localhost', 'http://localhost:8200'],
57-
crl_distribution_points: 'http://localhost',
57+
crl_distribution_points: [
58+
'ldap://MYSERVER1/CN=Office,OU=Sales,OU=Fabrikam,O=Contoso Sales,C=US?certificateRevocationList',
59+
],
5860
ocsp_servers: 'http://localhost',
5961
},
6062
});
@@ -86,11 +88,11 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
8688
assert.dom(selectors.usageCrl).isNotChecked('Usage signing crls is not checked');
8789
assert.dom(selectors.usageOcsp).isChecked('Usage signing ocsps is checked');
8890
assert.dom(selectors.manualChain).hasValue(this.model.manualChain, 'Manual chain field populates');
89-
const certUrls = this.model.issuingCertificates.split(',');
91+
const certUrls = this.model.issuingCertificates;
9092
assert.dom(selectors.certUrl1).hasValue(certUrls[0], 'Issuing certificate populates');
9193
assert.dom(selectors.certUrl2).hasValue(certUrls[1], 'Issuing certificate populates');
92-
const crlDistributionPoints = this.model.crlDistributionPoints.split(',');
93-
assert.dom(selectors.crlDist).hasValue(crlDistributionPoints[0], 'Crl distribution points populate');
94+
const [crlDistributionPoints] = this.model.crlDistributionPoints;
95+
assert.dom(selectors.crlDist).hasValue(crlDistributionPoints, 'Crl distribution points populate');
9496
const ocspServers = this.model.ocspServers.split(',');
9597
assert.dom(selectors.ocspServers).hasValue(ocspServers[0], 'Ocsp servers populate');
9698
});
@@ -104,9 +106,9 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
104106
assert.ok(this.transitionCalled(), 'Transitions to details route on cancel');
105107
assert.strictEqual(this.model.issuerName, 'foo-bar', 'Issuer name rolled back');
106108
assert.strictEqual(this.model.usage, 'read-only,issuing-certificates,ocsp-signing', 'Usage rolled back');
107-
assert.strictEqual(
109+
assert.propEqual(
108110
this.model.issuingCertificates,
109-
'http://localhost,http://localhost:8200',
111+
['http://localhost', 'http://localhost:8200'],
110112
'Issuing certificates rolled back'
111113
);
112114
});
@@ -122,9 +124,9 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
122124
'read-only,issuing-certificates,ocsp-signing,crl-signing',
123125
'Updated usage sent in POST request'
124126
);
125-
assert.strictEqual(
127+
assert.propEqual(
126128
data.issuing_certificates,
127-
'http://localhost:8200',
129+
['http://localhost:8200'],
128130
'Updated issuing certificates sent in POST request'
129131
);
130132
return { issuer_id: 'test', data };

0 commit comments

Comments
 (0)