Managing Password Vaults
Provides the abilities to allow your users to create and manage their own password vaults.
Creating a Vault
try {
const sudoId = ""
const vaultId = await client.createVault(sudoId)
// `vaultId` contains the identifier of the newly created vault object.
} catch (error) {
// handle errors or throw the error
throw error
}var client: PasswordManagerClient!
client.createVault(sudoId: "") { (result) in
switch result {
case .success(let vault):
break
case .failure(let error):
break
}
}// val client: SudoPasswordManagerClient
// val sudoId: String
launch {
try {
val vault = withContext(Dispatchers.IO) {
client.createVault(sudoId)
}
} catch (e: SudoPasswordManagerException) {
// Handle/notify user of exception
}
}Retrieving Vaults
try {
const vaults = await client.listVaults()
// each vault in the array of vaults has an `id`
// which can be used to access its items.
} catch {
// Handle/notify user of errors
}var client: PasswordManagerClient!
client.listVaults { (result) in
switch result {
case .success(let vaults):
break
case .failure(let error):
break
}
}
client.getVault(withId: "1") { (result) in
switch result {
case .success(let vault):
break
case .failure(let error):
break
}
}Deleting a Vault
Last updated