Services/KeyExchange: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 48: Line 48:


Anything else, like 404 or 503 must result in a complete termination of the password exchange. The client can retry the exchange then at a later time, starting all over with clean state.
Anything else, like 404 or 503 must result in a complete termination of the password exchange. The client can retry the exchange then at a later time, starting all over with clean state.
== Server APIs ==
The server provides three APIs:
'''GET''' '''https://''server''/new_channel'''
  Returns in the response body a random channel id encoded in JSON composed
  of 4 chars from  [a-z0-9]. When the API is called, The id returned is
  guaranteed to be unique. The channel created will have a ttl of 10 minutes.
 
  Return codes:
    - 200: channel created successfully 
    - 503: the server was unable to create a new channel.
'''GET''' '''https://''server''/''channel_id'' '''
  Returns in the response body the content of the channel of id ''channel_id''.
  Returns an ''ETag'' response header containing a unique hash.
 
  The request can contain a ''If-Not-Modified'' header containing a hash,
  If the hash is similar to the current hash of the channel, the server
  will return a 304 and an empty body.
   
  Return codes:
    - 200: data retrieved successfully 
    - 503: the server was unable to retrieve the content
    - 404: the channel does not exists. It was not created by a call
            to ''new_channel'' or timed out.
    - 304: the data was not changed.
 
'''PUT''' '''https://''server''/''channel_id'' '''
  Put in the channel of id ''channel_id'' the content of the request body.
  Returns an ''ETag'' response header containing a unique hash.
   
  Return codes:
    - 200: data set successfully 
    - 503: the server was unable to set the content
    - 404: the channel does not exists. It was not created by a call
            to ''new_channel'' or timed out.
'''DELETE''' '''https://''server''/''channel_id'' '''
  Delete the channel of id ''channel_id''.
   
  Return codes:
    - 200: channel deleted successfully 
    - 503: the server was unable to set the content
    - 404: the channel does not exists. It was not created by a call
            to ''new_channel'' or timed out.


== Flow ==
== Flow ==
Confirmed users
927

edits

Navigation menu