1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Add send to cli (#253)

* Upgrade commander to 7.0.0

* Add url to Api call

This is needed to allow access to sends that are available from a
different Bitwarden server than configured for the CLI

* Allow upload of send files from CLI

* Allow send search by accessId

* Utils methods used in Send CLI implementation

* Revert adding string type to encrypted file data

* linter fixes

* Add Buffer to ArrayBuffer used in CLI send implementation
This commit is contained in:
Matt Gibson
2021-01-29 15:08:52 -06:00
committed by GitHub
parent 06239aea2d
commit 09c444ddd4
11 changed files with 424 additions and 191 deletions

View File

@@ -273,6 +273,14 @@ export class Utils {
return str == null || typeof str !== 'string' || str.trim() === '';
}
static nameOf<T>(name: string & keyof T) {
return name;
}
static assign<T>(target: T, source: Partial<T>): T {
return Object.assign(target, source);
}
private static validIpAddress(ipString: string): boolean {
// tslint:disable-next-line
const ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;