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:
18
libs/common/src/auth/opaque/default-opaque.service.ts
Normal file
18
libs/common/src/auth/opaque/default-opaque.service.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
6
libs/common/src/auth/opaque/opaque-api.service.ts
Normal file
6
libs/common/src/auth/opaque/opaque-api.service.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export abstract class OpaqueApiService {
|
||||
abstract StartRegistration(): any;
|
||||
abstract FinishRegistration(): any;
|
||||
abstract StartLogin(): any;
|
||||
abstract FinishLogin(): any;
|
||||
}
|
||||
14
libs/common/src/auth/opaque/opaque.service.ts
Normal file
14
libs/common/src/auth/opaque/opaque.service.ts
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user