APIKeyAuth

public extension APIKeyAuth
  • Creates a user API key that can be used to authenticate as the current user. @param name The name of the API key to be created. @returns A publisher that eventually return UserAPIKey or Error.

    Declaration

    Swift

    func createAPIKey(named: String) -> Future<UserAPIKey, Error>
  • Fetches a user API key associated with the current user. @param objectId The ObjectId of the API key to fetch. @returns A publisher that eventually return UserAPIKey or Error.

    Declaration

    Swift

    func fetchAPIKey(_ objectId: ObjectId) -> Future<UserAPIKey, Error>
  • Fetches the user API keys associated with the current user. @returns A publisher that eventually return [UserAPIKey] or Error.

    Declaration

    Swift

    func fetchAPIKeys() -> Future<[UserAPIKey], Error>
  • Deletes a user API key associated with the current user. @param objectId The ObjectId of the API key to delete. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func deleteAPIKey(_ objectId: ObjectId) -> Future<Void, Error>
  • Enables a user API key associated with the current user. @param objectId The ObjectId of the API key to enable. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func enableAPIKey(_ objectId: ObjectId) -> Future<Void, Error>
  • Disables a user API key associated with the current user. @param objectId The ObjectId of the API key to disable. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func disableAPIKey(_ objectId: ObjectId) -> Future<Void, Error>
  • Creates a user API key that can be used to authenticate as the current user. @param name The name of the API key to be created. @completion A completion that eventually return Result.success(UserAPIKey) or Result.failure(Error).

    Declaration

    Swift

    @preconcurrency
    func createAPIKey(named: String, completion: @escaping @Sendable (Result<UserAPIKey, Error>) -> Void)
  • Fetches a user API key associated with the current user. @param objectId The ObjectId of the API key to fetch. @completion A completion that eventually return Result.success(UserAPIKey) or Result.failure(Error).

    Declaration

    Swift

    @preconcurrency
    func fetchAPIKey(_ objectId: ObjectId, _ completion: @escaping @Sendable (Result<UserAPIKey, Error>) -> Void)
  • Fetches the user API keys associated with the current user. @completion A completion that eventually return Result.success([UserAPIKey]) or Result.failure(Error).

    Declaration

    Swift

    @preconcurrency
    func fetchAPIKeys(_ completion: @escaping @Sendable (Result<[UserAPIKey], Error>) -> Void)