Class: Controller
server.Controller
Controller class for processing api requests
Hierarchy
-
↳
Controller
Constructors
constructor
• new Controller(server
, context
)
Parameters
Name | Type |
---|---|
server |
Server |
context |
Context |
Overrides
Defined in
Properties
context
• context: Context
handlerDefinitions
• handlerDefinitions: HandlerDefinition
[]
Inherited from
Defined in
server
• server: Server
Accessors
attachmentStorage
• get
attachmentStorage():
AttachmentStorage
Returns
Defined in
authServers
• get
authServers(): AuthServer
[]
Returns
Defined in
config
• get
config(): ServerConfig
Returns
Defined in
legacyServer
• get
legacyServer(): undefined
|
LegacyServer
Returns
undefined
| LegacyServer
Defined in
messenger
• get
messenger(): Messenger
Returns
Defined in
provisioner
• get
provisioner():
Provisioner
Returns
Defined in
storage
• get
storage(): Storage
Returns
Defined in
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
_getAuth
▸ Protected
_getAuth(email
): Promise
<Auth
>
Parameters
Name | Type |
---|---|
email |
string |
Returns
Promise
<Auth
>
Defined in
_getAuthServer
▸ Protected
_getAuthServer(type
):
AuthServer
Parameters
Name | Type |
---|---|
type |
AuthType |
Returns
Defined in
_getAuthenticators
▸ Protected
_getAuthenticators(auth
):
Promise
<Authenticator
<any
>[]>
Parameters
Name | Type |
---|---|
auth |
Auth |
Returns
Promise
<Authenticator
<any
>[]>
Defined in
_requireAuth
▸ Private
_requireAuth(): Object
Returns
Object
Name | Type |
---|---|
account |
Account |
auth |
Auth |
provisioning |
Provisioning |
session |
Session |
Defined in
_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
acceptInvite
▸ acceptInvite(invite
): Promise
<void
>
Accept an Invite
Parameters
Name | Type |
---|---|
invite |
Invite |
Returns
Promise
<void
>
Overrides
Defined in
authenticate
▸ authenticate(req
, ctx
): Promise
<void
>
Parameters
Name | Type |
---|---|
req |
Request |
ctx |
Context |
Returns
Promise
<void
>
Defined in
completeAuthRequest
▸ completeAuthRequest(__namedParameters
):
Promise
<CompleteAuthRequestResponse
>
Parameters
Name | Type |
---|---|
__namedParameters |
CompleteAuthRequestParams |
Returns
Promise
<CompleteAuthRequestResponse
>
Overrides
Defined in
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
Defined in
completeRegisterAuthenticator
▸ completeRegisterAuthenticator(__namedParameters
):
Promise
<CompleteRegisterMFAuthenticatorResponse
>
Parameters
Name | Type |
---|---|
__namedParameters |
CompleteRegisterMFAuthenticatorParams |
Returns
Promise
<CompleteRegisterMFAuthenticatorResponse
>
Overrides
API.completeRegisterAuthenticator
Defined in
createAccount
▸ createAccount(__namedParameters
):
Promise
<Account
>
Create a new Account
Parameters
Name | Type |
---|---|
__namedParameters |
CreateAccountParams |
Returns
Promise
<Account
>
Overrides
Defined in
createAttachment
▸ createAttachment(att
): Promise
<string
>
Parameters
Name | Type |
---|---|
att |
Attachment |
Returns
Promise
<string
>
Overrides
Defined in
createKeyStoreEntry
▸ createKeyStoreEntry(__namedParameters
):
Promise
<KeyStoreEntry
>
Parameters
Name | Type |
---|---|
__namedParameters |
CreateKeyStoreEntryParams |
Returns
Promise
<KeyStoreEntry
>
Overrides
Defined in
createOrg
▸ createOrg(org
): Promise
<Org
>
Create a new Org
Parameters
Name | Type |
---|---|
org |
Org |
Returns
Promise
<Org
>
Overrides
Defined in
createVault
▸ createVault(vault
): Promise
<Vault
>
Create a new vault
Parameters
Name | Type |
---|---|
vault |
Vault |
Returns
Promise
<Vault
>
Overrides
Defined in
deleteAccount
▸ deleteAccount(): Promise
<void
>
Delete current account
Returns
Promise
<void
>
Overrides
Defined in
deleteAttachment
▸ deleteAttachment(__namedParameters
): Promise
<void
>
Parameters
Name | Type |
---|---|
__namedParameters |
DeleteAttachmentParams |
Returns
Promise
<void
>
Overrides
Defined in
deleteAuthenticator
▸ deleteAuthenticator(id
): Promise
<void
>
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<void
>
Overrides
Defined in
deleteKeyStoreEntry
▸ deleteKeyStoreEntry(id
): Promise
<void
>
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<void
>
Overrides
Defined in
deleteLegacyAccount
▸ deleteLegacyAccount(): Promise
<void
>
Returns
Promise
<void
>
Overrides
Defined in
deleteOrg
▸ deleteOrg(id
): Promise
<void
>
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<void
>
Overrides
Defined in
deleteVault
▸ deleteVault(id
): Promise
<void
>
Delete the Vault with the given id
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<void
>
Overrides
Defined in
getAccount
▸ getAccount(): Promise
<Account
>
Get the Account associated with the current session
Returns
Promise
<Account
>
Overrides
Defined in
getAttachment
▸ getAttachment(__namedParameters
):
Promise
<Attachment
>
Parameters
Name | Type |
---|---|
__namedParameters |
GetAttachmentParams |
Returns
Promise
<Attachment
>
Overrides
Defined in
getAuthInfo
▸ getAuthInfo(): Promise
<AuthInfo
>
Get the AuthInfo for the current account
Returns
Promise
<AuthInfo
>
Overrides
Defined in
getInvite
▸ getInvite(__namedParameters
): Promise
<Invite
>
Get an Invite.
Parameters
Name | Type |
---|---|
__namedParameters |
GetInviteParams |
Returns
Promise
<Invite
>
Overrides
Defined in
getKeyStoreEntry
▸ getKeyStoreEntry(__namedParameters
):
Promise
<KeyStoreEntry
>
Parameters
Name | Type |
---|---|
__namedParameters |
GetKeyStoreEntryParams |
Returns
Promise
<KeyStoreEntry
>
Overrides
Defined in
getLegacyData
▸ getLegacyData(__namedParameters
):
Promise
<PBES2Container
>
Parameters
Name | Type |
---|---|
__namedParameters |
GetLegacyDataParams |
Returns
Promise
<PBES2Container
>
Overrides
Defined in
getOrg
▸ getOrg(id
): Promise
<Org
>
Get the Org for a given id
.
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<Org
>
Overrides
Defined in
getVault
▸ getVault(id
): Promise
<Vault
>
Get the Vault with the given id
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<Vault
>
Overrides
Defined in
log
▸ log(type
, data?
): LogEvent
Parameters
Name | Type |
---|---|
type |
string |
data |
any |
Returns
Defined in
process
▸ process(req
): Promise
<any
>
Parameters
Name | Type |
---|---|
req |
Request |
Returns
Promise
<any
>
Defined in
recoverAccount
▸ recoverAccount(__namedParameters
):
Promise
<Account
>
Initiate account recovery
Parameters
Name | Type |
---|---|
__namedParameters |
RecoverAccountParams |
Returns
Promise
<Account
>
Overrides
Defined in
removeTrustedDevice
▸ removeTrustedDevice(id
): Promise
<void
>
Parameters
Name | Type |
---|---|
id |
string |
Returns
Promise
<void
>
Overrides
Defined in
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
Defined in
startAuthRequest
▸ startAuthRequest(__namedParameters
):
Promise
<StartAuthRequestResponse
>
Parameters
Name | Type |
---|---|
__namedParameters |
StartAuthRequestParams |
Returns
Promise
<StartAuthRequestResponse
>
Overrides
Defined in
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
Defined in
startRegisterAuthenticator
▸ startRegisterAuthenticator(__namedParameters
):
Promise
<StartRegisterAuthenticatorResponse
>
Parameters
Name | Type |
---|---|
__namedParameters |
StartRegisterAuthenticatorParams |
Returns
Promise
<StartRegisterAuthenticatorResponse
>
Overrides
API.startRegisterAuthenticator
Defined in
updateAccount
▸ updateAccount(__namedParameters
):
Promise
<Account
>
Update the Account associated with the current session.
Parameters
Name | Type |
---|---|
__namedParameters |
Account |
Returns
Promise
<Account
>
Overrides
Defined in
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
Defined in
updateMetaData
▸ updateMetaData(org
): Promise
<void
>
Parameters
Name | Type |
---|---|
org |
Org |
Returns
Promise
<void
>
Defined in
updateOrg
▸ updateOrg(__namedParameters
): Promise
<Org
>
Updates a given Org
Parameters
Name | Type |
---|---|
__namedParameters |
Org |
Returns
Promise
<Org
>
Overrides
Defined in
updateVault
▸ updateVault(__namedParameters
): Promise
<Vault
>
Update the given Vault
Parameters
Name | Type |
---|---|
__namedParameters |
Vault |
Returns
Promise
<Vault
>