Commit Graph

70 Commits

Author SHA1 Message Date
Nikola Irinchev 4e6f95d3d0
Throw a meaningful error when refreshing a token for an invalid Realm path (#2084)
* Throw a meaningful error when refreshing a token for an invalid Realm path

* Changelog

* Fix a typo

* Fix a test
2018-10-24 00:33:34 +02:00
Nikola Irinchev 10f72c5444
Don't schedule multiple token refreshes for the same user/realm (#2071)
* Don't schedule multiple token refreshes for the same user/realm

* Avoid setting a const property
2018-10-15 14:20:19 +02:00
Nikola Irinchev 90c0661715
Auth fixes (#2050)
* Auth fixes
- Typescript definitions for User.login
- Exception thrown from registerWithProvider when a userInfo is not specified

* Ensure we don't use adminUser internally
2018-10-08 15:01:12 +02:00
Kenneth Geisshirt be98a77fcf
Logging in using an admin token should be synchronous (#2040)
* Logging in using an admin token should be synchronous
2018-09-24 12:43:44 +02:00
Kenneth Geisshirt 2ea71934d0
Logging in using admin token should also return a promise (#2038)
* Logging in using admin token should also return a promise
* use the node_require trick
2018-09-21 14:24:37 +02:00
Nabil Hachicha 111e9c223f Adding permission schema for query based sync (#2027)
* Adding permission schema when opening the Realm
* Adding permission schema implicitly for query based Realms
* Remove old code
* Remove outdated test
2018-09-19 16:16:44 +02:00
Nikola Irinchev 80cde7a5b0 Redesign user auth (#2002)
* Refactor user auth
* Allow to override the jwt provider name
* Add custom provider and changelog
* Remove the callback argument from docs
2018-09-13 08:45:06 +02:00
Nikola Irinchev 477b900530
Expose user serialize and deserialize methods (#1996)
* Expose serialize and deserialize methods

* Changelog and docs

* Forgot to save changelog 🤦‍♂️

* Add input validation
2018-08-28 15:01:32 +02:00
Christian Melchior a58a984f3f
Automatically add schemas for object level permissions. (#1970) 2018-08-17 10:10:20 +02:00
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