DefaultSudoProfilesClient

public class DefaultSudoProfilesClient : SudoProfilesClient

Default implementation of SudoProfilesClient.

  • Intializes a new DefaultSudoProfilesClient instance. It uses configuration parameters defined in sudoplatformconfig.json file located in the app bundle.

    Declaration

    Swift

    convenience public init(sudoUserClient: SudoUserClient, blobContainerURL: URL, maxSudos: Int = 10) throws

    Parameters

    sudoUserClient

    SudoUserClient instance required to issue authentication tokens and perform cryptographic operations.

    blobContainerURL

    Container URL to which large binary objects will be stored.

    maxSudos

    Maximum number of Sudos to cap the queries to. Defaults to 10.

    logger

    A logger to use for logging messages. If none provided then a default internal logger will be used.

  • Intializes a new DefaultSudoProfilesClient instance with the specified backend configuration.

    Declaration

    Swift

    public init(config: [String : Any], sudoUserClient: SudoUserClient, cacheType: CacheType = .disk, blobContainerURL: URL, maxSudos: Int = 10, logger: Logger? = nil, cryptoProvider: CryptoProvider? = nil, graphQLClient: SudoApiClient? = nil, s3Client: S3Client? = nil, ownershipProofIssuer: OwnershipProofIssuer? = nil) throws

    Parameters

    config

    Configuration parameters for the client.

    sudoUserClient

    SudoUserClient instance required to issue authentication tokens and perform cryptographic operations.

    cacheType

    Cache type to use. Please refer to CacheType enum.

    blobContainerURL

    Container URL to which large binary objects will be stored.

    maxSudos

    Maximum number of Sudos to cap the quries to. Defaults to 10.

    logger

    A logger to use for logging messages. If none provided then a default internal logger will be used.

    graphQLClient

    Optional GraphQL client to use. Mainly used for unit testing.

    s3Client

    Optional S3 client to use. Mainly use for unit testing.

    ownershipProofIssuer

    Optional ownership proof issuer to use. Mainly use for testing of various service clients.

  • createSudo(sudo:) Asynchronous

    Declaration

    Swift

    public func createSudo(sudo: Sudo) async throws -> Sudo
  • updateSudo(sudo:) Asynchronous

    Declaration

    Swift

    public func updateSudo(sudo: Sudo) async throws -> Sudo
  • deleteSudo(sudo:) Asynchronous

    Declaration

    Swift

    public func deleteSudo(sudo: Sudo) async throws
  • listSudos(option:) Asynchronous

    Declaration

    Swift

    public func listSudos(option: ListOption) async throws -> [Sudo]
  • Declaration

    Swift

    public func getOutstandingRequestsCount() -> Int
  • Declaration

    Swift

    public func reset() throws
  • Declaration

    Swift

    public func subscribe(id: String, subscriber: SudoSubscriber) async throws
  • Declaration

    Swift

    public func subscribe(id: String, changeType: SudoChangeType, subscriber: SudoSubscriber) async throws
  • Declaration

    Swift

    public func unsubscribe(id: String, changeType: SudoChangeType)
  • Declaration

    Swift

    public func unsubscribe(id: String)
  • Declaration

    Swift

    public func unsubscribeAll()
  • Declaration

    Swift

    public func getOwnershipProof(sudo: Sudo, audience: String) async throws -> String
  • Declaration

    Swift

    public func generateEncryptionKey() throws -> String
  • Declaration

    Swift

    public func getSymmetricKeyId() throws -> String?
  • Declaration

    Swift

    public func importEncryptionKeys(keys: [EncryptionKey], currentKeyId: String) throws
  • Declaration

    Swift

    public func exportEncryptionKeys() throws -> [EncryptionKey]