Flexible config API for UserCouch.bootstrap()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UserCouch |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
I'm trying to stabilize the key public bits of the UserCouch API so we can document it and get other folks using it.
The UserCouch.
bootstrap(
To:
bootstrap(
If supplied, `overrides` should be a dictionary supplying config values. It can override default values like "address" or "loglevel", but it can also provide static values for stuff like "username" or "password" or "oauth". When these values aren't provided, UserCouch.
This change allows us to easily extend the values we provide in overrides, but without changing the method signature.
One key thing that can't be supplied through `overrides` is the port. I toyed with this idea for a while, but at the end of the day, UserCouch is for starting per-user CouchDB instances, which by definition means the port wont be static. At this point, I don't think it's worth the complexity to make it possible to provide a static port.
However, you can provide any of these things in the `overrides` dictionary:
* address
* loglevel
* username (for auth='basic' or auth='oauth')
* password (for auth='basic' or auth='oauth')
* oauth (for auth='oauth')
You can also supply the "salt" used when hashing the password, but that's only intended for testing purposes.
I'm also doing some general code-cleanup to better organize the code and make it easier to review.
Related branches
- Jason Gerard DeRose: Approve
-
Diff: 1084 lines (+617/-278)3 files modifiedusercouch/__init__.py (+154/-101)
usercouch/tests/__init__.py (+456/-177)
usercouch/tests/test_misc.py (+7/-0)
description: | updated |
description: | updated |
description: | updated |
Changed in usercouch: | |
status: | In Progress → Fix Committed |
Changed in usercouch: | |
status: | Fix Committed → Fix Released |
description: | updated |