Skip to content

Conversation

@javuto
Copy link
Collaborator

@javuto javuto commented Mar 25, 2025

Complete the refactor in osctrl-api to utilize the flags from the new config pkg. It follows up the work in #622 #625 and #627

@javuto javuto added refactor Refactorization of code osctrl-api osctrl-api related changes labels Mar 25, 2025
@javuto javuto requested a review from Copilot March 25, 2025 09:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the osctrl-api service to utilize the new flags from the config package, ensuring consistency with recent configuration updates.

  • Introduces a new function (InitAPIFlags) to initialize API-specific flags.
  • Updates API configuration types in handlers, auth, and settings to use the unified JSONConfigurationService type.
  • Adjusts settings loading to match the new configuration structure.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/config/flags.go Added InitAPIFlags to assemble the API service flags from various flag categories.
cmd/api/handlers/handlers.go Changed the ApiConfig field to use JSONConfigurationService instead of JSONConfigurationAPI.
cmd/api/auth.go Modified handlerAuthCheck to accept auth and jwtSecret parameters and updated token check.
pkg/settings/settings.go Updated SetAPIJSON to work with JSONConfigurationService instead of JSONConfigurationAPI.
pkg/config/types.go Removed the obsolete JSONConfigurationAPI type.
cmd/api/settings.go Adjusted loadingSettings to pass the new configuration type to settings.

@javuto javuto merged commit abc2fbf into main Mar 25, 2025
53 checks passed
@javuto javuto deleted the api-flags-pkg branch March 25, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

osctrl-api osctrl-api related changes refactor Refactorization of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants