Skip to content

Conversation

@SolarFactories
Copy link

Overview

Add missing RUD methods for API Key CRUD.

Detailed

Adds methods to:

  • DeleteAPIKey - To delete an API key from a Team.
  • UpdateAPIKeyComment - To set or update the comment associated with an API Key.
  • GetAPIKeys - To retrieve the API Keys for a Team, since the TeamService.Get endpoint does not include them in the API response.

Adds tests to:

  • GenerateAPIKey with TestGenerateAPIKey.
  • DeleteAPIKey with TestDeleteAPIKey.
  • UpdateAPIKeyComment with TestUpdateAPIKeyComment.

Other:

  • Adds remaining fields within APIKey struct, for the subset of occassions when they are returned.
  • Add case within withBody to allow for using a text/plain Content-Type as required by UpdateAPIKeyComment.

…d tests for GenerateAPIKey, DeleteAPIKey, UpdateAPIKeyComment. Added handling of text/plain body when making an API request.

Signed-off-by: SolarFactories <[email protected]>
@nscuro nscuro added the enhancement New feature or request label Dec 4, 2024
Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

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

Thanks!

@nscuro nscuro merged commit b56de7d into DependencyTrack:main Dec 4, 2024
4 checks passed
@SolarFactories SolarFactories deleted the api-keys-crud branch January 24, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants