Skip to content

i_1269 fix scoreboard endpoint to comply with the intent of the Information Access Policy#1270

Open
johnbrvc wants to merge 1 commit into
pc2ccs:developfrom
johnbrvc:i1269_scoreboard_ep_iap
Open

i_1269 fix scoreboard endpoint to comply with the intent of the Information Access Policy#1270
johnbrvc wants to merge 1 commit into
pc2ccs:developfrom
johnbrvc:i1269_scoreboard_ep_iap

Conversation

@johnbrvc
Copy link
Copy Markdown
Collaborator

Description of what the PR does

Create a new chained constructor that accepts an additional boolean argument which indicates if the freeze should be obeyed when generating the scoreboard for the endpoint. The original constructor chains to the new one and supplies false. The original constructor is now only used when generating reports and results files, so we always want unfrozen scoreboards for that.
Update the ScoreboardService to pass a boolean indicating if a frozen scoreboard is desired (basically, if the role of the requestor is not administrator and not judge).

Issue which the PR addresses

Fixes #1269

Environment in which the PR was developed (OS,IDE, Java version, etc.)

java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

These steps are more or less lifted from the issue:

  1. Load an existing contest that has not been unfrozen such as wf46prefinalize.zip. This zip will extract to the wf46prefinalize folder so you'll have to copy the profiles and profiles.properties into your pc2v9 folder.
    After loading the contest, close the server and reopen it. This has to be done because there were some runs in a funny state that had to be cleaned up with the first load. There's bug in PC2 where, when this happens, the Runs table does not get populated. Reloading fixes that issue.
  2. Start an event feeder (feeder1) and press the Start button to start the feed.
  3. Edit team46001's account (ADA University) and add the "View Event Feeds" permission.
  4. Change the password for team46001 to be team as well (this will make it easier later to test).
  5. Be sure to press Update to save the changes you made to the team.
  6. Start a pc2board client up, and wait for it to be ready.
  7. Navigate to the public_html folder produced by the pc2board.
  8. Open the "index.html" file and notice the top teams. This is a frozen scoreboard. Massachusetts Institute of Technology (team 46054) is in first place and National Research University Higher School of Economics (team 46061) is in second place.
Image
  1. Navigate to the html folder produced by the pc2board.
  2. Open the "index.html" file that's there and notice the top teams. This is an unfrozen scoreboard (final results). Peking University (team 46069) is in first place and Massachusetts Institution of Technology (team 46054) is in second place.
Image
  1. From a web browser, enter: https://team46001:team@localhost:50443/contests/Default--7404674021536391858/scoreboard
  2. Check out the first place team "rank 1" is MIT (46054) and the second place team is National Research University Higher School of Economics (team 46061) (eg it matches the frozen results above from step 8). This is the frozen scoreboard since a team made the request.
image
  1. From a web browser, enter: https://admin:admin@localhost:50443/contests/Default--7404674021536391858/scoreboard
  2. Check out the first place team "rank 1" is team 46069 (Peking University) and "rank 2" is MIT (46054). This is the unfrozen (final) scoreboard and is correct since the role of the requesting account is admin.
image

Create a new chained constructor that accepts an additional boolean argument which indicates of the freeze should be obeyed when generating the scoreboard for the endpoint.
The original constructor chains to the new one and supplies false.  The original constructor is now only  used when generating reports and results files, so we always want unfrozen scoreboards for that.
Update the ScoreboardService to pass a boolean indicating if a frozen scoreboard is desired (basically, if the role of the requestor is not administrator and not judge).
@johnbrvc johnbrvc added this to the 9.11.0 milestone Apr 29, 2026
@johnbrvc johnbrvc self-assigned this Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@kkarakas kkarakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only looked at the code, should work LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLICS 2023-06 scoreboard endpoint does not obey Information Access Policy

2 participants