Commit Graph

61 Commits

Author SHA1 Message Date
Christian Melchior 4cb9c77f46
Query-based sync as the default sync mode (#1830) 2018-05-30 12:54:51 +02:00
Nabil Hachicha b321808f4b
Add password reset wrappers (#1699). (#1757)
* Add password reset wrappers (#1699).
2018-04-25 10:23:47 +01:00
Brian Nicholson 424ff81965 Stringify fetch body in logout (#1731)
* Stringify fetch body in logout
* Update changelog
2018-04-17 15:01:02 +02:00
Thomas Goyne c349d5f185 Retry on network errors when refreshing admin tokens (#1747)
* Retry on network errors when refreshing admin tokens

This is the same logic used for non-admin token user fetches, which seems to
already work fine in practice.
2018-04-12 18:20:25 +02:00
Kenneth Geisshirt c370ef4d86
Testing against ROS 3.0.0. (#1712)
* Testing against ROS 3.0.0.
* Adding Realm.Sync.Subscription.removeAllListeners. Refactor partial sync tests.
* Refactoring partial sync tests.
2018-03-21 18:18:37 +01:00
Thomas Goyne 635d49e09a Throttle HTTP requests made to the auth server
Making thousands of HTTP requests simultaneously inevitably results in some
failing or the server being overwhelmed, so limit how many can be made at once
(currently to the arbitrary cap of 5) and enqueue any further requests.
2018-03-15 17:02:51 -07:00
Kenneth Geisshirt 9d8a677ecf
Revoke refresh token upon logout. (#1696)
* Revoke refresh token upon logout.
* Always log out
2018-03-09 15:51:45 +01:00
Kenneth Geisshirt 0c67e2a834
Adding catch to refreshAdminToken. (#1631) 2018-01-18 13:26:14 +01:00
Thomas Goyne b9cce49972 Support opening Realms with an admin token without a working ROS directory service (#1615)
* Support opening Realms with an admin token without a working ROS directory service
2018-01-13 10:02:08 +01:00
Mark Rowe cd8db46aa7 When refreshing the token, look up the user in a way that doesn't suffer from #1586 (#1587)
* When refreshing the token, look up the user in a way that doesn't suffer
from #1586

Expose a means of looking up a user by identity and server to avoid
problems if the same user identity exists for multiple servers, which
can happen when connecting to the same server via different hostnames.

* Return undefined if the user doesn't exist rather than returning an object wrapping a null SyncUser.
2018-01-11 16:00:31 +01:00
Thomas Goyne ce67446976 Perform a pseudo-refresh for admin token users (#1599)
* Perform a pseudo-refresh for admin token users

Although we don't need to actually refresh the token, when multiplexing is
enabled we do still need to hit ROS to let it know we're accessing a Realm and
get the sync label.

* Adding brief JSdoc and TS definition for isAdminToken.

* Perform a pseudo-refresh for admin token users

Although we don't need to actually refresh the token, when multiplexing is
enabled we do still need to hit ROS to let it know we're accessing a Realm and
get the sync label.

* Adding brief JSdoc and TS definition for isAdminToken.

* Make the timeout consistent

* Add basic docs for multiprocess notifications (#1594)

* Add basic docs for multiprocess notifications

* Adopt core's query parser and update to core v5.1.2 (#1563)

* Adopt core's query parser.
* Realm Core 5.1.2
* Realm Sync 2.2.9

* Remove tar.xz (#1585)

* remove tar.xz decompression and lzma deps

* Fixing merge

* Updating object store
2018-01-11 14:47:54 +01:00
Nikola Irinchev d6a8cbb1f3
Explicitly send register: false during login (#1596)
* Explicitly send register: false during login

* Update CHANGELOG.md
2018-01-08 11:32:05 +02:00
Kenneth Geisshirt 16a218ad49
Adding JWT auth (#1564)
* Adding method Realm.Sync.User.authenticate()
* Adding JWT provider support to Realm.Sync.User.authenticate()
* Adding password provider support to Realm.Sync.User.authenticate()
2018-01-05 09:38:53 +01:00
Constantin S. Pan 1b0f6c0b21
Increase the token refresh timeout to 10 sec (#1584) 2017-12-21 14:14:07 +01:00
Kræn Hansen 70004b9304 Checking the content-type of authentication responses (#1556)
* Checking the content-type of authentication responses
* Adding a changelog entry
* Fixing changelog typos and line endings
2017-12-07 10:36:24 +01:00
Thomas Goyne 8faf94918b Use the sync label as the multiplex identifier 2017-11-16 16:36:58 -08:00
blagoev 0b5aa68c62 Revert "Merge pull request #1409 from realm/kneth/bugfix/invalid-token"
This reverts commit 4055c9e047, reversing
changes made to d6b3fcb8b1.
2017-10-17 00:51:47 +03:00
Kenneth Geisshirt 7e85220e47 Merge branch 'kneth/bugfix/invalid-token' of github.com:realm/realm-js into kneth/bugfix/invalid-token 2017-10-13 18:18:05 +02:00
Kenneth Geisshirt 28c51335d2 Ugly hack. 2017-10-13 18:12:30 +02:00
Kenneth Geisshirt fca7cd4566 wip 2017-10-13 14:39:28 +02:00
Kenneth Geisshirt e109e32ac4 Merge branch 'master' of github.com:realm/realm-js into kneth/master-to-2.0.x 2017-09-30 09:55:14 +02:00
blagoev 7e048a9bee Merge pull request #1338 from realm/fix-accountInfo-2.0
Fix account info 2.0
2017-09-28 10:08:47 +03:00
Mark Rowe 666d606914 Specify a timeout when making the HTTP request to refresh access tokens. (#1356)
* Specify a timeout when making the HTTP request to refresh access tokens.

Without the timeout, some requests are silently never made.

Fixes realm/realm-js-private#338.

* Add a changelog entry.
2017-09-27 22:52:14 +02:00
Ashwin Phatak e1b70c2f57 Workaround for RN >= 0.49 metro-bundler check for single string literal argument to require() (#1342) 2017-09-26 10:00:31 +05:30
blagoev ec6e700d33 fix retrieveAccount endpoint 2017-09-22 20:10:04 +03:00
Kenneth Geisshirt eeb78d8e1b Merge branch 'master' of github.com:realm/realm-js into 2.0.x 2017-09-18 09:46:36 +02:00
blagoev ba9321834b Fix _authenticate method to use promises only 2017-09-12 23:04:20 +03:00
blagoev 115a2c9902 add deprecated warnings 2017-09-12 20:38:43 +03:00
blagoev 3fbd1291e1 fix _authenticate call to always pass the json object 2017-09-12 20:26:08 +03:00
Maximilian Alexander 78515e3b48 adding promisified apis 2017-09-12 20:10:52 +03:00
Kenneth Geisshirt eac393571d checkTypes() must only check the shortest array (#1297)
* Allow optional arguments when checking types
2017-09-12 15:17:59 +02:00
Kenneth Geisshirt 356033a8c4 Merge branch 'tg/update-object-store' of github.com:realm/realm-js into 2.0.x 2017-09-08 14:56:01 +02:00
Thomas Goyne 736277084e Fix creating admin token users 2017-08-31 13:49:45 -07:00
Thomas Goyne 26b4cdf33f Report what went wrong when refreshAccessToken fails 2017-08-31 13:49:45 -07:00
Thomas Goyne e75496571f Fix unhandled promise rejection warnings when access token refreshing fails 2017-08-31 13:49:45 -07:00
Kristian Dupont 402bf48f88 Permissions api (#1244)
* Add basic permissions skeleton

* ...

* Update permissions api

* Wait for server to process management realm, add offer api

* Fix test of apply and get permissions, add offer test

* Accept permission offer

* Accept permission offer test

* Invalidate permission offer

* Add basic docs (still need some links etc)

* Refactor tests

* Only run permission tests where sync is enabled

* Use legal syntax for user name generation

* Add changelog entry

* Streamline permission tests

* Fix casing for access level names etc.

* Add basic definitions to index.d.ts

* Use settimeout for resolving promise from listener

* Complete typescript defs

* Improve docs

* Allow 'any' as default recipient in getGrantedPermissions

* Fix getSpecialPurposeRealm on iOS

* Response to PR comments

* Respond to PR comments

* Fix offer description

* Skip permission tests in chrome debugger :-/
2017-08-29 15:23:22 +02:00
Yavor Georgiev ab29ac4490 Fix linter issues (#1132) 2017-07-10 16:53:00 +02:00
Yavor Georgiev 1ba9b434b4 Add a new optional server parameter to User.adminUser (#1111)
* add a new optional server parameter to User.adminUser

This enables `User.openManagementRealm()` for admin token users.

* changelog

* API docs
2017-07-10 15:04:55 +02:00
blagoev 9ea5dd7f8c address review comments 2017-07-07 16:38:13 +03:00
blagoev e31529397f Add tests for retrieveAccount method
fix admin-user-helper wait for admin to correctly wait
2017-07-07 10:31:29 +03:00
blagoev 42e03e038d Add support for getting user id
For #1090
2017-07-07 10:31:29 +03:00
Yavor Georgiev 7ab3aff82f Expose admin users to JS (#1100)
The JS binding used to conflate `SyncUser::is_admin()` with the user being created by calling `Realm.Sync.User.adminToken()`, but now that we expose a user’s role on the server under `is_admin()` this supposition is no longer correct.

#1097 attempted to fix one such case, but fixing it only uncovered another: in `UserClass<T>::all_users()`.  I’ve gone through all the callsites of `SyncUser::is_admin()` to make sure they don’t assume an admin token user.
2017-06-27 20:32:34 +02:00
Yavor Georgiev 3e80683ad8 Extract admin status from the refresh token (#1078)
* Extract admin status from the refresh token

Fixes #1063

* wire up rpc
2017-06-17 16:59:15 +02:00
Kristian Dupont 045b963d6f Change fragile test to wait for signal rather than for a period of time (#936)
* Change test to wait for signal rather than for 4 seconds

* Tiny refactoring
2017-03-24 12:49:28 +01:00
Kristian Dupont 5bece3d5c4 Validate user-methods parameters (#924)
* Validate user-methods parameters

* Switch homemade typeof operator for real one.

* Fix array prototype access
2017-03-20 12:52:41 +01:00
Kristian Dupont 94f8d5a891 Add optional userInfo param to registerWithProvider (#915)
* Add optional userInfo param to registerWithProvider

* Fixes per PR comments
2017-03-17 14:13:03 +01:00
Radu Tutueanu 716201a1fe Fix loading the constructor for node-server-sdk 2017-02-08 13:36:43 +01:00
Yavor Georgiev 7c1dab7079 Propagate token refresh errors to the session error handler (#843)
* Get a session’s error handler

* Change the signature of all methods to add the callee

* Deserialize rpc callbacks

* Expose the session error handle on its config property

* When a token refresh error occurs and there is a session error handler

propagate the error to the handler
2017-02-07 11:01:26 +01:00
Yavor Georgiev bb0dc575c9 Implement proactive access token refresh (#842)
Closes #840
2017-02-03 16:40:13 +01:00
Yavor Georgiev b2da398559 Fix token refresh and session bugs in chrome debugging (#831) 2017-02-01 23:44:56 +01:00