SudoProfilesClient
public protocol SudoProfilesClient : AnyObject
Protocol encapsulating a library functions for managing Sudos in the Sudo service.
-
createSudo(sudo:Asynchronous) Creates a new Sudo.
Throws
SudoProfilesClientErrorParameters
sudoSudo to create.
Return Value
the created Sudo.
-
updateSudo(sudo:Asynchronous) Update a Sudo.
Throws
SudoProfilesClientErrorParameters
sudoSudo to update.
Return Value
the updated Sudo.
-
deleteSudo(sudo:Asynchronous) Deletes a Sudo.
Throws
SudoProfilesClientErrorDeclaration
Swift
func deleteSudo(sudo: Sudo) async throws -
listSudos(option:Asynchronous) Retrieves all Sudos owned by signed in user.
Throws
SudoProfilesClientErrorDeclaration
Swift
func listSudos(option: ListOption) async throws -> [Sudo]Parameters
optionoption for controlling the behaviour of this API. Refer to
ListOptionenum.Return Value
an array of all the Sudos owned by signed in user.
-
Returns the count of outstanding create or update requests.
Declaration
Swift
func getOutstandingRequestsCount() -> IntReturn Value
Outstanding requests count.
-
Resets any cached data.
Throws
SudoProfilesClientErrorDeclaration
Swift
func reset() throws -
subscribe(id:AsynchronouschangeType: subscriber: ) Subscribes to be notified of new, updated or deleted Sudos. Blob data is not downloaded automatically so the caller is expected to use
listSudosAPI if they need to access any associated blobs.Declaration
Swift
func subscribe(id: String, changeType: SudoChangeType, subscriber: SudoSubscriber) async throwsParameters
idUnique ID to be associated with the subscriber.
changeTypeChange type to subscribe to.
subscriberSubscriber to notify.
-
subscribe(id:Asynchronoussubscriber: ) Subscribes to be notified of new, updated and deleted Sudos. Blob data is not downloaded automatically so the caller is expected to use
listSudosAPI if they need to access any associated blobs.Declaration
Swift
func subscribe(id: String, subscriber: SudoSubscriber) async throwsParameters
idUnique ID to be associated with the subscriber.
subscriberSubscriber to notify.
-
Unsubscribes the specified subscriber so that it no longer receives notifications about new, updated or deleted Sudos.
Declaration
Swift
func unsubscribe(id: String, changeType: SudoChangeType)Parameters
idUnique ID associated with the subscriber to unsubscribe.
changeTypeChange type to unsubscribe from.
-
Unsubscribes the specified subscriber so that it no longer receives change notifications.
Declaration
Swift
func unsubscribe(id: String)Parameters
idUnique ID associated with the subscriber to unsubscribe.
-
Unsubscribe all subscribers from receiving notifications about new, updated or deleted Sudos.
Declaration
Swift
func unsubscribeAll() -
getOwnershipProof(sudo:Asynchronousaudience: ) Retrieves a signed owernship proof for the specified Sudo.
Declaration
Swift
func getOwnershipProof(sudo: Sudo, audience: String) async throws -> StringParameters
sudoSudo to generate an ownership proof for.
audienceTarget audience for this proof.
Return Value
JSON Web Token representing Sudo ownership proof.
-
Generate an encryption key to use for encrypting Sudo claims. Any existing keys are not removed to be able to decrypt existing claims but new claims will be encrypted using the newly generated key.
Declaration
Swift
@discardableResult func generateEncryptionKey() throws -> StringReturn Value
Unique ID of the generated key.
-
Get the current (most recently generated) symmetric key ID..
Declaration
Swift
func getSymmetricKeyId() throws -> String?Return Value
Symmetric Key ID.
-
Import encyrption keys to use for encrypting and decrypting Sudo claims. All existing keys will be removed before the new keys are imported.
Declaration
Swift
func importEncryptionKeys(keys: [EncryptionKey], currentKeyId: String) throwsParameters
keysKeys to import.
currentKeyIdID of the key to use for encrypting new claims..
-
Export encryption keys used for encrypting and decrypting Sudo claims.
Declaration
Swift
func exportEncryptionKeys() throws -> [EncryptionKey]Return Value
Encryption keys.
SudoProfilesClient Protocol Reference