Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Please avoid adding duplicate information across this changelog and JIRA/doc inp
- Added AllowPrivilegeEscalation as a new policy criteria.
- ROX-10038: Removed limit of 10 inclusions and 10 exclusions from policy form
- ROX-10090: Made the username and password optional on the Artifactory integration form
- ROX-10217: Remove format validation from the URL field of the generic webhook integration form

## [69.1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ describe('Notifiers Test', () => {
cy.get(selectors.buttons.save).should('be.disabled');

// Step 2, check fields for invalid formats, or conditional validation
getInputByLabel('Endpoint').type('example').blur();
getHelperElementByLabel('Endpoint').contains('Endpoint must be a valid URL');
getInputByLabel('Endpoint').type('example.com:3000/hooks/123').blur();

getInputByLabel('Username').type('neo').blur();
getInputByLabel('Password').type(' ').blur();
Expand All @@ -200,7 +199,7 @@ describe('Notifiers Test', () => {

// Step 3, check valid from and save
getInputByLabel('Integration name').clear().type(integrationName);
getInputByLabel('Endpoint').clear().type('example.com:3000/hooks/123');
getInputByLabel('Endpoint').clear().type('service-name');
getInputByLabel('CA certificate (optional)').type(sampleCert, { delay: 1 });
getInputByLabel('Skip TLS verification').click();
getInputByLabel('Enable audit logging').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,11 @@ export type GenericWebhookIntegrationFormValues = {
updatePassword: boolean;
};

const validEndpointRegex =
/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/;

export const validationSchema = yup.object().shape({
notifier: yup.object().shape({
name: yup.string().trim().required('Name is required'),
generic: yup.object().shape({
endpoint: yup
.string()
.trim()
.required('Endpoint is required')
.matches(validEndpointRegex, 'Endpoint must be a valid URL'),
endpoint: yup.string().trim().required('Endpoint is required'),
skipTlsVerify: yup.bool(),
auditLoggingEnabled: yup.bool(),
username: yup
Expand Down