Padloc Logo Docs & Resources

Class: Auth

auth.Auth

Contains authentication data needed for SRP session negotiation

Hierarchy

Implements

Constructors

constructor

new Auth(email?)

Parameters

Name Type Default value
email string ""

Overrides

Serializable.constructor

Defined in

core/src/auth.ts:234

Properties

_propertySerializationOptions

_propertySerializationOptions: SerializationOptions[]

Implementation of

Storable._propertySerializationOptions

Inherited from

Serializable._propertySerializationOptions

Defined in

core/src/encoding.ts:163


account

Optional account: string = undefined

Id of the Account the authentication data belongs to

Defined in

core/src/auth.ts:184


accountStatus

accountStatus: AccountStatus = AccountStatus.Unregistered

Defined in

core/src/auth.ts:190


authRequests

authRequests: AuthRequest<any>[] = []

Defined in

core/src/auth.ts:210


authenticators

authenticators: Authenticator<any>[] = []

Defined in

core/src/auth.ts:207


created

created: Date

Defined in

core/src/auth.ts:181


email

email: string = ""


id

id: string = ""

Implementation of

Storable.id

Defined in

core/src/auth.ts:178


invites

invites: { expires: string ; id: string ; orgId: string ; orgName: string }[] = []

Invites to organizations

Defined in

core/src/auth.ts:224


keyParams

keyParams: PBKDF2Params

Key derivation params used by the client to compute session key from the users master password

Defined in

core/src/auth.ts:201


keyStoreEntries

keyStoreEntries: KeyStoreEntryInfo[] = []

Defined in

core/src/auth.ts:213


legacyData

Optional legacyData: PBES2Container

Defined in

core/src/auth.ts:232


mfaOrder

mfaOrder: string[] = []

Defined in

core/src/auth.ts:221


sessions

sessions: SessionInfo[] = []

Defined in

core/src/auth.ts:216


srpSessions

srpSessions: SRPSession[] = []

Defined in

core/src/auth.ts:219


trustedDevices

trustedDevices: DeviceInfo[] = []

Defined in

core/src/auth.ts:204


verifier

Optional verifier: Uint8Array

Verifier used for SRP session negotiation

Defined in

core/src/auth.ts:194

Accessors

accountId

get accountId(): undefined | string

Returns

undefined | string

Defined in

core/src/auth.ts:186


kind

get kind(): string

A string representing the objects "type", useful for segmenting storage, among other things. Defaults to the lowercase class name, but can be overwritten by subclasses

Returns

string

Implementation of

Storable.kind

Inherited from

Serializable.kind

Defined in

core/src/encoding.ts:159

Methods

_fromRaw

Protected _fromRaw(raw): void

Restore values from a raw object. The default implementation simply copies over all iterable properties from the base object. Overwrite this method for properties that require special treatment

Parameters

Name Type
raw any

Returns

void

Implementation of

Storable._fromRaw

Inherited from

Serializable._fromRaw

Defined in

core/src/encoding.ts:286


_toRaw

Protected _toRaw(version): any

Transform this object into a raw javascript object used for serialization. The default implementation simply copies all iterable properties not included in the [[exlude]] array and calls toRaw on any properties that are themselfes instances of Serializable. This method should be overwritten by subclasses if certain properties require special treatment.

Parameters

Name Type
version undefined | string

Returns

any

Implementation of

Storable._toRaw

Inherited from

Serializable._toRaw

Defined in

core/src/encoding.ts:257


clone

clone(): Auth

Creates a deep clone of the object

Returns

Auth

Implementation of

Storable.clone

Inherited from

Serializable.clone

Defined in

core/src/encoding.ts:244


fromBytes

fromBytes(bytes): Auth

Deserializes the object from a byte array

Parameters

Name Type
bytes Uint8Array

Returns

Auth

Implementation of

Storable.fromBytes

Inherited from

Serializable.fromBytes

Defined in

core/src/encoding.ts:237


fromJSON

fromJSON(json): Auth

Deserializes the object from a JSON string

Parameters

Name Type
json string

Returns

Auth

Implementation of

Storable.fromJSON

Inherited from

Serializable.fromJSON

Defined in

core/src/encoding.ts:223


fromRaw

fromRaw(raw): Auth

Restores propertiers from a raw object of the same form generated by toRaw. The base implementation blindly copies over values from the raw object via Object.assign so subclasses should explictly process any propertyies that need special treatment.

Also takes are of validation and "upgrading" in case the raw object has an old version. Use the protected _fromRaw method to implement subclass-specific behavior.

Parameters

Name Type
raw any

Returns

Auth

Implementation of

Storable.fromRaw

Inherited from

Serializable.fromRaw

Defined in

core/src/encoding.ts:196


getAuthKey

getAuthKey(password): Promise<Uint8Array>

Generate the session key from the users master password

Parameters

Name Type
password string

Returns

Promise<Uint8Array>

Defined in

core/src/auth.ts:245


init

init(): Promise<void>

Returns

Promise<void>

Defined in

core/src/auth.ts:238


toBytes

toBytes(): Uint8Array

Returns a serialization of the object in form of a byte array

Returns

Uint8Array

Implementation of

Storable.toBytes

Inherited from

Serializable.toBytes

Defined in

core/src/encoding.ts:230


toJSON

toJSON(): string

Returns a JSON serialization of the object

Returns

string

Implementation of

Storable.toJSON

Inherited from

Serializable.toJSON

Defined in

core/src/encoding.ts:216


toRaw

toRaw(version?): any

Creates a raw javascript object representation of the class, which can be used for storage or data transmission. Also handles "downgrading" to previous versions. Use _toRaw for subclass-specific behavior.

Parameters

Name Type
version? string

Returns

any

Implementation of

Storable.toRaw

Inherited from

Serializable.toRaw

Defined in

core/src/encoding.ts:179


validate

validate(): boolean

This is called during deserialization and should verify that all properties have been populated with values of the correct type. Subclasses should implement this method based on their class structure.

Returns

boolean

Implementation of

Storable.validate

Inherited from

Serializable.validate

Defined in

core/src/encoding.ts:170