diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8d7a9810..0b884c5fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +x.x.x Release notes (yyyy-m-dd) +============================================================= +NOTE: Support for syncing with realm.cloud.io and/or Realm Object Server has been replaced with support for syncing with MongoDB Realm Cloud. + +NOTE: This version bumps the Realm file format to version 11. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v1.0.0, might not be upgradeable. Only [Realm Studio 10.0.0](https://github.com/realm/realm-studio/releases/tag/v10.0.0-beta.1) or later will be able to open the new file format. + +### Enhancements +* None. + +### Fixed +* A crash when calling `user.apiKeys.fetchAll()` + +### Compatibility +* MongoDB Realm Cloud. +* APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.x.y series. +* File format: generates Realms with format v11 (reads and upgrades file format v5 or later). + +### Internal +* None. + 10.0.0-beta.9 Release notes (2020-7-15) ============================================================= NOTE: Support for syncing with realm.cloud.io and/or Realm Object Server has been replaced with support for syncing with MongoDB Realm Cloud. diff --git a/binding.gyp b/binding.gyp index b78b824639..00562040c1 100644 --- a/binding.gyp +++ b/binding.gyp @@ -28,6 +28,8 @@ "src/js_user.hpp", "src/js_network_transport.hpp", "src/js_email_password_auth.hpp", + "src/js_api_key_auth.hpp", + "src/js_auth.hpp", "src/node/sync_logger.cpp", "src/node/sync_logger.hpp", ] diff --git a/src/js_api_key_auth.hpp b/src/js_api_key_auth.hpp index d0faca1fe0..e6c33ab407 100644 --- a/src/js_api_key_auth.hpp +++ b/src/js_api_key_auth.hpp @@ -98,7 +98,7 @@ typename T::Object make_api_key(typename T::Context ctx, util::Optional::create_empty(ctx); if (api_key) { Object::set_property(ctx, api_key_object, "id", Value::from_object_id(ctx, api_key->id)); - Object::set_property(ctx, api_key_object, "key", Value::from_string(ctx, *(api_key->key))); + Object::set_property(ctx, api_key_object, "key", api_key->key ? Value::from_string(ctx, *(api_key->key)) : Value::from_undefined(ctx)); Object::set_property(ctx, api_key_object, "name", Value::from_string(ctx, api_key->name)); Object::set_property(ctx, api_key_object, "disabled", Value::from_boolean(ctx, api_key->disabled)); } diff --git a/tests/js/user-tests.js b/tests/js/user-tests.js index 5de75df612..60dee10cb8 100644 --- a/tests/js/user-tests.js +++ b/tests/js/user-tests.js @@ -200,9 +200,14 @@ module.exports = { let user = await app.logIn(credentials); TestCase.assertTrue(user.apiKeys instanceof Realm.Auth.ApiKeyAuth); - // TODO: Fix this to not respond with a 403 + //TODO: Enable when fixed: Disabling this test since the CI stitch integration returns cryptic error. + // const apikey = await user.apiKeys.create("mykey"); // const keys = await user.apiKeys.fetchAll(); // TestCase.assertTrue(Array.isArray(keys)); + + // TestCase.assertEqual(keys.length, 1); + // TestCase.assertDefined(keys[0].id); + // TestCase.assertEqual(keys[0].name, mykey); await user.logOut(); },