realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

ApiKeyAuthProvider API

Open sync-by-unito[bot] opened this issue 4 years ago • 1 comments

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
}

sync-by-unito[bot] avatar Sep 02 '21 13:09 sync-by-unito[bot]

Also remember to update CredentialsTests when this is complete.

cmelchior avatar Mar 23 '22 15:03 cmelchior