546
edits
Epoximator (talk | contribs) |
Epoximator (talk | contribs) (→Misc Commands: user + codes) |
||
Line 188: | Line 188: | ||
== Misc Commands == | == Misc Commands == | ||
=== ENCRYPT === | === ENCRYPT === | ||
Will cause all future messages from the server, except the first (the reply to the ENCRYPT command itself), to be encrypted (128 bit AES). The client will also have to encrypt all future requests sent to the server. All non-encrypted messages will be discarded by the server. The encryption key is the MD5 hash of a special ( | Will cause all future messages from the server, except the first (the reply to the ENCRYPT command itself), to be encrypted (128 bit [http://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES]). The client will also have to encrypt all future requests sent to the server. All non-encrypted messages will be discarded by the server. The encryption key is the [http://en.wikipedia.org/wiki/MD5 MD5] hash of a special ''API Password'' (defined in the users profile) concatenated with the salt string as given in the reply to the ENCRYPT message. A normal AUTH message is still necessary to authenticate and should follow the ENCRYPT command once the API has acknowledged the encryption. | ||
'''Command String:''' | '''Command String:''' | ||
Line 194: | Line 194: | ||
'''Possible Replies:''' | '''Possible Replies:''' | ||
* | * 209 {str salt} ENCRYPTION ENABLED | ||
* | * 309 API PASSWORD NOT DEFINED | ||
* 509 NO SUCH ENCRYPTION TYPE | |||
* | * 394 NO SUCH USER | ||
'''Info:''' | '''Info:''' | ||
* user is | * ''user'' is the user name. | ||
* type is type of encryption | * ''type'' is the type of encryption; 1 => 128 bit AES (only one defined). | ||
* | * ''API Password'' is the one defined in the profile settings [http://anidb.info/perl-bin/animedb.pl?show=profile page]. | ||
* | * It is not possible to disable the encryption once enabled while staying logged in. | ||
* | ** A logout (the logout message needs to be correctly encrypted) or timeout will disable the encryption. | ||
* | * In order to minimize server load, encryption should be disabled by default and should have to be enabled manually by the user in the configuration options. | ||
* | * The encryption key is md5(api_password_of_user+''salt''). | ||
=== ENCODING === | === ENCODING === | ||
Sets preferred encoding per session. | Sets preferred [http://en.wikipedia.org/wiki/Character_encoding encoding] per session. | ||
'''Command String:''' | '''Command String:''' | ||
Line 216: | Line 215: | ||
'''Possible Replies:''' | '''Possible Replies:''' | ||
* | * 219 ENCODING CHANGED | ||
* | * 519 ENCODING NOT SUPPORTED | ||
'''Info:''' | '''Info:''' | ||
* Supported encodings: http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html | * Supported encodings: http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html | ||
* Default: ASCII. | * Default: ASCII. | ||
* Resets to default on logout. | |||
=== [[UDP_API_Definition#AUTH:_Authing_to_the_AnimeDB|AUTH]] : extend === | === [[UDP_API_Definition#AUTH:_Authing_to_the_AnimeDB|AUTH]] : extend === | ||
Line 228: | Line 228: | ||
'''Info:''' | '''Info:''' | ||
* enc=x will change the encoding used. Supported encodings are [http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html these] | * When ''enc=x'' is defined the server will change the encoding used to x. | ||
* comp=1 means that the client supports compression ([http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/Deflater.html DEFLATE]). The server will compress (instead of truncating) the datagrams when needed if this option is enabled. The first two bytes of compressed datagrams will always be set to zero. (So tags should never start with that.) | **If the encoding is supported it will change right away (including the response) and be reset on logout/timeout. | ||
* Default [http://en.wikipedia.org/wiki/MTU_(networking) mtu] is 1400. Min = 400, Max = 1400. | **If not supported then the argument will be silently ignored. Use ENCODING to test what works. | ||
**Supported encodings are [http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html these]. | |||
* ''comp=1'' means that the client supports compression ([http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/Deflater.html DEFLATE]). | |||
**The server will compress (instead of truncating) the datagrams when needed if this option is enabled. | |||
**The first two bytes of compressed datagrams will always be set to zero. (So tags should never start with that.) | |||
* Default [http://en.wikipedia.org/wiki/MTU_(networking) ''mtu''] is 1400. Min = 400, Max = 1400. | |||
== USER: Retrieve uid == | |||
'''Command String:''' | |||
* USER user={str user name} | |||
'''Possible Replies:''' | |||
* 394 NO SUCH USER | |||
* 295 USER | |||
: {int4 uid} | |||
'''Info:''' | |||
* The client should the check length (3-10) and case (lower) of ''user'' before sending. | |||
== API Status Notification == | == API Status Notification == |
edits