Labs/Weave/ConstantList

From MozillaWiki
< Labs‎ | Weave
Jump to: navigation, search

Constants

Auth Engine (Single Object):

	WEAVE_AUTH_ENGINE
	connection parameters based on type (host?, port?, username, password, db)
	
	currenty named constants per engine:
		WEAVE_MYSQL_AUTH_HOST
		WEAVE_MYSQL_AUTH_DB
		WEAVE_MYSQL_AUTH_USER
		WEAVE_MYSQL_AUTH_PASS
		
		WEAVE_LDAP_AUTH_HOST
		WEAVE_LDAP_AUTH_USER
		WEAVE_LDAP_AUTH_PASS
		WEAVE_LDAP_AUTH_DN
		WEAVE_LDAP_AUTH_USER_PARAM_NAME
		

	should be reduced to something like:

		{type: <ldap_mozilla>,
		 connection: {host: <host>,
					  user: <user>,
					  password: <pass>}}
	 			  

Storage Engine

Currently, there are three types of storage engine: read, write and secondary write. We'll want a config and code that will let us handle them all eventually, though for now we are reading and writing to the same machine.


	WEAVE_STORAGE_ENGINE
	WEAVE_STORAGE_SECONDARY_ENGINE
	WEAVE_MYSQL_STORE_READ_HOST
	WEAVE_MYSQL_STORE_READ_DB
	WEAVE_MYSQL_STORE_READ_USER
	WEAVE_MYSQL_STORE_READ_PASS
	WEAVE_MYSQL_STORE_READ_PORT
	WEAVE_MYSQL_STORE_WRITE_HOST
	WEAVE_MYSQL_STORE_WRITE_DB
	WEAVE_MYSQL_STORE_WRITE_USER
	WEAVE_MYSQL_STORE_WRITE_PASS
	WEAVE_MYSQL_STORE_WRITE_PORT
	WEAVE_MYSQL_STORE_TABLE_NAME
	WEAVE_USER_TABLE_MODULO
	WEAVE_MYSQL_STORE_COLLECTION_NAME

It makes sense to do this in a flexible block:

	
		{primary: {type: <mysql>,
				   connection: {host: <host>, db: <db>, user: <user>, password: pass, port: <int>, table: <name>, collection_table: <name>, modulo: <int>}},
		 read: [{type: ...}, {type: ...}],
		 write: [{type:...}, {type: ...}]}

The server will write to the primary server and any additional write servers specified. It will read from a random read server or, if no read servers are defined, the primary server.

We should probably just pass the config block straight into the class constructor.


Memcache

Memcache is an optional feature - the entire api needs to perform correctly if it isn't configured. It currently supports tab storage and collections metadata. It's expected that in the future it will support quotas and likely some form of rate limiting.

	
	WEAVE_STORAGE_MEMCACHE_HOST
	WEAVE_STORAGE_MEMCACHE_PORT
	WEAVE_STORAGE_MEMCACHE_DECAY

MEMCACHE_HOST is a colon separated list of servers. It needs to be identical on all webheads or all sorts of badness happens.


Abuse

WEAVE_PAYLOAD_MAX_SIZE

Prevents a user from uploading gigantic files into the db

WEAVE_QUOTA

The maximum size of data the user is allowed to keep. Process is documented in | Quota Algorithm. The value is in bytes.

WEAVE_STORAGE_LOCKOUT_COUNT

WEAVE_STORAGE_LOCKOUT_DECAY

Certain activities (currently failed logins) trigger a lockout, where if the user exceeds the threshold within the time limit, they are locked out for the remainder of the time limit.


Misc

WEAVE_DEFAULT_TEST_USERNAME

WEAVE_DEFAULT_TEST_PASSWORD

These were originally designed for faking a heartbeat, and I think we can ignore them in favor of better solutions.

WEAVE_CEF_DEVICE

Prefix to use for CEF logging. The CEF class also defines a set of constants, but those are external to the sync server