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 frontend http client #7000

Merged

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Sep 19, 2024

Description

This pull request adds a http client to the wazuh-core plugin and expose it to manage the API requests that is a composition of old services:

  • WzRequest
  • GenericRequest
  • ApiCheck
  • WzAuthentication

Moreover,

  • Components
    • TableData (generic table component based on a implementation of wazuh plugin)
    • ServerTable (based on TableWzAPI of wazuh plugin)
  • Hooks
    • useStateStorage: uses the localStorage and sessionStorage to persist the runtime data

Issues Resolved

#6959

Evidence

Test

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

- Create HTTP client based on old services
- Create HTTP client request interceptor: request
- Create HTTP client generic: GenericRequest
- Create HTTP client server: WzRequest, ApiCheck and WzAuthentication
- Enhance server API backend client
  See #6995
- Rename ILogger type to Logger
@Desvelao Desvelao self-assigned this Sep 19, 2024
@Desvelao Desvelao changed the title Added frontend http client Add frontend http client Sep 27, 2024
@Desvelao Desvelao linked an issue Nov 27, 2024 that may be closed by this pull request
6 tasks
@Desvelao Desvelao marked this pull request as ready for review November 27, 2024 16:42
…to enhancement/6959-extract-common-services-frontend-http
…able comments and improving parameter naming for clarity
…on-store for enhanced code clarity and standards compliance
@guidomodarelli guidomodarelli force-pushed the enhancement/6959-extract-common-services-frontend-http branch from ff87410 to cd48318 Compare December 6, 2024 18:50
…ion and search-bar components for improved code clarity and standards compliance
…nent to enhance code clarity and maintain coding standards
…improve code clarity and maintain coding standards
…er consistency and clarity in code structure
… to enhance code clarity and maintain coding standards
…ance code readability and maintain coding standards
…prove code readability and maintain standards
…erface for improved type safety and consistency
…ity and maintain consistent formatting standards
…ing consistency in WazuhApiCtrl error handling
… consistent argument handling and improve readability
…PascalCase for global variables in naming conventions
…ts for improved readability and consistency with naming conventions
…T_READY for improved clarity and error handling consistency
…M_REQUEST_HEADERS for improved consistency in naming conventions
…nsistency by utilizing centralized definitions and types
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Wazuh Fleet plugin code coverage (Jest) test % values
Statements 4.68% ( 9 / 192 )
Branches 16.66% ( 7 / 42 )
Functions 1.11% ( 1 / 90 )
Lines 4.76% ( 9 / 189 )

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Wazuh Core plugin code coverage (Jest) test % values
Statements 38.24% ( 784 / 2050 )
Branches 40.35% ( 437 / 1083 )
Functions 40.92% ( 248 / 606 )
Lines 38.51% ( 780 / 2025 )

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Wazuh Engine plugin code coverage (Jest) test % values
Statements 8.63% ( 64 / 741 )
Branches 7.94% ( 22 / 277 )
Functions 1.87% ( 7 / 373 )
Lines 9.1% ( 64 / 703 )

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Main plugin code coverage (Jest) test % values
Statements 13.43% ( 4028 / 29984 )
Branches 8.98% ( 1749 / 19460 )
Functions 12.97% ( 943 / 7266 )
Lines 13.6% ( 3926 / 28865 )

@Desvelao Desvelao merged commit bf0537c into master Dec 10, 2024
8 checks passed
@Desvelao Desvelao deleted the enhancement/6959-extract-common-services-frontend-http branch December 10, 2024 08:35
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.

Extract common services from main plugin
3 participants