UNPKG

@bitblit/ratchet-warden-server

Version:

Typescript library to simplify using simplewebauthn and secondary auth methods over GraphQL

33 lines (32 loc) 1.83 kB
import { WardenContact } from '@bitblit/ratchet-warden-common/common/model/warden-contact'; import { WardenEntrySummary } from '@bitblit/ratchet-warden-common/common/model/warden-entry-summary'; import { WardenEntry } from '@bitblit/ratchet-warden-common/common/model/warden-entry'; import { WardenStorageProvider } from './warden-storage-provider.js'; import { WardenS3SingleFileStorageProviderOptions } from './warden-s3-single-file-storage-provider-options.js'; import { PutObjectOutput, S3Client } from '@aws-sdk/client-s3'; export declare class WardenS3SingleFileStorageProvider implements WardenStorageProvider { private s3; private options; private ratchet; constructor(s3: S3Client, options: WardenS3SingleFileStorageProviderOptions); listUserSummaries(): Promise<WardenEntrySummary[]>; fetchDataFile(): Promise<WardenS3SingleFileStorageProviderDataFile>; storeDataFile(file: WardenS3SingleFileStorageProviderDataFile): Promise<PutObjectOutput>; fetchCurrentUserChallenge(userId: string, relyingPartyId: string): Promise<string>; findEntryByContact(contact: WardenContact): Promise<WardenEntry>; findEntryByThirdPartyId(thirdParty: string, thirdPartyId: string): Promise<WardenEntry>; findEntryById(userId: string): Promise<WardenEntry>; removeEntry(userId: string): Promise<boolean>; saveEntry(entry: WardenEntry): Promise<WardenEntry>; updateUserChallenge(userId: string, relyingPartyId: string, challenge: string): Promise<boolean>; } export interface WardenS3SingleFileStorageProviderChallengeRecord { userId: string; relyingPartyId: string; challenge: string; updatedEpochMS: number; } export interface WardenS3SingleFileStorageProviderDataFile { entries: WardenEntry[]; challenges: WardenS3SingleFileStorageProviderChallengeRecord[]; }