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

Fix deploy new agent filters #6327

Merged
merged 5 commits into from
Jan 16, 2024
Merged

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Jan 16, 2024

Description

This PR aims to fix an error on which the Deploy New Agent section did not allow to specify a hostname as server address

Issues Resolved

#6311

Evidence

image

Test

  • Deploy a new environment
  • Navigate to Endpoints Summary/Deploy new agent
  • Verify that it allows all the possible options for Server Address, and shows errors on any non valid address.

The allowed options are:

  • Hostname from 1 to 63 alphanumeric characters
  • Domains up to 255 characters (up to 63 per label)
  • IPv4
  • Uncompressed IPv6

Note: A non valid IPv4 (i.e. 280.240.1.300) should be considered valid, as it matches the rules to be a domain (alphanumeric labels with 1-63 characters)

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

@Tostti Tostti requested a review from a team as a code owner January 16, 2024 15:36
@Tostti Tostti self-assigned this Jan 16, 2024
@jbiset jbiset self-requested a review January 16, 2024 16:00
jbiset
jbiset previously approved these changes Jan 16, 2024
Copy link
Member

@jbiset jbiset left a comment

Choose a reason for hiding this comment

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

CR: 🟢

Test 🟢

The following examples were tested:

1- Test 1

  • Description: Valid hostname
  • Value: myserver123
  • Passed test: 🟢

2- Test 2

  • Description: Hostname with special characters (not allowed)
  • Value: server@home
  • Passed test: 🟢

3- Test 3

  • Description: Hostname with length less than limit
  • Value: thisisaverylonghostnamethatismorethan63characterslong
  • Passed test: 🟢

4- Test 4

  • Description: Hostname with length greater than limit
  • Value: asdfasdfaasdfasdfasdfasdfasdfdsadfdsadfdsadfdsadfdsssdddaaasss
  • Passed test: 🟢

5- Test 5

  • Description: Valid domain
  • Value: example.com
  • Passed test: 🟢

6- Test 6

  • Description: Domain with subdomains
  • Value: subdomain1.subdomain2.example.com
  • Passed test: 🟢

7- Test 7

  • Description: Valid IPv4
  • Value: 192.168.1.1
  • Passed test: 🟢

8- Test 8

  • Description: IPv4 with octet greater than limit
  • Value: 256.168.1.1
  • Passed test: 🟢 (A label can contain only numbers)

9- Test 9

  • Description: Valid IPv6
  • Value: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
  • Passed test: 🟢

10- Test 10

  • Description: Unexpanded Uncompressed IPv6
  • Value: 2001:db8:85a3:0:0:8a2e:370:7334
  • Passed test: 🟢

11- Test 11

  • Description: Expanded Uncompressed IPv6
  • Value: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
  • Passed test: 🟢

asteriscos
asteriscos previously approved these changes Jan 16, 2024
Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

Peek.2024-01-16.19-50.mp4

@Tostti Tostti dismissed stale reviews from asteriscos and jbiset via 0e4db20 January 16, 2024 18:56
asteriscos
asteriscos previously approved these changes Jan 16, 2024
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 21.42% ( 186 / 868 )
Branches 17.99% ( 79 / 439 )
Functions 14.22% ( 36 / 253 )
Lines 21.65% ( 183 / 845 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.68% ( 171 / 223 )
Branches 57.57% ( 57 / 99 )
Functions 61.7% ( 29 / 47 )
Lines 76.68% ( 171 / 223 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.2% ( 4202 / 34417 )
Branches 8.26% ( 1911 / 23121 )
Functions 11.71% ( 958 / 8176 )
Lines 12.38% ( 4087 / 33008 )

@asteriscos asteriscos merged commit 26a06fa into 4.8.0 Jan 16, 2024
4 checks passed
@asteriscos asteriscos deleted the 6311-fix-filters-deploy-new-agent branch January 16, 2024 19: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
3 participants