Skip to content

i_1061 Prompt for credentials for pc2submit if none found #1064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

johnbrvc
Copy link
Collaborator

Description of what the PR does

Add optional code (controlled by environment variable SUBMITCREDENTIALS == 'yes') to prompt the user for their contest credentials and add them to their ~/.netrc file. Added appropriate code ask for and confirm the user's credentials.
CI: Code cleanup - create constants for environment variables (there were already several environment variables hard-coded).
CI: Add -t # (--team_id #) to allow specification of the team_id to submit on behalf of
CI: Add environment variable SUBMITOMITEXTRAHELP=='yes' to not include help for the -c, -a, -u and -t options as these are typically not used by most users.

Issue which the PR addresses

Fixes #1061

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

Windows 11
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)

  1. Remove any "localhost" entry in ~/.netrc
  2. Start a contest (like sumithello)
  3. Start a feeder and start it feeding 2023-06 API
  4. Set/Unset the SUBMITCREDENTIALS environment to yes or no (to test various combinations)
  5. Make a submission using pc2submit, eg. pc2submit -p a -y --team_id 1 samps/src/hello.cpp
  6. You should be prompted to enter credentials if SUBMITCREDENTIALS was set to 'yes', otherwise it should just fail with a network exception of some sort.
  7. You can repeat the test using different values of SUBMITCREDENTIALS, user and password, eg. team1/team1, administrator1/administrator1, or wrong credentials. Be sure to remove the entry for localhost from the ~/.netrc if you want to clear out the credentials for a new test.

Add optional code (controlled by environment variable SUBMITCREDENTIALS == 'yes') to prompt the user for their contest credentials and add them to their ~/.netrc file.  Added appropriate code ask for and confirm the user's credentials.
CI: Code cleanup - create constants for environment variables (there were already several environment variables hard-coded).
CI: Add -t # (--team_id #) to allow specification of the team_id to submit on behalf of
CI: Add environment variable SUBMITOMITEXTRAHELP=='yes' to not include help for the -c, -a, -u and -t options as these are typically not used by most users.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Apr 11, 2025
@johnbrvc johnbrvc self-assigned this Apr 11, 2025
Copy link
Collaborator

@SamanwaySadhu SamanwaySadhu left a comment

Choose a reason for hiding this comment

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

#1063 also mentions that it fixes #1061. Maybe one of the two should mention Partial fix. Other than that it looks good.

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 API Submission by admin for team uses wrong client id
2 participants