realm-kotlin
realm-kotlin copied to clipboard
ApiKeyAuthProvider API
Similar to Realm Java we should expose the ApiKeyAuth API:
interface ApiKey {
val id: ObjectId
val value: String?
val name: String
val enabled: Boolean
}
interface io.realm.mongodb.auth.ApiKeyAuth {
suspend fun create(name: String): ApiKey
suspend fun delete(id: ObjectId)
suspend fun disable(id: ObjectId)
suspend fun enable(id: ObjectId)
suspend fun fetch(id: ObjectId): ApiKey
suspend fun fetchAll(): List<ApiKey>
val user: User
val app: App
}
// Available from the App class
class App {
var apiKeyAuth: ApiKeyAuth
}
Also remember to update CredentialsTests when this is complete.