Ditto
1.0.8
|
The various identity configurations that you can use when initializing a Ditto instance. More...
Classes | |
struct | DevelopmentIdentity |
An identity to be used while in development when you want to control either or both of the app name and the site ID of the peer. More... | |
struct | ProductionIdentity |
The identity to use when in production. This accepts a certificate bundle, which includes identity information, as a base64-encoded string. More... | |
struct | SharedKeyIdentity |
An identity where every device knows the same secret key. This is a simplistic authentication mode which is normally only suitable for private apps where all the users and devices are trusted. More... | |
Public Types | |
enum | { DEVELOPMENT, SHAREDKEY, PRODUCTION } |
Public Member Functions | |
Identity (std::string app_name="", uint64_t site_id=0, std::string persistence_dir="") | |
Construct a new DevelopmentIdentity. More... | |
Identity (std::string app_name, std::string shared_key, uint64_t site_id=0, std::string persistence_dir="") | |
Construct a new SharedKeyIdentity. More... | |
Identity (std::string certificate_config) | |
Construct a new ProductionIdentity. More... | |
Identity (Identity const &other) | |
Public Attributes | |
std::shared_ptr< CAuthClient_t > | auth_client |
enum ditto::Identity:: { ... } | type |
union { | |
struct DevelopmentIdentity dev | |
struct SharedKeyIdentity shared_key | |
struct ProductionIdentity prod | |
}; | |
The various identity configurations that you can use when initializing a Ditto instance.
The different supported identities are as follows:
|
explicit |
Construct a new DevelopmentIdentity.
app_name | the name of the app. Use this to ensure that connections between devices are only established if they share the same app name. | |
site_id | the site ID for the device. Use this to identity different users or devices. Site IDs are persisted between sessions when using a development identity. Site IDs should be unique and not reused by different users or devices. | |
[in] | persistence_dir | the directory to be used to cache identity-related data. |
|
explicit |
Construct a new SharedKeyIdentity.
[in] | app_name | the name of the app, specified in domain format, e.g. "app.ditto.live". All peers must use the same app name to communicate. |
[in] | shared_key | a base64-encoded DER private key. Refer to Ditto documentation for details about generating shared keys. |
[in] | site_id | the site ID for the device. For shared key mode, this can be left unspecified to choose a random number. |
[in] | persistence_dir | the directory to be used to cache identity-related data. |
|
explicit |
Construct a new ProductionIdentity.
config | a base64-encoded string representation of a certificate bundle. |