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

Add metric to monitor JFrog Access Federation validation endpoint #154

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

MMichel
Copy link
Contributor

@MMichel MMichel commented Jan 14, 2025

JFrog Access Federation can be setup for Artifactory to synchronize security related entities - such as users, roles, permissions, or tokens - between connected instances.

In this case establishing a circle of trust between these connected instances is required.

In order to monitor a valid Access Federation the /access/api/v1/system/federation/validate_server endpoint can be used. Calling this endpoint also requires providing a target server URL in the HTTP POST body.

This pull request adds the functionality to monitor the above Access Federation circle of trust validation endpoint.

The new metric access_federation_valid is added to the optional metrics category, since the endpoint requires a few seconds to respond with the validation result. It requires a POST method, which has been added to utils.

@MMichel MMichel requested a review from peimanja as a code owner January 14, 2025 14:34
MMichel and others added 2 commits January 15, 2025 09:11
* Refactor utils to clean up request and error handling

* Readd warning for not found, move unmarshalling to after http error handling

* Only handle unmarshalling error if HTTP status not successful
Copy link

@MMichel
Copy link
Contributor Author

MMichel commented Jan 15, 2025

Refactored response and error handling in artifactory/utils.go to reduce code duplication and improve readability

Copy link
Owner

@peimanja peimanja left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for the contribution

@peimanja peimanja merged commit 4da8d22 into peimanja:master Jan 21, 2025
2 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