Use new CDS implementation in staging
This commit is contained in:
parent
5774fdef9f
commit
0c8c332805
11 changed files with 284 additions and 130 deletions
18
ts/util/getBasicAuth.ts
Normal file
18
ts/util/getBasicAuth.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2020-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { fromString, toBase64 } from '../Bytes';
|
||||
|
||||
export type GetBasicAuthOptionsType = Readonly<{
|
||||
username: string;
|
||||
password: string;
|
||||
}>;
|
||||
|
||||
export function getBasicAuth({
|
||||
username,
|
||||
password,
|
||||
}: GetBasicAuthOptionsType): string {
|
||||
const auth = toBase64(fromString(`${username}:${password}`));
|
||||
|
||||
return `Basic ${auth}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue