UDP API DEV: Difference between revisions

→‎Misc Commands: user + codes
(→‎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 (new/to be added) 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.
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:'''
* XXX {str salt} ENCRYPTION ENABLED
* 209 {str salt} ENCRYPTION ENABLED
* XXX NO SUCH USER
* 309 API PASSWORD NOT DEFINED
* XXX ENCRYPTION PASSWORD NOT DEFINED
* 509 NO SUCH ENCRYPTION TYPE
* XXX NO SUCH TYPE
* 394 NO SUCH USER


'''Info:'''
'''Info:'''
* user is username
* ''user'' is the user name.
* type is type of encryption, 1 => 128 bit AES, none other defined atm
* ''type'' is the type of encryption; 1 => 128 bit AES (only one defined).
* encryption pass must be set in profile settings on the website
* ''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
* 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
** 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.
* 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(special_api_password_of_user+salt)
* 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:'''
* XXX ENCODING ENABLED
* 219 ENCODING CHANGED
* XXX ENCODING NOT SUPPORTED
* 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. Reset on logout.
* 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]. The encoding will change right away (including the response), if it is supported, and be reset on logout/timeout.
* 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 ==
546

edits

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.