mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-06-20 08:43:44 +00:00
Update balena ssh command to support local devices and multicontainer
Change-type: major Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
committed by
Paulo Castro
parent
8f8d6b5f08
commit
64c2f00d2a
@ -22,6 +22,7 @@ const IP_REGEX = new RegExp(
|
||||
/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,
|
||||
);
|
||||
const DOTLOCAL_REGEX = new RegExp(/^([a-zA-Z0-9-]+\.)+local$/);
|
||||
const UUID_REGEX = new RegExp(/^[0-9a-f]+$/);
|
||||
|
||||
export function validateEmail(input: string) {
|
||||
if (!validEmail(input)) {
|
||||
@ -54,3 +55,21 @@ export function validateIPAddress(input: string): boolean {
|
||||
export function validateDotLocalUrl(input: string): boolean {
|
||||
return DOTLOCAL_REGEX.test(input);
|
||||
}
|
||||
|
||||
export function validateLongUuid(input: string): boolean {
|
||||
if (input.length !== 32 && input.length !== 64) {
|
||||
return false;
|
||||
}
|
||||
return UUID_REGEX.test(input);
|
||||
}
|
||||
|
||||
export function validateShortUuid(input: string): boolean {
|
||||
if (input.length !== 7) {
|
||||
return false;
|
||||
}
|
||||
return UUID_REGEX.test(input);
|
||||
}
|
||||
|
||||
export function validateUuid(input: string): boolean {
|
||||
return validateLongUuid(input) || validateShortUuid(input);
|
||||
}
|
||||
|
Reference in New Issue
Block a user