Changeset View
Changeset View
Standalone View
Standalone View
services/identity/src/constants.rs
// Secrets | // Secrets | ||||
pub const SECRETS_DIRECTORY: &str = "secrets"; | pub const SECRETS_DIRECTORY: &str = "secrets"; | ||||
pub const SECRETS_FILE_NAME: &str = "secret_key"; | pub const SECRETS_FILE_NAME: &str = "secret_key"; | ||||
pub const SECRETS_FILE_EXTENSION: &str = "txt"; | pub const SECRETS_FILE_EXTENSION: &str = "txt"; | ||||
pub const SECRETS_SETUP_FILE: &str = "server_setup.txt"; | pub const SECRETS_SETUP_FILE: &str = "server_setup.txt"; | ||||
// DynamoDB | // DynamoDB | ||||
// User table information, supporting opaque_ke 2.0 and X3DH information | // User table information, supporting opaque_ke 2.0 and X3DH information | ||||
pub mod opaque2 { | |||||
// Users can sign in either through username+password or Eth wallet. | // Users can sign in either through username+password or Eth wallet. | ||||
// | // | ||||
// This structure should be aligned with the messages defined in | // This structure should be aligned with the messages defined in | ||||
// shared/protos/identity_client.proto | // shared/protos/identity_client.proto | ||||
// | // | ||||
// Structure for a user should be: | // Structure for a user should be: | ||||
// { | // { | ||||
// userID: String, | // userID: String, | ||||
// opaqueRegistrationData: Option<String>, | // opaqueRegistrationData: Option<String>, | ||||
// username: Option<String>, | // username: Option<String>, | ||||
// walletAddress: Option<String>, | // walletAddress: Option<String>, | ||||
// devices: HashMap<String, Device> | // devices: HashMap<String, Device> | ||||
// } | // } | ||||
// | // | ||||
// A device is defined as: | // A device is defined as: | ||||
// { | // { | ||||
// deviceType: String, # client or keyserver | // deviceType: String, # client or keyserver | ||||
// keyPayload: String, | // keyPayload: String, | ||||
// keyPayloadSignature: String, | |||||
// identityPreKey: String, | // identityPreKey: String, | ||||
// identityPreKeySignature: String, | // identityPreKeySignature: String, | ||||
// identityOneTimeKeys: Vec<String>, | // identityOneTimeKeys: Vec<String>, | ||||
// notifPreKey: String, | // notifPreKey: String, | ||||
// notifPreKeySignature: String, | // notifPreKeySignature: String, | ||||
// notifOneTimeKeys: Vec<String>, | // notifOneTimeKeys: Vec<String>, | ||||
// } | // } | ||||
// } | // } | ||||
// | // | ||||
// Additional context: | // Additional context: | ||||
// "devices" uses the signing public identity key of the device as a key for the devices map | // "devices" uses the signing public identity key of the device as a key for the devices map | ||||
// "keyPayload" is a JSON encoded string containing identity and notif keys (both signature and verification) | // "keyPayload" is a JSON encoded string containing identity and notif keys (both signature and verification) | ||||
// if "deviceType" == "keyserver", then the device will not have any notif key information | // if "deviceType" == "keyserver", then the device will not have any notif key information | ||||
pub const USERS_TABLE: &str = "identity-users-opaque2"; | pub const USERS_TABLE: &str = "identity-users"; | ||||
pub const USERS_TABLE_PARTITION_KEY: &str = "userID"; | pub const USERS_TABLE_PARTITION_KEY: &str = "userID"; | ||||
pub const USERS_TABLE_REGISTRATION_ATTRIBUTE: &str = "opaqueRegistrationData"; | pub const USERS_TABLE_REGISTRATION_ATTRIBUTE: &str = "opaqueRegistrationData"; | ||||
pub const USERS_TABLE_USERNAME_ATTRIBUTE: &str = "username"; | pub const USERS_TABLE_USERNAME_ATTRIBUTE: &str = "username"; | ||||
pub const USERS_TABLE_DEVICES_ATTRIBUTE: &str = "devices"; | pub const USERS_TABLE_DEVICES_ATTRIBUTE: &str = "devices"; | ||||
pub const USERS_TABLE_DEVICES_MAP_DEVICE_TYPE_ATTRIBUTE_NAME: &str = | |||||
"deviceType"; | |||||
pub const USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_ATTRIBUTE_NAME: &str = | pub const USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_ATTRIBUTE_NAME: &str = | ||||
"keyPayload"; | "keyPayload"; | ||||
pub const USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_SIGNATURE_ATTRIBUTE_NAME: &str = | |||||
"keyPayloadSignature"; | |||||
pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_ATTRIBUTE_NAME: &str = | pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_ATTRIBUTE_NAME: &str = | ||||
"identityPreKey"; | "identityPreKey"; | ||||
pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_SIGNATURE_ATTRIBUTE_NAME: | pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_SIGNATURE_ATTRIBUTE_NAME: | ||||
&str = "identityPreKeySignature"; | &str = "identityPreKeySignature"; | ||||
pub const USERS_TABLE_DEVICES_MAP_IDENTITY_ONETIME_KEYS_ATTRIBUTE_NAME: &str = | pub const USERS_TABLE_DEVICES_MAP_IDENTITY_ONETIME_KEYS_ATTRIBUTE_NAME: &str = | ||||
"identityOneTimeKeys"; | "identityOneTimeKeys"; | ||||
pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_ATTRIBUTE_NAME: &str = | pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_ATTRIBUTE_NAME: &str = "preKey"; | ||||
"preKey"; | pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_SIGNATURE_ATTRIBUTE_NAME: &str = | ||||
pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_SIGNATURE_ATTRIBUTE_NAME: | "preKeySignature"; | ||||
&str = "preKeySignature"; | |||||
pub const USERS_TABLE_DEVICES_MAP_NOTIF_ONETIME_KEYS_ATTRIBUTE_NAME: &str = | pub const USERS_TABLE_DEVICES_MAP_NOTIF_ONETIME_KEYS_ATTRIBUTE_NAME: &str = | ||||
"notifOneTimeKeys"; | "notifOneTimeKeys"; | ||||
pub const USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE: &str = "walletAddress"; | pub const USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE: &str = "walletAddress"; | ||||
pub const USERS_TABLE_USERNAME_INDEX: &str = "username-index"; | pub const USERS_TABLE_USERNAME_INDEX: &str = "username-index"; | ||||
pub const USERS_TABLE_WALLET_ADDRESS_INDEX: &str = "walletAddress-index"; | pub const USERS_TABLE_WALLET_ADDRESS_INDEX: &str = "walletAddress-index"; | ||||
} | |||||
pub const USERS_TABLE: &str = "identity-users"; | |||||
pub const USERS_TABLE_PARTITION_KEY: &str = "userID"; | |||||
pub const USERS_TABLE_REGISTRATION_ATTRIBUTE: &str = "pakeRegistrationData"; | |||||
pub const USERS_TABLE_USERNAME_ATTRIBUTE: &str = "username"; | |||||
pub const USERS_TABLE_DEVICES_ATTRIBUTE: &str = "devices"; | |||||
pub const USERS_TABLE_DEVICE_ATTRIBUTE_NAME: &str = "device"; | |||||
pub const USERS_TABLE_DEVICES_MAP_ATTRIBUTE_NAME: &str = "signingPublicKey"; | |||||
pub const USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE: &str = "walletAddress"; | |||||
pub const USERS_TABLE_USERNAME_INDEX: &str = "username-index"; | |||||
pub const USERS_TABLE_WALLET_ADDRESS_INDEX: &str = "walletAddress-index"; | |||||
pub const USERS_TABLE_INITIALIZATION_INFO: &str = "initializationInfo"; | |||||
pub const ACCESS_TOKEN_TABLE: &str = "identity-tokens"; | pub const ACCESS_TOKEN_TABLE: &str = "identity-tokens"; | ||||
pub const ACCESS_TOKEN_TABLE_PARTITION_KEY: &str = "userID"; | pub const ACCESS_TOKEN_TABLE_PARTITION_KEY: &str = "userID"; | ||||
pub const ACCESS_TOKEN_SORT_KEY: &str = "signingPublicKey"; | pub const ACCESS_TOKEN_SORT_KEY: &str = "signingPublicKey"; | ||||
pub const ACCESS_TOKEN_TABLE_CREATED_ATTRIBUTE: &str = "created"; | pub const ACCESS_TOKEN_TABLE_CREATED_ATTRIBUTE: &str = "created"; | ||||
pub const ACCESS_TOKEN_TABLE_AUTH_TYPE_ATTRIBUTE: &str = "authType"; | pub const ACCESS_TOKEN_TABLE_AUTH_TYPE_ATTRIBUTE: &str = "authType"; | ||||
pub const ACCESS_TOKEN_TABLE_VALID_ATTRIBUTE: &str = "valid"; | pub const ACCESS_TOKEN_TABLE_VALID_ATTRIBUTE: &str = "valid"; | ||||
pub const ACCESS_TOKEN_TABLE_TOKEN_ATTRIBUTE: &str = "token"; | pub const ACCESS_TOKEN_TABLE_TOKEN_ATTRIBUTE: &str = "token"; | ||||
Show All 25 Lines |