PROTOCOL
UserStorage
@objc public protocol UserStorage
A type representing storage, where already authenticated users will be kept between app launches. By default this SDK uses concrete implementation of the protocol done at SQLiteUserStorage class. Also keep in mind, that this protocol doesn’t provide any data encryption and therefore developers have to implement it by themselves.
Methods
loadStorage()
func loadStorage() throws
add(user:)
func add(user: AuthenticationUser) throws
Adds a new user to the storage.
- Parameter user: a user that needs to be added to the storage.
Parameters
Name | Description |
---|---|
user | a user that needs to be added to the storage. |
userExists(with:)
func userExists(with userId: String) -> Bool
Check whether there is a user in storage with a given user id.
- Parameter userId: a user id to be checked in the storage.
Parameters
Name | Description |
---|---|
userId | a user id to be checked in the storage. |
deleteUser(by:)
func deleteUser(by user: AuthenticationUser) -> Bool
Deletes the authentication user.
- Parameter user: an authentication user that needs to be added to the storage.
Parameters
Name | Description |
---|---|
user | an authentication user that needs to be added to the storage. |
authenticationUsers()
func authenticationUsers() -> [AuthenticationUser]
Get all users written in the storage.
add(signingUser:)
func add(signingUser: SigningUser) throws
Adds a new signing user to the storage.
- Parameter signingUser: a signing user that needs to be added to the storage.
Parameters
Name | Description |
---|---|
signingUser | a signing user that needs to be added to the storage. |
signingUserExists(with:)
func signingUserExists(with userId: String) -> Bool
Check whether there is a signing User in the storage with a given user id.
- Parameter userId: a signing user id to be checked in the storage.
Parameters
Name | Description |
---|---|
userId | a signing user id to be checked in the storage. |
deleteSigningUser(by:)
func deleteSigningUser(by signingUser: SigningUser) -> Bool
Deletes the signing user.
- Parameter signingUser: the signing user that has to be deleted.
Parameters
Name | Description |
---|---|
signingUser | the signing user that has to be deleted. |
signingUsers()
func signingUsers() -> [SigningUser]
Get all signing users written in the storage.