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

Plugin for PyPI api tokens #819

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

Chandra158
Copy link
Contributor

@Chandra158 Chandra158 commented May 1, 2024

Please check if the PR fulfills these requirements

  • Tests for the changes have been added
  • Docs have been added / updated
  • All CI checks are green

What kind of change does this PR introduce?

PyPI token is bound to start with:
pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{70,}
A token can be arbitrary long because we may add arbitrary many caveats.

Tests

  • New test added for plugin

Copy link
Member

@lorenzodb1 lorenzodb1 left a comment

Choose a reason for hiding this comment

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

Two questions:

  1. does the TestPypi token have the same format?
  2. is there a way to check the validity of the token?

@Chandra158
Copy link
Contributor Author

  1. does the TestPypi token have the same format?

TestPypi has different format: pypi-AgENdGVzdC5weXBpLm9yZw[A-Za-z0-9-_]{70,}

  1. is there a way to check the validity of the token?

This is not supported yet. (refs)
There're some hacky way to do it but it'd also require other details like username in addition to the token.

@lorenzodb1
Copy link
Member

Could you add checks for Test Pypi too?

There're some hacky way to do it but it'd also require other details like username in addition to the token.

Do you think is something we could add as optional? Maybe you could add it as a configurable option for the user in the baseline file.

@Chandra158
Copy link
Contributor Author

Chandra158 commented May 2, 2024

Added a new commit for the test.pypi tokens.

Do you think is something we could add as optional?
There're some hacky way t

I misunderstood pypitoken apis; this is only possible if the token is created by us. Not suitable for detect-secrets.
IMO, there's no way to validate yet.

@lorenzodb1 lorenzodb1 merged commit e482e64 into Yelp:master May 2, 2024
12 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.

None yet

2 participants