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

API docs: document the token disclosure reporting integration #17217

Closed
woodruffw opened this issue Dec 4, 2024 · 5 comments · Fixed by #17236
Closed

API docs: document the token disclosure reporting integration #17217

woodruffw opened this issue Dec 4, 2024 · 5 comments · Fixed by #17236
Assignees

Comments

@woodruffw
Copy link
Member

woodruffw commented Dec 4, 2024

Filing this as a tracking issue: the current token disclosure integration (which GitHub uses to report compromised PyPI API tokens back to PyPI for revocation) is generic and could be used by additional secret-reporting services.

However, that integration interface isn't documented, meaning that other potential integrators don't know where to start. The API docs could include docs on it!

CC @di

@woodruffw woodruffw self-assigned this Dec 4, 2024
@di
Copy link
Member

di commented Dec 4, 2024

It's not quite generic, it's pretty GitHub-specific as it relies on GitHub-specific headers and has GitHub's key URL baked in: https://github.com/pypi/warehouse/blob/c9231a69413f218adcc8c2236b78059f524eadb6/warehouse/integrations/github/views.py

We should decide if we should offer a generic API in this style, and have GitHub be an outlier, or whether we want to have a different endpoint per integrator.

@woodruffw
Copy link
Member Author

Gotcha, I didn't realize it was GitHub specific! I can document it as-is as a starting point, to inform a decision about whether each integrator should have its own endpoint or not.

@di
Copy link
Member

di commented Dec 4, 2024

I think we can make this a generic-ish endpoint w/ a select list of integrators (some mapping from valid integrator headers to key verification URL) and ask any future potential integrators to align w/ GitHub's pattern here. That would mean adding a new integrator would only be a few line change, not an entirely new view/endpoint.

@di
Copy link
Member

di commented Dec 4, 2024

Updates to make the API generic are in #17218.

I think we can include this at https://docs.pypi.org/api/ with the caveat that it's only available to integrators on a case-by-case basis.

@woodruffw woodruffw changed the title Dev docs: document the token disclosure reporting integration API docs: document the token disclosure reporting integration Dec 5, 2024
@di
Copy link
Member

di commented Dec 5, 2024

PR with docs is here: #17236

@di di closed this as completed in #17236 Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants