Padloc Logo Docs & Resources

Class: Controller

server.Controller

Controller class for processing api requests

Hierarchy

  • API

    Controller

Constructors

constructor

new Controller(server, context)

Parameters

Name Type
server Server
context Context

Overrides

API.constructor

Defined in

core/src/server.ts:129

Properties

context

context: Context


handlerDefinitions

handlerDefinitions: HandlerDefinition[]

Inherited from

API.handlerDefinitions

Defined in

core/src/api.ts:428


server

server: Server

Accessors

attachmentStorage

get attachmentStorage(): AttachmentStorage

Returns

AttachmentStorage

Defined in

core/src/server.ts:145


authServers

get authServers(): AuthServer[]

Returns

AuthServer[]

Defined in

core/src/server.ts:153


config

get config(): ServerConfig

Returns

ServerConfig

Defined in

core/src/server.ts:133


legacyServer

get legacyServer(): undefined | LegacyServer

Returns

undefined | LegacyServer

Defined in

core/src/server.ts:149


messenger

get messenger(): Messenger

Returns

Messenger

Defined in

core/src/server.ts:141


provisioner

get provisioner(): Provisioner

Returns

Provisioner

Defined in

core/src/server.ts:157


storage

get storage(): Storage

Returns

Storage

Defined in

core/src/server.ts:137

Methods

_createAdHocAuthenticator

Private _createAdHocAuthenticator(auth, purposes, type): Promise<Authenticator<any>>

Parameters

Name Type
auth Auth
purposes AuthPurpose[]
type AuthType

Returns

Promise<Authenticator<any>>

Defined in

core/src/server.ts:1748


_getAuth

Protected _getAuth(email): Promise<Auth>

Parameters

Name Type
email string

Returns

Promise<Auth>

Defined in

core/src/server.ts:1760


_getAuthServer

Protected _getAuthServer(type): AuthServer

Parameters

Name Type
type AuthType

Returns

AuthServer

Defined in

core/src/server.ts:1842


_getAuthenticators

Protected _getAuthenticators(auth): Promise<Authenticator<any>[]>

Parameters

Name Type
auth Auth

Returns

Promise<Authenticator<any>[]>

Defined in

core/src/server.ts:1733


_requireAuth

Private _requireAuth(): Object

Returns

Object

Name Type
account Account
auth Auth
provisioning Provisioning
session Session

Defined in

core/src/server.ts:1723


_useAuthToken

Private _useAuthToken(__namedParameters): Promise<void>

Parameters

Name Type
__namedParameters Object
__namedParameters.authenticatorId? string
__namedParameters.email string
__namedParameters.purpose AuthPurpose
__namedParameters.requestId? string
__namedParameters.token string

Returns

Promise<void>

Defined in

core/src/server.ts:1853


acceptInvite

acceptInvite(invite): Promise<void>

Accept an Invite

Parameters

Name Type
invite Invite

Returns

Promise<void>

Overrides

API.acceptInvite

Defined in

core/src/server.ts:1470


authenticate

authenticate(req, ctx): Promise<void>

Parameters

Name Type
req Request
ctx Context

Returns

Promise<void>

Defined in

core/src/server.ts:161


completeAuthRequest

completeAuthRequest(__namedParameters): Promise<CompleteAuthRequestResponse>

Parameters

Name Type
__namedParameters CompleteAuthRequestParams

Returns

Promise<CompleteAuthRequestResponse>

Overrides

API.completeAuthRequest

Defined in

core/src/server.ts:394


completeCreateSession

completeCreateSession(__namedParameters): Promise<Session>

Create new Session which can be used to authenticate future request

Parameters

Name Type
__namedParameters CompleteCreateSessionParams

Returns

Promise<Session>

Overrides

API.completeCreateSession

Defined in

core/src/server.ts:553


completeRegisterAuthenticator

completeRegisterAuthenticator(__namedParameters): Promise<CompleteRegisterMFAuthenticatorResponse>

Parameters

Name Type
__namedParameters CompleteRegisterMFAuthenticatorParams

Returns

Promise<CompleteRegisterMFAuthenticatorResponse>

Overrides

API.completeRegisterAuthenticator

Defined in

core/src/server.ts:266


createAccount

createAccount(__namedParameters): Promise<Account>

Create a new Account

Parameters

Name Type
__namedParameters CreateAccountParams

Returns

Promise<Account>

Overrides

API.createAccount

Defined in

core/src/server.ts:643


createAttachment

createAttachment(att): Promise<string>

Parameters

Name Type
att Attachment

Returns

Promise<string>

Overrides

API.createAttachment

Defined in

core/src/server.ts:1520


createKeyStoreEntry

createKeyStoreEntry(__namedParameters): Promise<KeyStoreEntry>

Parameters

Name Type
__namedParameters CreateKeyStoreEntryParams

Returns

Promise<KeyStoreEntry>

Overrides

API.createKeyStoreEntry

Defined in

core/src/server.ts:1657


createOrg

createOrg(org): Promise<Org>

Create a new Org

Parameters

Name Type
org Org

Returns

Promise<Org>

Overrides

API.createOrg

Defined in

core/src/server.ts:878


createVault

createVault(vault): Promise<Vault>

Create a new vault

Parameters

Name Type
vault Vault

Returns

Promise<Vault>

Overrides

API.createVault

Defined in

core/src/server.ts:1354


deleteAccount

deleteAccount(): Promise<void>

Delete current account

Returns

Promise<void>

Overrides

API.deleteAccount

Defined in

core/src/server.ts:846


deleteAttachment

deleteAttachment(__namedParameters): Promise<void>

Parameters

Name Type
__namedParameters DeleteAttachmentParams

Returns

Promise<void>

Overrides

API.deleteAttachment

Defined in

core/src/server.ts:1592


deleteAuthenticator

deleteAuthenticator(id): Promise<void>

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.deleteAuthenticator

Defined in

core/src/server.ts:289


deleteKeyStoreEntry

deleteKeyStoreEntry(id): Promise<void>

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.deleteKeyStoreEntry

Defined in

core/src/server.ts:1700


deleteLegacyAccount

deleteLegacyAccount(): Promise<void>

Returns

Promise<void>

Overrides

API.deleteLegacyAccount

Defined in

core/src/server.ts:1641


deleteOrg

deleteOrg(id): Promise<void>

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.deleteOrg

Defined in

core/src/server.ts:1221


deleteVault

deleteVault(id): Promise<void>

Delete the Vault with the given id

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.deleteVault

Defined in

core/src/server.ts:1404


getAccount

getAccount(): Promise<Account>

Get the Account associated with the current session

Returns

Promise<Account>

Overrides

API.getAccount

Defined in

core/src/server.ts:699


getAttachment

getAttachment(__namedParameters): Promise<Attachment>

Parameters

Name Type
__namedParameters GetAttachmentParams

Returns

Promise<Attachment>

Overrides

API.getAttachment

Defined in

core/src/server.ts:1569


getAuthInfo

getAuthInfo(): Promise<AuthInfo>

Get the AuthInfo for the current account

Returns

Promise<AuthInfo>

Overrides

API.getAuthInfo

Defined in

core/src/server.ts:706


getInvite

getInvite(__namedParameters): Promise<Invite>

Get an Invite.

Parameters

Name Type
__namedParameters GetInviteParams

Returns

Promise<Invite>

Overrides

API.getInvite

Defined in

core/src/server.ts:1448


getKeyStoreEntry

getKeyStoreEntry(__namedParameters): Promise<KeyStoreEntry>

Parameters

Name Type
__namedParameters GetKeyStoreEntryParams

Returns

Promise<KeyStoreEntry>

Overrides

API.getKeyStoreEntry

Defined in

core/src/server.ts:1682


getLegacyData

getLegacyData(__namedParameters): Promise<PBES2Container>

Parameters

Name Type
__namedParameters GetLegacyDataParams

Returns

Promise<PBES2Container>

Overrides

API.getLegacyData

Defined in

core/src/server.ts:1613


getOrg

getOrg(id): Promise<Org>

Get the Org for a given id.

Parameters

Name Type
id string

Returns

Promise<Org>

Overrides

API.getOrg

Defined in

core/src/server.ts:918


getVault

getVault(id): Promise<Vault>

Get the Vault with the given id

Parameters

Name Type
id string

Returns

Promise<Vault>

Overrides

API.getVault

Defined in

core/src/server.ts:1251


log

log(type, data?): LogEvent

Parameters

Name Type
type string
data any

Returns

LogEvent

Defined in

core/src/server.ts:247


process

process(req): Promise<any>

Parameters

Name Type
req Request

Returns

Promise<any>

Defined in

core/src/server.ts:227


recoverAccount

recoverAccount(__namedParameters): Promise<Account>

Initiate account recovery

Parameters

Name Type
__namedParameters RecoverAccountParams

Returns

Promise<Account>

Overrides

API.recoverAccount

Defined in

core/src/server.ts:782


removeTrustedDevice

removeTrustedDevice(id): Promise<void>

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.removeTrustedDevice

Defined in

core/src/server.ts:500


revokeSession

revokeSession(id): Promise<void>

Revoke a Session, effectively logging out any client authenticated with it

Parameters

Name Type
id string

Returns

Promise<void>

Overrides

API.revokeSession

Defined in

core/src/server.ts:626


startAuthRequest

startAuthRequest(__namedParameters): Promise<StartAuthRequestResponse>

Parameters

Name Type
__namedParameters StartAuthRequestParams

Returns

Promise<StartAuthRequestResponse>

Overrides

API.startAuthRequest

Defined in

core/src/server.ts:315


startCreateSession

startCreateSession(__namedParameters): Promise<StartCreateSessionResponse>

Initiate the login procedure for a given account by requesting the authentication params which are required for proceeding with [[createSession]].

Parameters

Name Type
__namedParameters StartCreateSessionParams

Returns

Promise<StartCreateSessionResponse>

Overrides

API.startCreateSession

Defined in

core/src/server.ts:512


startRegisterAuthenticator

startRegisterAuthenticator(__namedParameters): Promise<StartRegisterAuthenticatorResponse>

Parameters

Name Type
__namedParameters StartRegisterAuthenticatorParams

Returns

Promise<StartRegisterAuthenticatorResponse>

Overrides

API.startRegisterAuthenticator

Defined in

core/src/server.ts:251


updateAccount

updateAccount(__namedParameters): Promise<Account>

Update the Account associated with the current session.

Parameters

Name Type
__namedParameters Account

Returns

Promise<Account>

Overrides

API.updateAccount

Defined in

core/src/server.ts:743


updateAuth

updateAuth(__namedParameters): Promise<void>

Update the authentication params stored on the server. This is usually used in case a users master password has changed.

Parameters

Name Type
__namedParameters UpdateAuthParams

Returns

Promise<void>

Overrides

API.updateAuth

Defined in

core/src/server.ts:480


updateMetaData

updateMetaData(org): Promise<void>

Parameters

Name Type
org Org

Returns

Promise<void>

Defined in

core/src/server.ts:1653


updateOrg

updateOrg(__namedParameters): Promise<Org>

Updates a given Org

Parameters

Name Type
__namedParameters Org

Returns

Promise<Org>

Overrides

API.updateOrg

Defined in

core/src/server.ts:934


updateVault

updateVault(__namedParameters): Promise<Vault>

Update the given Vault

Parameters

Name Type
__namedParameters Vault

Returns

Promise<Vault>

Overrides

API.updateVault

Defined in

core/src/server.ts:1278