Skip to content

Commit 55d82e1

Browse files
fix(CertificateAuthority): add missing 'caref' field #873
This commit fixes an issue where the object relation system expected a 'caref' value to determine which CAs would impacted by deletions. However, since this model did not have this field it was simply ignored and considered all CAs as impacted by deletions.
1 parent 6487fba commit 55d82e1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/CertificateAuthority.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace RESTAPI\Models;
55
use RESTAPI\Core\Model;
66
use RESTAPI\Fields\Base64Field;
77
use RESTAPI\Fields\BooleanField;
8+
use RESTAPI\Fields\ForeignModelField;
89
use RESTAPI\Fields\IntegerField;
910
use RESTAPI\Fields\StringField;
1011
use RESTAPI\Fields\UIDField;
@@ -20,6 +21,7 @@ use RESTAPI\Validators\X509Validator;
2021
class CertificateAuthority extends Model {
2122
public StringField $descr;
2223
public UIDField $refid;
24+
public ForeignModelField $caref;
2325
public BooleanField $trust;
2426
public BooleanField $randomserial;
2527
public IntegerField $serial;
@@ -42,6 +44,13 @@ class CertificateAuthority extends Model {
4244
help_text: 'The unique ID assigned to this certificate authority for internal system use. This value is ' .
4345
'generated by this system and cannot be changed.',
4446
);
47+
$this->caref = new ForeignModelField(
48+
model_name: 'CertificateAuthority',
49+
model_field: 'refid',
50+
allow_null: true,
51+
read_only: true,
52+
help_text: 'The reference ID of the assigned root certificate authority.',
53+
);
4554
$this->trust = new BooleanField(
4655
default: false,
4756
indicates_true: 'enabled',

0 commit comments

Comments
 (0)