Password Manager Entitlements
Managing consumption of Password Manager capabilities
The Password Manager SDK enables you to examine the resources used and their limits for a registered user. Resource limits are described by an Entitlement, an object with a name and a limit indicating some maximum usage value. Resource usage is tracked for each Sudo.
Entitlement Types
The following table describes the entitlements used to control access to the Password Manager:
sudoplatform.vault.vaultMaxPerSudo
Numeric
Maximum number of vaults a Sudo can have at a time. If zero, this user is not entitled to access the Password Manager.
/* ... */
export type EntitlementName = 'vaultMaxPerSudo' | ...public struct Entitlement {
/* ... */
public enum Name: String {
case maxVaultPerSudo
}
}data class Entitlement(
// ...
) : Parcelable {
/** Enum that represents the different types of entitlements available */
enum class Name {
MAX_VAULTS_PER_SUDO
}
}Getting Entitlements
The getEntitlement method returns the set of Password Manager Entitlements and their limits granted to the signed in user.
try {
const entitlements = await client.getEntitlement()
entitlements.forEach((ent) =>
console.log(`This user can have up to ${ent.limit} of ${ent.name}`))
} catch (error) {
// Handle/notify user of the error.
}var client: PasswordManagerClient!
client.getEntitlement { (result) in
switch result {
case .success(let entitlements):
entitlements.forEach {
print("This user can have up to \($0.limit) of \($0.name)")
}
case .failure(let error):
/* Handle error logic */
return
}
}The getEntitlementState method returns the usage value of each Password Manager Entitlement for each Sudo.
Last updated