1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 13:40:06 +00:00

Stub out opaque services

This commit is contained in:
Thomas Rittson
2025-03-11 12:55:32 +10:00
parent 992be1d054
commit 1dd768e694
3 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { UserKey } from "../../types/key";
import { OpaqueApiService } from "./opaque-api.service";
import { OpaqueService } from "./opaque.service";
export class DefaultOpaqueService implements OpaqueService {
constructor(private opaqueApiService: OpaqueApiService) {}
async Register(masterPassword: string, userKey: UserKey) {
throw new Error("Not implemented");
await Promise.resolve();
}
async Login(masterPassword: string) {
throw new Error("Not implemented");
return await Promise.resolve(null as unknown as UserKey);
}
}

View File

@@ -0,0 +1,6 @@
export abstract class OpaqueApiService {
abstract StartRegistration(): any;
abstract FinishRegistration(): any;
abstract StartLogin(): any;
abstract FinishLogin(): any;
}

View File

@@ -0,0 +1,14 @@
import { UserKey } from "../../types/key";
export abstract class OpaqueService {
/**
* Register a user to use the Opaque login method.
*/
abstract Register(masterPassword: string, userKey: UserKey): Promise<void>;
/**
* Authenticate using the Opaque login method.
* @returns The UserKey obtained during the Opaque login flow.
*/
abstract Login(masterPassword: string): Promise<UserKey>;
}