Commit Graph

6385 Commits

Author SHA1 Message Date
Charlie Groves d40dad55fe Unused imports
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6489 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-10 23:40:20 +00:00
Tom Conkling 0a5751239f Whoops, fix import ordering
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6488 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-09 20:52:05 +00:00
Tom Conkling 7dc50f23d6 Make Streamer.registerStreamer public, and add a warning if an existing Streamer is replaced.
(In Who, we need to stream com.threerings.geom.Vector2, so we need a custom Streamer for it)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6487 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-09 20:50:52 +00:00
Par Winzell f18cd38c3d Try again - instead of a major reorganization, simply extend the range of conversions. An [B is always a ByteArray, and after that, any array becomes a TypedArray.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6486 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-08 23:26:32 +00:00
Par Winzell 25f1eac53d Reluctantly back out 6484. It wasn't quite that simple. The problem appears to be that the AS3 the templates actually end up generating depends on the original sussed-out Java types in sometimes non-obvious ways; for example, parameter types collapse bytes, characters, shorts and ints to a mere 'int', without us really being able know in advance, so we will be generating superfluous e.g. util.Byte imports. A more elegant solution might be to construct Java imports and AS imports side by side in the earlier phases.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6485 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-08 22:57:00 +00:00
Par Winzell 9a985c0629 Assemble all the ad-hoc translations of primitive (and other) Java types to AS3 variants in one method and call that method. This should hopefully end us up with generated service listeners that compile.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6484 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-08 22:02:17 +00:00
Andrzej Kapolka f08f8158f0 Pass the mode into mogrifyChat.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6483 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-08 01:55:23 +00:00
Jamie Doornbos 8a1ff4ac4b RFC: providing a way to generically detect the language and machine identity for a connection
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6482 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-07 23:15:15 +00:00
Par Winzell 5df4dfe91c Handle Comparable too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6481 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-07 21:01:32 +00:00
Mark Johnson d00d0ca5da You can now specify a client must require a secure channel to authenticate. If this is set,
{Client.setRequireSecureAuth} then if the client fails to create a secure channel with the server,
an auth request with no credentials will be sent.  The supplied Authenticator will need to handle
this situation to send the appropriate response back to the client (ie: tell it to download the
latest version).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6480 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-04 23:14:45 +00:00
Mark Johnson 92c5163707 - Have the PublicKeyCredentials provide the secure version being used on the client, so when we
eventually change how the handshake works, we can maintain backwards compatability with the old
clients


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6479 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-04 22:10:16 +00:00
Mike Thomas e93459bdb9 Fix some 1.6isms and add a missing @Override
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6478 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-04 21:33:39 +00:00
Mark Johnson ae6c134546 An optional secure channel can be created for authentication to ensure credentials are encrypted
when sent to the server.

To implement a secure authentication channel:

- Create a key pair using the com.threerings.presents.tool.KeyPairGen tool.  You will need to
distribute the public key with your client, and the private key with the server.

- On your server during initialization, use PresentsConnectionManager.setPrivateKey to set the
private key.  It can take the key string gerenated by KeyPairGen.  This will return true if the
key was sucessfully set and the server supports the encryption necessary.

- On your client before authenticating, use Client.setPublicKey to set the public key.  As with
setPrivateKey, it will return true if the client supports the encryption necessary.

That's it!  You should now be authenticating over a secure encrypted channel.  The server can 
still accept unsecured authentication attempts (for the purpose of telling the client it needs a
new version to get the server's public key).  A failure to decrypt the client credientials on the
server will return a new "m.failed_to_secure" authentication code.

Handshake process:
- The client generates a random 128-bit key, and encodes it with the public key using a 32-bit
salt (PublicKeyCredentials).  This is sent to the server as a SecureRequest.
- The server decrypts the i128-bit key using its private key and verifies it against the salt.  If
verification fails, a failed secure response is returned and the client will authenticate over a
clear channel.  If verification succeeds, the server generates a random 128-bit AES key and
encodes it with the 128-bit key sent from the client.  This is sent back to the client as a
SecureResponse.
- The client will decode the AES key sent from the server (using the random key it generated at
the start of the handshake).  Using the AES key, the client will encrypt their credentials using
an AESAuthRequest and send it to the server.
- The server can now decrypt the credentials from the client and pass the AESAuthRequest to the
configured authenticators to complete authentication.  If the server fails to decrypt the
credentials a "m.failed_to_secure" authentication code is returned to the client.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6477 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-04 19:38:53 +00:00
Charlie Groves 540f84194d Break out a method to find all applicable nodes for a NodeRequest, and add a class to hold a node name and an oid to fully address a DObject in a peered environment.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6476 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-04 04:46:17 +00:00
Mike Thomas 5b6c9a71e5 Fix a bit of a memory leak wherein if a DObject happened to be destroyed prior to its clients unsubscribing, that DObject would be kept until the sessions still subscribed to that object logged off. Due to various client-side timing bits this could happen even if the server sends a message to clients that causes them to unsubscribe prior to calling destroyObject.
A concrete example of this is on PlaceObjects - If the server tells users to leave a place and then calls shutdown on the PlaceManager, thus destroying the object, the client will receive the leave-place message, queue up an unsubscribe, receive the destroy message, remove the object from their object cache, and then be unable to unsubscribe back to the server due to no longer having the DObject in question.

Now, if a PresentsSession received a destroy event for an object its client is subscribed to, it will delete the subscription, and instead note the oid as a destroyed subscription for use in validation if lingering unsubscribe requests are pending (they can frequently be).  This still potentially leaks the oid int until the session is ended, but the DObject can be collected.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-03 19:28:34 +00:00
Tom Conkling 04df68ea68 Add an IntervalFactory interface, which just declares newInterval(), and have RootDObjectManager extend it.
Leaving RootDObjectManager's declaration of newInterval() alone, because it contains docs that are specific to its implementation.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6474 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-02 01:27:38 +00:00
Michael Bayne 084f5ba944 Fixed typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6473 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-01 19:37:59 +00:00
Charlie Groves c19b395a43 Name normalization has been space sensitive for nearly 7 years now. Stop saying otherwise.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6472 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-31 07:08:12 +00:00
Par Winzell 8b3bb03751 Import fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6471 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-30 05:43:03 +00:00
Charlie Groves 2c17d66f02 Add the messageReceived and destroyed signals to DObject rather than generating them. If they were generated, subclassing would fail on field conflicts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6470 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-28 19:33:46 +00:00
Charlie Groves a381c8544e We only need ooo-external for these now
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6469 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-28 19:32:30 +00:00
Michael Bayne 45879635a3 Let's preserve binary compatibility with extant DObjects for a little while.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6468 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-27 20:12:40 +00:00
Andrzej Kapolka 871cc2eb63 Avoid a ClassCastException when we transfer a marshaller from client to server
(as we sometimes do when we transfer a player between peers in Project X).
Technically we probably shouldn't be streaming the marshallers in that case,
but doing this (and clearing the marshaller on the receiving end) is simpler
than clearing, streaming, and restoring; or settings things up so that the
marshaller is specifically excluded from streaming in transfers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6467 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-24 23:41:29 +00:00
Andrzej Kapolka fb822af0e9 It's probably worth including the stack trace for this warning, since it
can come from various different places.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6466 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-24 22:19:40 +00:00
Andrzej Kapolka 6d36a54999 I don't think this will break anything: provide a means for names to override
the default comparison methods in a symmetric way (so that it doesn't matter
which of the two objects' equals/compareTo methods was called).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6465 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-20 05:06:54 +00:00
Charlie Groves 92c1225d0e Deploy a sources jar along with the code jar for IDE-happiness
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6464 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-20 00:40:12 +00:00
Mike Thomas 1463fe0fce Step 2 in getting the *-poms versions to match pom versions.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6434 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-18 17:55:31 +00:00
Mike Thomas 4bbc8adaf1 And move the tools-pom in line too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6433 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-18 17:47:13 +00:00
Mike Thomas 193506a7c7 Step 1 in bringing gwt-pom up to pom's version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6432 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-18 17:41:39 +00:00
Mike Thomas 89b7a4df80 Step 1 in bringing as-pom up to pom's version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6431 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-18 17:37:02 +00:00
Mike Thomas 4c44d7063b Increment version to 1.5-SNAPSHOT
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6430 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-14 19:43:57 +00:00
Mike Thomas 266cb13db1 Set this as narya 1.4
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6429 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-14 19:31:05 +00:00
Charlie Groves 52afa1d654 Use m2eclipse for Eclipse configuration
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6428 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-11 23:46:41 +00:00
Charlie Groves 50b19cdee0 Unnecessary import
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6427 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-11 18:53:59 +00:00
Tom Conkling 5c3e0ed825 Make OidList Iterable
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6426 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-10 22:47:09 +00:00
Par Winzell 0e8f5e4da4 If we generate arg1, ... parameters but arg0, ... arguments, things go badly.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6425 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-10 20:27:30 +00:00
Par Winzell 5b2ee423bf This is why typechecking is a good thing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6424 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-07 20:58:42 +00:00
Par Winzell d66ed6f7fe This method is in fact defined on the listener.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6423 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-07 20:58:17 +00:00
Ray Greenwell aff817a70f Charlie notes that if the old code worked, we can surely eliminate the
setManager call.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6422 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 23:51:56 +00:00
Ray Greenwell bc5303b0fa This must not have been a bug, but it sure looks like one.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6421 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 23:42:35 +00:00
Charlie Groves 8f8a50c9e8 Apply additions and removals to OidList fields on DObjects immediately on the server to make it
match DSets and setting attributes.  With the old behvaior, if a client subscribed to a DObject and
modified an OidList on it in a single pass, it could miss the modification.  The DObject is
serialized immediately when the server gets the subscription request, but events aren't sent for
that subscription till it's processed the next time the omgr queue comes round.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6420 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 09:15:47 +00:00
Charlie Groves b4af8a0384 Include the traceback when we fail to extract a name from source
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6419 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 09:09:01 +00:00
Charlie Groves edf6dccdf7 Generate OidList signals for actionscript
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6418 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 09:08:24 +00:00
Andrzej Kapolka 2572112560 Need to splice the arguments, too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6417 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 03:30:51 +00:00
Andrzej Kapolka 5a66c46308 Yeah, thanks for that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6416 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 03:25:09 +00:00
Tom Conkling 0dae31b2c9 ActionScript DObjects dispatch a signal when they receive a MessageEvent
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6415 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-05 23:49:45 +00:00
Andrzej Kapolka f9ce9f6939 On second thought, let's configure the standalone client reference via an
optional injection.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6414 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-05 02:03:25 +00:00
Andrzej Kapolka 0c28d31357 Initializing the invocation director reference on deserialization doesn't work
well in standalone mode.  We need a way to install a director on registration.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6413 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-05 01:32:13 +00:00
Tom Conkling 68aba0e92a Add a mapping from java.lang.Cloneable -> com.threerings.util.Cloneable
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6412 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-05 00:21:16 +00:00
Andrzej Kapolka 49c6511fd1 Because getInterfaces only returns the interfaces implemented by the class
(not by its superclasses), we need to rise through its superclasses as well
in order to find the provider interface.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6411 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-04 22:46:22 +00:00