RLMAPIKeyAuth
Objective-C
@interface RLMAPIKeyAuth : RLMProviderClient
Swift
@_nonSendable(_assumed) class RLMAPIKeyAuth : RLMProviderClient, @unchecked Sendable
Provider client for user API keys.
-
Creates a user API key that can be used to authenticate as the current user.
Declaration
Objective-C
- (void)createAPIKeyWithName:(nonnull NSString *)name completion:(nonnull RLMOptionalUserAPIKeyBlock)completion;
Swift
func createAPIKey(named name: String) async throws -> RLMUserAPIKey
Parameters
name
The name of the API key to be created.
completion
A callback to be invoked once the call is complete.
-
Fetches a user API key associated with the current user.
Declaration
Objective-C
- (void)fetchAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMOptionalUserAPIKeyBlock)completion;
Swift
func fetchAPIKey(_ objectId: RLMObjectId) async throws -> RLMUserAPIKey
Parameters
objectId
The ObjectId of the API key to fetch.
completion
A callback to be invoked once the call is complete.
-
Fetches the user API keys associated with the current user.
Declaration
Objective-C
- (void)fetchAPIKeysWithCompletion:(nonnull RLMUserAPIKeysBlock)completion;
Swift
func fetchAPIKeys() async throws -> [RLMUserAPIKey]
Parameters
completion
A callback to be invoked once the call is complete.
-
Deletes a user API key associated with the current user.
Declaration
Objective-C
- (void)deleteAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func deleteAPIKey(_ objectId: RLMObjectId) async throws
Parameters
objectId
The ObjectId of the API key to delete.
completion
A callback to be invoked once the call is complete.
-
Enables a user API key associated with the current user.
Declaration
Objective-C
- (void)enableAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func enableAPIKey(_ objectId: RLMObjectId) async throws
Parameters
objectId
The ObjectId of the API key to enable.
completion
A callback to be invoked once the call is complete.
-
Disables a user API key associated with the current user.
Declaration
Objective-C
- (void)disableAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func disableAPIKey(_ objectId: RLMObjectId) async throws
Parameters
objectId
The ObjectId of the API key to disable.
completion
A callback to be invoked once the call is complete.