File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -632,6 +632,37 @@ module.exports = {
632
632
return getAllObjects ( 'nginx/certificates' , expand , query ) ;
633
633
} ,
634
634
635
+ /**
636
+ * Retrieve all certificates which have a type suitable for use as
637
+ * server certificates. This filters by provider for returned rows.
638
+ *
639
+ * @param {Array } [expand]
640
+ * @param {String } [query]
641
+ * @returns {Promise }
642
+ */
643
+ getAllServerCertificates : function ( expand , query ) {
644
+ return getAllObjects ( 'nginx/certificates' , expand , query )
645
+ . then ( rows => {
646
+ return rows . filter ( row => row . provider !== 'clientca' ) ;
647
+ } )
648
+ } ,
649
+
650
+ /**
651
+ * Retrieve all certificates which have a type suitable for use as
652
+ * client authentication certificates. This filters by provider for
653
+ * returned rows.
654
+ *
655
+ * @param {Array } [expand]
656
+ * @param {String } [query]
657
+ * @returns {Promise }
658
+ */
659
+ getAllClientCertificates : function ( expand , query ) {
660
+ return getAllObjects ( 'nginx/certificates' , expand , query )
661
+ . then ( rows => {
662
+ return rows . filter ( row => row . provider === 'clientca' ) ;
663
+ } )
664
+ } ,
665
+
635
666
/**
636
667
* @param {Object } data
637
668
*/
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ module.exports = Mn.View.extend({
263
263
}
264
264
} ,
265
265
load : function ( query , callback ) {
266
- App . Api . Nginx . Certificates . getAll ( )
266
+ App . Api . Nginx . Certificates . getAllServerCertificates ( )
267
267
. then ( rows => {
268
268
callback ( rows ) ;
269
269
} )
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ module.exports = Mn.View.extend({
331
331
}
332
332
} ,
333
333
load : function ( query , callback ) {
334
- App . Api . Nginx . Certificates . getAll ( )
334
+ App . Api . Nginx . Certificates . getAllServerCertificates ( )
335
335
. then ( rows => {
336
336
callback ( rows ) ;
337
337
} )
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ module.exports = Mn.View.extend({
265
265
}
266
266
} ,
267
267
load : function ( query , callback ) {
268
- App . Api . Nginx . Certificates . getAll ( )
268
+ App . Api . Nginx . Certificates . getAllServerCertificates ( )
269
269
. then ( rows => {
270
270
callback ( rows ) ;
271
271
} )
You can’t perform that action at this time.
0 commit comments