UserAPIKeyAuthProviderClient
public protocol UserAPIKeyAuthProviderClient
A protocol defining methods for creating, updating, and deleting the user API keys of a Stitch user.
-
Creates a user API key that can be used to authenticate as the current user.
Declaration
Swift
func createAPIKey(withName name: String, _ completionHandler: @escaping (StitchResult<UserAPIKey>) -> Void)Parameters
withNameThe name of the API key to be created.
completionHandlerThe handler to be executed when the request is complete. If the operation is successful, the result will contain the created user API key as a
UserAPIKey. -
Fetches a user API key associated with the current user.
Declaration
Swift
func fetchAPIKey(withID id: ObjectId, _ completionHandler: @escaping (StitchResult<UserAPIKey>) -> Void)Parameters
withIDThe id of the API key to fetch.
completionHandlerThe handler to be executed when the request is complete. If the operation is successful, the result will contain the created user API key as a
UserAPIKey. The fetched API key will not contain the actual key string. -
Fetches the user API keys associated with the current user.
Declaration
Swift
func fetchAPIKeys(_ completionHandler: @escaping (StitchResult<[UserAPIKey]>) -> Void)Parameters
completionHandlerThe handler to be executed when the request is complete. If the operation is successful, the result will contain the fetched API keys as an
[UserAPIKey]. The fetched API keys will not contain the actual key string. -
Deletes a user API key associated with the current user.
Declaration
Swift
func deleteAPIKey(withID id: ObjectId, _ completionHandler: @escaping (StitchResult<Void>) -> Void)Parameters
withIDThe id of the API key to delete.
completionHandlerThe handler to be executed when the request is complete.
-
Enables a user API key associated with the current user.
Declaration
Swift
func enableAPIKey(withID id: ObjectId, _ completionHandler: @escaping (StitchResult<Void>) -> Void)Parameters
withIDThe id of the API key to enable.
completionHandlerThe handler to be executed when the request is complete.
-
Disables a user API key associated with the current user.
Declaration
Swift
func disableAPIKey(withID id: ObjectId, _ completionHandler: @escaping (StitchResult<Void>) -> Void)Parameters
withIDThe id of the API key to disable.
completionHandlerThe handler to be executed when the request is complete.
UserAPIKeyAuthProviderClient Protocol Reference