• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hypothesis / h / 8664 / 1
68%
master: 97%

Build:
Build:
LAST BUILD BRANCH: realtime-update-v1-h-only-1
DEFAULT BRANCH: master
Ran 16 Oct 2015 03:41PM UTC
Files 87
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Oct 2015 03:32PM UTC coverage: 68.492%. First build
8664.1

push

travis-ci

seanh
Add userid_domain config setting

Add a config setting that overrides the domain in userids like
"acct:seanh@domain.com". If no h.userid_domain config file setting or
USERID_DOMAIN environment variable is given it falls back on the old behavior:
use request.domain.

This new setting is useful for our staging and production sites.
request.domain is hypothes.is on production but stage.hypothes.is on staging.
The two sites share the same database and search index. It's actually the same
user account in the database that you're logging in to when you log in to
either staging or production, since the user accounts in the database are
keyed by just the username (eg. seanh) and don't use the domain part. But for
example the permissions access control lists in the annotations use the full
userids, acct:seanh@stage.hypothes.is or acct:seanh@hypothes.is. This means
that if you logged into your account via stage.hypothes.is you won't be able to
edit your annotations made while logged into production hypothes.is, and
vice-versa.

With this new config setting, we can override the domain on the staging site
so that you get acct:seanh@hypothes.is when you log into either site and can
always edit all of your annotations.

This commit also removes a feature from the get_by_userid() class method.
Previously you would pass it a domain like hypothes.is and a userid like
acct:seanh@hypothes.is, and if the two domains didn't match it would return
None. This could never happen because everywhere this method is called it's
passed request.domain and request.authenticated_userid so the domains always
match.

But with the new config setting, it's possible for request.authenticated_userid
to be acct:seanh@hypothes.is while request.domain is stage.hypothes.is, causing
get_by_userid() to return None, which breaks things, for example you can no
longer login.

I could change every place that calls get_by_userid() to pass in the
userid_domain setting instead of request.domain. But th... (continued)

2526 of 3688 relevant lines covered (68.49%)

0.68 hits per line

Source Files on job 8664.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8664
  • Travis Job 8664.1
  • 1a3698d7 on github
  • Next Job for on add-userid-domain-setting (#8665.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc