Skip to content

Commit 7368c00

Browse files
Do not expose internal IDs in public API
Part of #3024
1 parent 2a97bfd commit 7368c00

File tree

8 files changed

+7
-18
lines changed

8 files changed

+7
-18
lines changed

webapp/src/Entity/Clarification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class Clarification extends BaseApiEntity implements
4040
#[ORM\Id]
4141
#[ORM\GeneratedValue]
4242
#[ORM\Column(options: ['comment' => 'Clarification ID', 'unsigned' => true])]
43-
#[Serializer\SerializedName('clarid')]
44-
#[Serializer\Groups([ARC::GROUP_RESTRICTED_NONSTRICT])]
43+
#[Serializer\Exclude]
4544
protected int $clarid;
4645

4746
#[ORM\Column(

webapp/src/Entity/Contest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Contest extends BaseApiEntity implements
5757
#[ORM\Id]
5858
#[ORM\GeneratedValue]
5959
#[ORM\Column(options: ['comment' => 'Contest ID', 'unsigned' => true])]
60-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
60+
#[Serializer\Exclude]
6161
protected ?int $cid = null;
6262

6363
#[ORM\Column(

webapp/src/Entity/ContestProblem.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
#[ORM\Index(columns: ['cid'], name: 'cid')]
2828
#[ORM\Index(columns: ['probid'], name: 'probid')]
2929
#[ORM\UniqueConstraint(name: 'shortname', columns: ['cid', 'shortname'], options: ['lengths' => [null, 190]])]
30-
#[Serializer\VirtualProperty(
31-
name: 'probid',
32-
exp: 'object.getProblem().getProbid()',
33-
options: [new Serializer\Groups([ARC::GROUP_NONSTRICT])]
34-
)]
3530

3631
#[Serializer\VirtualProperty(
3732
name: 'short_name',

webapp/src/Entity/Submission.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class Submission extends BaseApiEntity implements
4545
#[ORM\Id]
4646
#[ORM\GeneratedValue]
4747
#[ORM\Column(options: ['comment' => 'Submission ID', 'unsigned' => true])]
48-
#[Serializer\SerializedName('submitid')]
49-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
48+
#[Serializer\Exclude]
5049
protected int $submitid;
5150

5251
#[ORM\Column(

webapp/src/Entity/Team.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class Team extends BaseApiEntity implements
3939
#[ORM\Id]
4040
#[ORM\GeneratedValue]
4141
#[ORM\Column(options: ['comment' => 'Team ID', 'unsigned' => true])]
42-
#[Serializer\SerializedName('teamid')]
43-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
42+
#[Serializer\Exclude]
4443
protected ?int $teamid = null;
4544

4645
#[ORM\Column(

webapp/src/Entity/TeamAffiliation.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class TeamAffiliation extends BaseApiEntity implements
4343
#[ORM\Id]
4444
#[ORM\GeneratedValue]
4545
#[ORM\Column(options: ['comment' => 'Team affiliation ID', 'unsigned' => true])]
46-
#[Serializer\SerializedName('affilid')]
47-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
46+
#[Serializer\Exclude]
4847
protected ?int $affilid = null;
4948

5049
#[ORM\Column(

webapp/src/Entity/TeamCategory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class TeamCategory extends BaseApiEntity implements
3838
#[ORM\Id]
3939
#[ORM\GeneratedValue]
4040
#[ORM\Column(options: ['comment' => 'Team category ID', 'unsigned' => true])]
41-
#[Serializer\SerializedName('categoryid')]
42-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
41+
#[Serializer\Exclude]
4342
protected ?int $categoryid = null;
4443

4544
#[ORM\Column(

webapp/src/Entity/User.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class User extends BaseApiEntity implements
3939
#[ORM\Id]
4040
#[ORM\GeneratedValue]
4141
#[ORM\Column(options: ['comment' => 'User ID', 'unsigned' => true])]
42-
#[Serializer\SerializedName('userid')]
43-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
42+
#[Serializer\Exclude]
4443
private ?int $userid = null;
4544

4645
#[ORM\Column(

0 commit comments

Comments
 (0)