Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Add exact match to SSH key name validation regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Nov 9, 2020
1 parent 8cc01f3 commit 7031355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/ssh-plugin/src/ssh-plugin-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export async function start(): Promise<void> {
const RESTART_WARNING_MESSAGE = 'Che Git plugin can leverage the generated keys now. To make them available in all workspace containers please restart your workspace.';
const ENTER_KEY_NAME_OR_LEAVE_EMPTY_MESSAGE = 'Please provide a hostname (e.g. github.com) or leave empty to setup default name';

const hostNamePattern = new RegExp('[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*');
const hostNamePattern = new RegExp('^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$');

const getHostName = async (message?: string) => await theia.window.showInputBox({
placeHolder: message ? message : 'Please provide a hostname e.g. github.com',
Expand Down

0 comments on commit 7031355

Please sign in to comment.