UserStorage

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(authenticationUser:)

func add(authenticationUser: AuthenticationUser) throws

Adds a new user to the storage.

  • Parameter authenticationUser: an authentication user that needs to be added to the storage.

Parameters

Name Description
authenticationUser an authentication user that needs to be added to the storage.

authenticationUserExists(with:)

func authenticationUserExists(with userId: String) -> Bool

Check whether there is an authentication 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.

delete(authenticationUser:)

func delete(authenticationUser: AuthenticationUser) -> Bool

Deletes the authentication user.

  • Parameter authenticationUser: an authentication user that needs to be deleted from the storage.

Parameters

Name Description
authenticationUser an authentication user that needs to be deleted from the storage.

authenticationUsers()

func authenticationUsers() -> [AuthenticationUser]

Get all authentication 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.

delete(signingUser:)

func delete(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.