Skip to content
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

Fix newlines #132

Merged
merged 4 commits into from
Feb 11, 2025
Merged

Fix newlines #132

merged 4 commits into from
Feb 11, 2025

Conversation

mcg1969
Copy link
Collaborator

@mcg1969 mcg1969 commented Feb 9, 2025

I discovered that newlines were sometimes making it into the user agent string—specifically if external utilities were creating the organization and machine tokens. This hardens the token reading code against this

@@ -167,4 +167,4 @@ jobs:
source $CONDA/bin/activate
conda install anaconda-client
[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || export LABEL="--label dev"
anaconda --verbose --token $ANACONDA_TOKEN upload --user ctools $LABEL conda-bld/*/*.tar.bz2 --force
anaconda --verbose --token $ANACONDA_TOKEN upload --user ctools $LABEL conda-bld/*/*.{conda,tar.bz2} --force
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also noticed that uploads were broken

@@ -43,9 +43,9 @@ def system_tokens():
otoken = utils._random_token()
mtoken = utils._random_token()
with open(dirname(tpaths[1]) + "/org_token", "w") as fp:
fp.write(otoken)
fp.write(otoken + "\n# Anaconda organization token\n")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Force some extra lines in the test tokens

@jezdez jezdez merged commit 55637a9 into main Feb 11, 2025
48 checks passed
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.

2 participants